homebridge-deconz 0.1.19 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -4
- package/cli/otau.js +13 -0
- package/lib/DeconzService/Battery.js +16 -3
- package/package.json +6 -5
package/README.md
CHANGED
@@ -78,10 +78,15 @@ Setting _Expose Lights_ will include the ZHAConsumption and ZHAPower `/sensors`
|
|
78
78
|
Note that HomeKit doesn't like configuration changes.
|
79
79
|
Allow ample time after exposing or removing accessories for HomeKit to sync the changed configuration to all Apple devices.
|
80
80
|
|
81
|
-
### Command-Line
|
82
|
-
Homebridge deCONZ includes the
|
83
|
-
monitor, and interact with
|
84
|
-
See the [`deconz`
|
81
|
+
### Command-Line Utilities
|
82
|
+
Homebridge deCONZ includes the following command-line utilities:
|
83
|
+
- `deconz`, to discover, monitor, and interact with deCONZ gateways.
|
84
|
+
See the [`deconz` Command-Line Utility](https://github.com/ebaauw/homebridge-deconz/wiki/deconz-Command%E2%80%90Line-Utility) in the Wiki for more info.
|
85
|
+
- `otau`, to download and analyse over-the-air-update firmware files for Zigbee devices.
|
86
|
+
- `ui` to configure a running instance of Homebridge deCONZ.
|
87
|
+
See [`Dynamic Configuration`](https://github.com/ebaauw/homebridge-deconz/wiki/Dynamic-Configuration) in the Wiki for more info.
|
88
|
+
|
89
|
+
Each command-line tool takes a `-h` or `--help` argument to provide a brief overview of its functionality and command-line arguments.
|
85
90
|
|
86
91
|
### Troubleshooting
|
87
92
|
- As mentioned above, Homebridge deCONZ is still under development. Sometimes, cached accessories from an older version might confuse a newer version, causing all sorts of weird errors. In this case, best un-expose the offending accessory, wait for HomeKit to remove it, and re-expose the accessory. Note that this will cause HomeKit to see a new accessory, and lose any associations with HomeKit rooms, groups, scenes, and automations.
|
package/cli/otau.js
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
|
3
|
+
// otau.js
|
4
|
+
// Copyright © 2023 Erik Baauw. All rights reserved.
|
5
|
+
//
|
6
|
+
// Command line interface to deCONZ gateway.
|
7
|
+
|
8
|
+
'use strict'
|
9
|
+
|
10
|
+
const { OtauTool } = require('hb-deconz-tools')
|
11
|
+
const pkgJson = require('../package.json')
|
12
|
+
|
13
|
+
new OtauTool(pkgJson).main()
|
@@ -14,12 +14,25 @@ const { dateToString } = ApiClient
|
|
14
14
|
*/
|
15
15
|
class Battery extends ServiceDelegate.Battery {
|
16
16
|
constructor (accessory, resource, params = {}) {
|
17
|
-
|
17
|
+
const batteryParams = {
|
18
18
|
name: accessory.name + ' Battery',
|
19
19
|
exposeConfiguredName: true
|
20
|
-
}
|
20
|
+
}
|
21
|
+
const state = resource.body.state
|
22
|
+
const config = resource.body.config
|
23
|
+
if (state.battery != null) {
|
24
|
+
batteryParams.batteryLevel = state.battery
|
25
|
+
batteryParams.lowBatteryThreshold = 20
|
26
|
+
if (state.charging != null) {
|
27
|
+
batteryParams.chargingState = state.charging
|
28
|
+
}
|
29
|
+
} else if (config.battery != null) {
|
30
|
+
batteryParams.batteryLevel = config.battery
|
31
|
+
batteryParams.lowBatteryThreshold = 20
|
32
|
+
}
|
33
|
+
super(accessory, batteryParams)
|
21
34
|
|
22
|
-
if (
|
35
|
+
if (state.battery != null) {
|
23
36
|
this.addCharacteristicDelegate({
|
24
37
|
key: 'lastUpdated',
|
25
38
|
Characteristic: this.Characteristics.my.LastUpdated,
|
package/package.json
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
"displayName": "Homebridge deCONZ",
|
5
5
|
"author": "Erik Baauw",
|
6
6
|
"license": "Apache-2.0",
|
7
|
-
"version": "0.1.
|
7
|
+
"version": "0.1.20",
|
8
8
|
"keywords": [
|
9
9
|
"homebridge-plugin",
|
10
10
|
"homekit",
|
@@ -18,16 +18,17 @@
|
|
18
18
|
"main": "index.js",
|
19
19
|
"bin": {
|
20
20
|
"deconz": "cli/deconz.js",
|
21
|
+
"otau": "cli/otau.js",
|
21
22
|
"ui": "cli/ui.js"
|
22
23
|
},
|
23
24
|
"engines": {
|
24
|
-
"deCONZ": "2.
|
25
|
+
"deCONZ": "2.22.2",
|
25
26
|
"homebridge": "^1.6.1",
|
26
|
-
"node": "
|
27
|
+
"node": "18.17.0||^18||^16"
|
27
28
|
},
|
28
29
|
"dependencies": {
|
29
|
-
"hb-deconz-tools": "~1.0.
|
30
|
-
"homebridge-lib": "~6.
|
30
|
+
"hb-deconz-tools": "~1.0.4",
|
31
|
+
"homebridge-lib": "~6.4.0"
|
31
32
|
},
|
32
33
|
"scripts": {
|
33
34
|
"prepare": "standard && rm -rf out && jsdoc -c jsdoc.json",
|