homebridge-deconz 1.0.17 → 1.0.18

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.
@@ -665,9 +665,12 @@ class Gateway extends AccessoryDelegate {
665
665
  let { serviceName } = device.resource
666
666
  await this.importAccessoryType(serviceName)
667
667
  if (DeconzAccessory[serviceName] == null) {
668
- // this.warn('%s: %s: not yet supported %s type', body.name, body.type, rtype)
668
+ // this.warn('%s: %s: accessory type not available', body.name, serviceName)
669
669
  serviceName = 'Sensor'
670
670
  }
671
+ if (this.context.settingsById[id]?.serviceName != null) {
672
+ await this.importServiceType(this.context.settingsById[id].serviceName)
673
+ }
671
674
  for (const resourceServiceName of Object.keys(device.subtypesByServiceName)) {
672
675
  await this.importServiceType(resourceServiceName)
673
676
  }
@@ -26,6 +26,8 @@ class Light extends DeconzAccessory {
26
26
  this.addPropertyDelegate({
27
27
  key: 'serviceName',
28
28
  value: device.resource.serviceName
29
+ }).on('didSet', (value) => {
30
+ gateway.context.settingsById[device.id].serviceName = value
29
31
  })
30
32
 
31
33
  this.service = this.createService(device.resource, {
@@ -139,8 +139,8 @@ class DeconzAccessory extends AccessoryDelegate {
139
139
  }
140
140
  if (DeconzService[params.serviceName] == null) {
141
141
  this.warn(
142
- '%s: %s: not yet supported %s type',
143
- resource.rpath, resource.body.type, resource.rtype
142
+ '%s: %s: service type not available',
143
+ resource.rpath, params.serviceName
144
144
  )
145
145
  return
146
146
  }
@@ -292,7 +292,7 @@ class DeconzAccessory extends AccessoryDelegate {
292
292
  case 'serviceName':
293
293
  if (this.values.serviceName != null) {
294
294
  value = OptionParser.toString(key, body[key])
295
- if (DeconzService[value] == null) {
295
+ if (['Light', 'Outlet', 'Switch', 'Valve'].includes(value) == null) {
296
296
  throw new Error(`${value}: illegal serviceName`)
297
297
  }
298
298
  this.values.serviceName = value
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "ebaauw"
8
8
  ],
9
9
  "license": "Apache-2.0",
10
- "version": "1.0.17",
10
+ "version": "1.0.18",
11
11
  "keywords": [
12
12
  "homebridge-plugin",
13
13
  "homekit",