homebridge-deconz 1.0.18 → 1.0.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.
@@ -163,7 +163,6 @@ class Gateway extends AccessoryDelegate {
163
163
  await this.client.restart()
164
164
  this.values.search = false
165
165
  this.values.unlock = false
166
- return
167
166
  } catch (error) { this.warn(error) }
168
167
  }
169
168
  })
@@ -179,7 +178,6 @@ class Gateway extends AccessoryDelegate {
179
178
  await this.client.search()
180
179
  await timeout(120000)
181
180
  this.values.search = false
182
- return
183
181
  } catch (error) { this.warn(error) }
184
182
  }
185
183
  })
@@ -194,7 +192,6 @@ class Gateway extends AccessoryDelegate {
194
192
  await this.client.unlock()
195
193
  await timeout(60000)
196
194
  this.values.unlock = false
197
- return
198
195
  } catch (error) { this.warn(error) }
199
196
  }
200
197
  })
@@ -25,8 +25,12 @@ class Alarm extends DeconzService.SensorsResource {
25
25
  }
26
26
 
27
27
  updateState (state) {
28
- if (state.alarm != null || state.test != null) {
29
- this.values.alarm = state.alarm || state.test
28
+ if (state.alarm) {
29
+ this.values.alarm = true
30
+ } else if (state.test) {
31
+ this.values.alarm = true
32
+ } else {
33
+ this.values.alarm = false
30
34
  }
31
35
  super.updateState(state)
32
36
  }
@@ -25,10 +25,12 @@ class CarbonMonoxide extends DeconzService.SensorsResource {
25
25
  }
26
26
 
27
27
  updateState (state) {
28
- if (state.carbonmonoxide != null || state.test != null) {
29
- this.values.carbonmonoxide = state.carbonmonoxide || state.test
30
- ? this.Characteristics.hap.CarbonMonoxideDetected.CO_LEVELS_ABNORMAL
31
- : this.Characteristics.hap.CarbonMonoxideDetected.CO_LEVELS_NORMAL
28
+ if (state.carbonmonoxide) {
29
+ this.values.carbonmonoxide = this.Characteristics.hap.CarbonMonoxideDetected.CO_LEVELS_ABNORMAL
30
+ } else if (state.test) {
31
+ this.values.carbonmonoxide = this.Characteristics.hap.CarbonMonoxideDetected.CO_LEVELS_ABNORMAL
32
+ } else {
33
+ this.values.carbonmonoxide = this.Characteristics.hap.CarbonMonoxideDetected.CO_LEVELS_NORMAL
32
34
  }
33
35
  super.updateState(state)
34
36
  }
@@ -327,6 +327,7 @@ class Light extends DeconzService.LightsResource {
327
327
  value: 'none',
328
328
  silent: true
329
329
  })
330
+ effectString.setMaxListeners(20)
330
331
  for (const id in this.resource.body.capabilities.color.effects) {
331
332
  const effect = this.resource.body.capabilities.color.effects[id]
332
333
  const characteristicName = effect[0].toUpperCase() + effect.slice(1) + 'Effect'
@@ -98,7 +98,7 @@ class SensorsResource extends DeconzService {
98
98
  return this._putConfig()
99
99
  }
100
100
 
101
- // Send the request (for the combined state changes) to the gateway.
101
+ // Send the request (for the combined config changes) to the gateway.
102
102
  async _putConfig () {
103
103
  try {
104
104
  if (this.platform.config.waitTimeUpdate > 0) {
@@ -30,19 +30,17 @@ class Smoke extends DeconzService.SensorsResource {
30
30
  }
31
31
 
32
32
  updateState (state) {
33
- if (state.fire != null || state.test != null) {
34
- this.values.smoke = state.fire
35
- ? this.Characteristics.hap.SmokeDetected.SMOKE_DETECTED
36
- : this.Characteristics.hap.SmokeDetected.SMOKE_NOT_DETECTED
37
- let status = 0
38
- if (state.fire) {
39
- status |= this.Characteristics.eve.ElgatoDeviceStatus.SMOKE_DETECTED
40
- }
41
- if (state.test) {
42
- status |= this.Characteristics.eve.ElgatoDeviceStatus.ALARM_TEST_ACTIVE
43
- }
44
- this.values.deviceStatus = status
33
+ let status = 0
34
+ if (state.fire) {
35
+ this.values.smoke = this.Characteristics.hap.SmokeDetected.SMOKE_DETECTED
36
+ status |= this.Characteristics.eve.ElgatoDeviceStatus.SMOKE_DETECTED
37
+ } else if (state.test) {
38
+ this.values.smoke = this.Characteristics.hap.SmokeDetected.SMOKE_DETECTED
39
+ status |= this.Characteristics.eve.ElgatoDeviceStatus.ALARM_TEST_ACTIVE
40
+ } else {
41
+ this.values.smoke = this.Characteristics.hap.SmokeDetected.SMOKE_NOT_DETECTED
45
42
  }
43
+ this.values.deviceStatus = status
46
44
  super.updateState(state)
47
45
  }
48
46
  }
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "ebaauw"
8
8
  ],
9
9
  "license": "Apache-2.0",
10
- "version": "1.0.18",
10
+ "version": "1.0.20",
11
11
  "keywords": [
12
12
  "homebridge-plugin",
13
13
  "homekit",
@@ -28,11 +28,11 @@
28
28
  "engines": {
29
29
  "deCONZ": "2.28.1",
30
30
  "homebridge": "^1.8.4||^2.0.0-beta",
31
- "node": "^20||^18"
31
+ "node": "^22||^20||^18"
32
32
  },
33
33
  "dependencies": {
34
- "hb-deconz-tools": "~2.0.3",
35
- "homebridge-lib": "~7.0.8"
34
+ "hb-deconz-tools": "~2.0.4",
35
+ "homebridge-lib": "~7.0.9"
36
36
  },
37
37
  "scripts": {
38
38
  "prepare": "standard && rm -rf out && jsdoc -c jsdoc.json",