homebridge-deconz 0.1.13 → 0.1.14
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.
@@ -594,7 +594,7 @@ class Gateway extends AccessoryDelegate {
|
|
594
594
|
const device = this.deviceById[id]
|
595
595
|
delete this.exposeErrorById[id]
|
596
596
|
const { body } = device.resource
|
597
|
-
this.
|
597
|
+
this.log('%s: add accessory', body.name)
|
598
598
|
let { serviceName } = device.resource
|
599
599
|
if (DeconzAccessory[serviceName] == null) {
|
600
600
|
// this.warn('%s: %s: not yet supported %s type', body.name, body.type, rtype)
|
@@ -622,7 +622,10 @@ class Gateway extends AccessoryDelegate {
|
|
622
622
|
}
|
623
623
|
if (this.accessoryById[id] != null) {
|
624
624
|
this.monitorResources(this.accessoryById[id], false)
|
625
|
-
this.log(
|
625
|
+
this.log(
|
626
|
+
'%s: delete accessory%s', this.accessoryById[id].name,
|
627
|
+
delegateOnly ? ' delegate' : ''
|
628
|
+
)
|
626
629
|
this.accessoryById[id].destroy(delegateOnly)
|
627
630
|
delete this.accessoryById[id]
|
628
631
|
if (this.exposeErrorById[id] != null) {
|
@@ -71,14 +71,29 @@ class DeconzAccessory extends AccessoryDelegate {
|
|
71
71
|
|
72
72
|
this
|
73
73
|
.on('polled', (device) => {
|
74
|
+
let reExpose = false
|
74
75
|
this.values.firmware = device.resource.firmware
|
75
|
-
for (const subtype in
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
76
|
+
for (const subtype in device.resourceBySubtype) {
|
77
|
+
const resource = device.resourceBySubtype[subtype]
|
78
|
+
this.debug('%s: polled: %j', resource.rpath, resource.body)
|
79
|
+
const service = this.serviceBySubtype[subtype]
|
80
|
+
if (service == null) {
|
81
|
+
this.log('%s: new resource: %j', resource.rpath, resource.body)
|
82
|
+
reExpose = true
|
83
|
+
} else {
|
80
84
|
service.update(resource.body, resource.rpath)
|
81
|
-
}
|
85
|
+
}
|
86
|
+
}
|
87
|
+
for (const subtype in this.serviceBySubtype) {
|
88
|
+
const service = this.serviceBySubtype[subtype]
|
89
|
+
const resource = device.resourceBySubtype[subtype]
|
90
|
+
if (resource == null) {
|
91
|
+
this.log('%s: resource deleted', service.rpath)
|
92
|
+
reExpose = true
|
93
|
+
}
|
94
|
+
}
|
95
|
+
if (reExpose) {
|
96
|
+
this.gateway.reExposeAccessory(this.id)
|
82
97
|
}
|
83
98
|
})
|
84
99
|
.on('changed', (rpath, body) => {
|
@@ -59,6 +59,11 @@ class Label extends DeconzService.SensorsResource {
|
|
59
59
|
|
60
60
|
updateState (state, rpath) {
|
61
61
|
const buttonResource = this.buttonResources[rpath]
|
62
|
+
if (buttonResource == null) {
|
63
|
+
this.log('%s: resource deleted', rpath)
|
64
|
+
this.gateway.reExposeAccessory(this.accessory.id)
|
65
|
+
return
|
66
|
+
}
|
62
67
|
if (buttonResource.lastUpdated === '') {
|
63
68
|
buttonResource.lastUpdated = state.lastupdated
|
64
69
|
} else if (
|
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.14",
|
8
8
|
"keywords": [
|
9
9
|
"homebridge-plugin",
|
10
10
|
"homekit",
|
@@ -22,11 +22,11 @@
|
|
22
22
|
},
|
23
23
|
"engines": {
|
24
24
|
"deCONZ": "2.21.2",
|
25
|
-
"homebridge": "^1.6.
|
25
|
+
"homebridge": "^1.6.1",
|
26
26
|
"node": "^18.16.0"
|
27
27
|
},
|
28
28
|
"dependencies": {
|
29
|
-
"homebridge-lib": "~6.3.
|
29
|
+
"homebridge-lib": "~6.3.15",
|
30
30
|
"ws": "^8.13.0",
|
31
31
|
"xml2js": "~0.5.0"
|
32
32
|
},
|