@homebridge-plugins/homebridge-ewelink 12.3.3 → 12.4.0

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.
Files changed (68) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/eslint.config.js +36 -1
  3. package/lib/connection/http.js +2 -0
  4. package/lib/connection/lan.js +2 -0
  5. package/lib/connection/ws.js +6 -5
  6. package/lib/device/diffuser.js +2 -2
  7. package/lib/device/fan.js +1 -1
  8. package/lib/device/group.js +1 -1
  9. package/lib/device/index.js +3 -3
  10. package/lib/device/light-cct.js +1 -1
  11. package/lib/device/light-dimmer.js +1 -1
  12. package/lib/device/light-rgb-cct.js +1 -1
  13. package/lib/device/light-rgb.js +1 -1
  14. package/lib/device/outlet-multi.js +2 -2
  15. package/lib/device/outlet-single-inched.js +1 -1
  16. package/lib/device/outlet-single.js +1 -1
  17. package/lib/device/panel.js +3 -3
  18. package/lib/device/rf-bridge.js +1 -0
  19. package/lib/device/sensor-ambient.js +3 -3
  20. package/lib/device/sensor-contact.js +1 -1
  21. package/lib/device/sensor-temp-humi.js +2 -2
  22. package/lib/device/simulation/cooler.js +2 -2
  23. package/lib/device/simulation/doorbell.js +1 -1
  24. package/lib/device/simulation/heater.js +2 -2
  25. package/lib/device/simulation/index.js +1 -1
  26. package/lib/device/simulation/light-fan.js +1 -1
  27. package/lib/device/simulation/lock-eachen.js +1 -1
  28. package/lib/device/simulation/lock-one.js +1 -1
  29. package/lib/device/simulation/p-button.js +1 -1
  30. package/lib/device/simulation/purifier.js +1 -1
  31. package/lib/device/simulation/sensor-leak.js +1 -1
  32. package/lib/device/simulation/sensor-visible.js +1 -1
  33. package/lib/device/simulation/switch-valve.js +1 -1
  34. package/lib/device/simulation/th-cooler.js +3 -3
  35. package/lib/device/simulation/th-dehumidifier.js +3 -3
  36. package/lib/device/simulation/th-heater.js +3 -3
  37. package/lib/device/simulation/th-humidifier.js +3 -3
  38. package/lib/device/simulation/th-thermostat.js +1 -1
  39. package/lib/device/simulation/tv.js +1 -1
  40. package/lib/device/switch-mate.js +1 -1
  41. package/lib/device/switch-multi.js +1 -1
  42. package/lib/device/switch-single-inched.js +1 -1
  43. package/lib/device/switch-single.js +1 -1
  44. package/lib/device/thermostat.js +1 -1
  45. package/lib/device/zigbee/index.js +2 -0
  46. package/lib/device/zigbee/light-cct.js +1 -1
  47. package/lib/device/zigbee/light-dimmer.js +1 -1
  48. package/lib/device/zigbee/light-rgb-cct.js +1 -1
  49. package/lib/device/zigbee/motor.js +1 -1
  50. package/lib/device/zigbee/sensor-ambient.js +3 -3
  51. package/lib/device/zigbee/sensor-contact.js +1 -1
  52. package/lib/device/zigbee/sensor-leak.js +1 -1
  53. package/lib/device/zigbee/sensor-motion.js +1 -1
  54. package/lib/device/zigbee/sensor-occupancy.js +1 -1
  55. package/lib/device/zigbee/sensor-smoke.js +2 -2
  56. package/lib/device/zigbee/switch-stateless.js +2 -2
  57. package/lib/device/zigbee/thermostat.js +1 -1
  58. package/lib/device/zigbee/zigbee-water-valve.js +195 -0
  59. package/lib/fakegato/fakegato-history.js +1 -0
  60. package/lib/homebridge-ui/public/index.html +4 -0
  61. package/lib/homebridge-ui/server.js +1 -0
  62. package/lib/index.js +1 -0
  63. package/lib/node-dns-sd/lib/dns-sd-composer.js +1 -1
  64. package/lib/node-dns-sd/lib/dns-sd-parser.js +1 -1
  65. package/lib/node-dns-sd/lib/dns-sd.js +2 -1
  66. package/lib/platform.js +31 -21
  67. package/lib/utils/constants.js +5 -1
  68. package/package.json +9 -9
package/CHANGELOG.md CHANGED
@@ -8,6 +8,17 @@ This project tries to adhere to [Semantic Versioning](http://semver.org/). In pr
8
8
  - `MINOR` version when a new device type is added, or when a new feature is added that is backwards-compatible
9
9
  - `PATCH` version when backwards-compatible bug fixes are implemented
10
10
 
11
+ ## 12.4.0 (2025-02-24)
12
+
13
+ ### Added
14
+
15
+ - add support for Zigbee Smart Water Valve (SWV-BSP) (#646) (@etienne678)
16
+ - models with UIIDs `226` and `7010`
17
+
18
+ ### Changed
19
+
20
+ - updated dependencies
21
+
11
22
  ## 12.3.3 (2024-10-12)
12
23
 
13
24
  ### Changed
package/eslint.config.js CHANGED
@@ -3,11 +3,46 @@ import { antfu } from '@antfu/eslint-config'
3
3
  /** @type {typeof antfu} */
4
4
  export default antfu(
5
5
  {
6
- ignores: [],
6
+ ignores: ['lib/node-dns-sd/README.md'],
7
7
  jsx: false,
8
8
  rules: {
9
+ 'curly': ['error', 'multi-line'],
9
10
  'new-cap': 'off',
11
+ 'import/extensions': ['error', 'ignorePackages'],
12
+ 'import/order': 0,
13
+ 'jsdoc/check-alignment': 'warn',
14
+ 'jsdoc/check-line-alignment': 'warn',
15
+ 'jsdoc/require-returns-check': 0,
16
+ 'jsdoc/require-returns-description': 0,
17
+ 'no-undef': 'error',
18
+ 'perfectionist/sort-exports': 'error',
19
+ 'perfectionist/sort-imports': [
20
+ 'error',
21
+ {
22
+ groups: [
23
+ 'type',
24
+ 'internal-type',
25
+ 'builtin',
26
+ 'external',
27
+ 'internal',
28
+ ['parent-type', 'sibling-type', 'index-type'],
29
+ ['parent', 'sibling', 'index'],
30
+ 'object',
31
+ 'unknown',
32
+ ],
33
+ order: 'asc',
34
+ type: 'natural',
35
+ newlinesBetween: 'always',
36
+ },
37
+ ],
38
+ 'perfectionist/sort-named-exports': 'error',
39
+ 'perfectionist/sort-named-imports': 'error',
40
+ 'quotes': ['error', 'single'],
41
+ 'sort-imports': 0,
10
42
  'style/brace-style': ['error', '1tbs', { allowSingleLine: true }],
43
+ 'style/quote-props': ['error', 'consistent-as-needed'],
44
+ 'test/no-only-tests': 'error',
45
+ 'unicorn/no-useless-spread': 'error',
11
46
  'unused-imports/no-unused-vars': ['error', { caughtErrors: 'none' }],
12
47
  },
13
48
  typescript: false,
@@ -1,6 +1,8 @@
1
1
  import { Buffer } from 'node:buffer'
2
2
  import { createHmac } from 'node:crypto'
3
+
3
4
  import axios from 'axios'
5
+
4
6
  import platformConsts from '../utils/constants.js'
5
7
  import { sleep } from '../utils/functions.js'
6
8
 
@@ -6,7 +6,9 @@ import {
6
6
  randomBytes,
7
7
  } from 'node:crypto'
8
8
  import events from 'node:events'
9
+
9
10
  import axios from 'axios'
11
+
10
12
  import dnsSd from '../node-dns-sd/lib/dns-sd.js'
11
13
  import platformConsts from '../utils/constants.js'
12
14
  import { hasProperty, parseError } from '../utils/functions.js'
@@ -1,7 +1,9 @@
1
1
  import events from 'node:events'
2
+
2
3
  import axios from 'axios'
3
4
  import wsp from 'websocket-as-promised'
4
5
  import ws from 'ws'
6
+
5
7
  import platformConsts from '../utils/constants.js'
6
8
  import { hasProperty, parseError, sleep } from '../utils/functions.js'
7
9
 
@@ -301,11 +303,10 @@ export default class {
301
303
  // Generate the payload to send
302
304
  const toSend = {
303
305
  ...json,
304
- ...{
305
- action: 'update',
306
- ts: 0,
307
- userAgent: 'app',
308
- },
306
+
307
+ action: 'update',
308
+ ts: 0,
309
+ userAgent: 'app',
309
310
  }
310
311
 
311
312
  // Check the web socket is open
@@ -43,11 +43,11 @@ export default class {
43
43
 
44
44
  // Add the fan service if it doesn't already exist
45
45
  this.fanService = this.accessory.getService('Diffuser')
46
- || this.accessory.addService(this.hapServ.Fan, 'Diffuser', 'diffuser')
46
+ || this.accessory.addService(this.hapServ.Fan, 'Diffuser', 'diffuser')
47
47
 
48
48
  // Add the lightbulb service if it doesn't already exist
49
49
  this.lightService = this.accessory.getService('Light')
50
- || this.accessory.addService(this.hapServ.Lightbulb, 'Light', 'light')
50
+ || this.accessory.addService(this.hapServ.Lightbulb, 'Light', 'light')
51
51
 
52
52
  // Add the set handler to the fan on/off characteristic
53
53
  this.fanService
package/lib/device/fan.js CHANGED
@@ -69,7 +69,7 @@ export default class {
69
69
  } else {
70
70
  // The user has not hidden the light channel, so add it if it doesn't exist
71
71
  this.lightService = this.accessory.getService(this.hapServ.Lightbulb)
72
- || this.accessory.addService(this.hapServ.Lightbulb)
72
+ || this.accessory.addService(this.hapServ.Lightbulb)
73
73
 
74
74
  // Add the set handler to the lightbulb on/off characteristic
75
75
  this.lightService
@@ -25,7 +25,7 @@ export default class {
25
25
 
26
26
  // Add the switch service if it doesn't already exist
27
27
  this.service = this.accessory.getService(this.hapServ.Switch)
28
- || this.accessory.addService(this.hapServ.Switch)
28
+ || this.accessory.addService(this.hapServ.Switch)
29
29
 
30
30
  // Add the set handler to the switch on/off characteristic
31
31
  this.service
@@ -5,12 +5,12 @@ import deviceGroup from './group.js'
5
5
  import deviceHumidifier from './humidifier.js'
6
6
  import deviceLightCCT from './light-cct.js'
7
7
  import deviceLightDimmer from './light-dimmer.js'
8
- import deviceLightRGB from './light-rgb.js'
9
8
  import deviceLightRGBCCT from './light-rgb-cct.js'
9
+ import deviceLightRGB from './light-rgb.js'
10
10
  import deviceMotor from './motor.js'
11
11
  import deviceOutletMulti from './outlet-multi.js'
12
- import deviceOutletSingle from './outlet-single.js'
13
12
  import deviceOutletSingleInched from './outlet-single-inched.js'
13
+ import deviceOutletSingle from './outlet-single.js'
14
14
  import devicePanel from './panel.js'
15
15
  import deviceRfBridge from './rf-bridge.js'
16
16
  import deviceRfButton from './rf-button.js'
@@ -22,8 +22,8 @@ import sim from './simulation/index.js'
22
22
  import deviceSwitchMan from './switch-man.js'
23
23
  import deviceSwitchMate from './switch-mate.js'
24
24
  import deviceSwitchMulti from './switch-multi.js'
25
- import deviceSwitchSingle from './switch-single.js'
26
25
  import deviceSwitchSingleInched from './switch-single-inched.js'
26
+ import deviceSwitchSingle from './switch-single.js'
27
27
  import deviceTemplate from './template.js'
28
28
  import deviceThermostat from './thermostat.js'
29
29
  import zb from './zigbee/index.js'
@@ -65,7 +65,7 @@ export default class {
65
65
 
66
66
  // Add the lightbulb service if it doesn't already exist
67
67
  this.service = this.accessory.getService(this.hapServ.Lightbulb)
68
- || this.accessory.addService(this.hapServ.Lightbulb)
68
+ || this.accessory.addService(this.hapServ.Lightbulb)
69
69
 
70
70
  // If adaptive lighting has just been disabled then remove and re-add service to hide AL icon
71
71
  if (this.alShift === -1 && this.accessory.context.adaptiveLighting) {
@@ -52,7 +52,7 @@ export default class {
52
52
 
53
53
  // Add the lightbulb service if it doesn't already exist
54
54
  this.service = this.accessory.getService(this.hapServ.Lightbulb)
55
- || this.accessory.addService(this.hapServ.Lightbulb)
55
+ || this.accessory.addService(this.hapServ.Lightbulb)
56
56
 
57
57
  // Add the set handler to the lightbulb on/off characteristic
58
58
  this.service
@@ -60,7 +60,7 @@ export default class {
60
60
 
61
61
  // Add the lightbulb service if it doesn't already exist
62
62
  this.service = this.accessory.getService(this.hapServ.Lightbulb)
63
- || this.accessory.addService(this.hapServ.Lightbulb)
63
+ || this.accessory.addService(this.hapServ.Lightbulb)
64
64
 
65
65
  // If adaptive lighting has just been disabled then remove and re-add service to hide AL icon
66
66
  if (this.alShift === -1 && this.accessory.context.adaptiveLighting) {
@@ -44,7 +44,7 @@ export default class {
44
44
 
45
45
  // Add the lightbulb service if it doesn't already exist
46
46
  this.service = this.accessory.getService(this.hapServ.Lightbulb)
47
- || this.accessory.addService(this.hapServ.Lightbulb)
47
+ || this.accessory.addService(this.hapServ.Lightbulb)
48
48
 
49
49
  // Add the set handler to the lightbulb on/off characteristic
50
50
  this.service
@@ -33,7 +33,7 @@ export default class {
33
33
  this.inchChannels = deviceConf.inchChannels || ''
34
34
  this.inUsePowerThreshold = deviceConf.inUsePowerThreshold || platformConsts.defaultValues.inUsePowerThreshold
35
35
  accessory.context.isInched = accessory.context.switchNumber !== '0'
36
- && this.inchChannels.includes(accessory.context.switchNumber)
36
+ && this.inchChannels.includes(accessory.context.switchNumber)
37
37
 
38
38
  // Set the correct logging variables for this accessory
39
39
  switch (deviceConf.overrideLogging) {
@@ -62,7 +62,7 @@ export default class {
62
62
 
63
63
  // Add the outlet service if it doesn't already exist
64
64
  this.service = this.accessory.getService(this.hapServ.Outlet)
65
- || this.accessory.addService(this.hapServ.Outlet)
65
+ || this.accessory.addService(this.hapServ.Outlet)
66
66
 
67
67
  if (platformConsts.devices.switchMultiPower.includes(this.accessory.context.eweUIID)) {
68
68
  // Add Eve power characteristics
@@ -59,7 +59,7 @@ export default class {
59
59
 
60
60
  // Add the outlet service if it doesn't already exist
61
61
  this.service = this.accessory.getService(this.hapServ.Outlet)
62
- || this.accessory.addService(this.hapServ.Outlet)
62
+ || this.accessory.addService(this.hapServ.Outlet)
63
63
 
64
64
  switch (this.accessory.context.eweUIID) {
65
65
  case 5:
@@ -58,7 +58,7 @@ export default class {
58
58
 
59
59
  // Add the outlet service if it doesn't already exist
60
60
  this.service = this.accessory.getService(this.hapServ.Outlet)
61
- || this.accessory.addService(this.hapServ.Outlet)
61
+ || this.accessory.addService(this.hapServ.Outlet)
62
62
 
63
63
  // Some models provide a power reading in different decimals
64
64
  this.divisor = 1
@@ -46,7 +46,7 @@ export default class {
46
46
 
47
47
  // Add the temperature sensor service if it doesn't already exist
48
48
  this.tempService = this.accessory.getService(this.hapServ.TemperatureSensor)
49
- || this.accessory.addService(this.hapServ.TemperatureSensor)
49
+ || this.accessory.addService(this.hapServ.TemperatureSensor)
50
50
 
51
51
  // Set custom properties of the current temperature characteristic
52
52
  this.tempService.getCharacteristic(this.hapChar.CurrentTemperature).setProps({
@@ -58,9 +58,9 @@ export default class {
58
58
  if (!this.isProPanel) {
59
59
  // Add the outlet services if they don't already exist
60
60
  this.service1 = this.accessory.getService('Channel 1')
61
- || this.accessory.addService(this.hapServ.Switch, 'Channel 1', 'channel1')
61
+ || this.accessory.addService(this.hapServ.Switch, 'Channel 1', 'channel1')
62
62
  this.service2 = this.accessory.getService('Channel 2')
63
- || this.accessory.addService(this.hapServ.Switch, 'Channel 2', 'channel2')
63
+ || this.accessory.addService(this.hapServ.Switch, 'Channel 2', 'channel2')
64
64
 
65
65
  // Add the set handler to the switch on/off characteristic
66
66
  this.service1.getCharacteristic(this.hapChar.On).onSet(async (value) => {
@@ -1,4 +1,5 @@
1
1
  import axios from 'axios'
2
+
2
3
  import platformConsts from '../utils/constants.js'
3
4
  import { hasProperty, parseError, sleep } from '../utils/functions.js'
4
5
 
@@ -72,7 +72,7 @@ export default class {
72
72
  } else {
73
73
  // User has not hidden the switch service so add it if it doesn't already exist
74
74
  this.switchService = this.accessory.getService(this.hapServ.Switch)
75
- || this.accessory.addService(this.hapServ.Switch)
75
+ || this.accessory.addService(this.hapServ.Switch)
76
76
 
77
77
  // Add the set handler to the switch on/off characteristic
78
78
  this.switchService
@@ -82,7 +82,7 @@ export default class {
82
82
 
83
83
  // Add the temperature sensor service if it doesn't already exist
84
84
  this.tempService = this.accessory.getService(this.hapServ.TemperatureSensor)
85
- || this.accessory.addService(this.hapServ.TemperatureSensor)
85
+ || this.accessory.addService(this.hapServ.TemperatureSensor)
86
86
 
87
87
  // Set custom properties of the current temperature characteristic
88
88
  this.tempService.getCharacteristic(this.hapChar.CurrentTemperature).setProps({
@@ -99,7 +99,7 @@ export default class {
99
99
  } else {
100
100
  // Add the humidity sensor service if it doesn't already exist
101
101
  this.humiService = this.accessory.getService(this.hapServ.HumiditySensor)
102
- || this.accessory.addService(this.hapServ.HumiditySensor)
102
+ || this.accessory.addService(this.hapServ.HumiditySensor)
103
103
  }
104
104
 
105
105
  // Add the get handlers only if the user hasn't disabled the disableNoResponse setting
@@ -64,7 +64,7 @@ export default class {
64
64
 
65
65
  // Add the battery service if it doesn't already exist
66
66
  this.batteryService = this.accessory.getService(this.hapServ.Battery)
67
- || this.accessory.addService(this.hapServ.Battery)
67
+ || this.accessory.addService(this.hapServ.Battery)
68
68
 
69
69
  // Pass the accessory to Fakegato to set up with Eve
70
70
  this.accessory.eveService = new platform.eveService('door', this.accessory, {
@@ -48,7 +48,7 @@ export default class {
48
48
 
49
49
  // Add the temperature sensor service if it doesn't already exist
50
50
  this.tempService = this.accessory.getService(this.hapServ.TemperatureSensor)
51
- || this.accessory.addService(this.hapServ.TemperatureSensor)
51
+ || this.accessory.addService(this.hapServ.TemperatureSensor)
52
52
 
53
53
  // Set custom properties of the current temperature characteristic
54
54
  this.tempService.getCharacteristic(this.hapChar.CurrentTemperature).setProps({
@@ -59,7 +59,7 @@ export default class {
59
59
 
60
60
  // Add the humidity sensor service if it doesn't already exist
61
61
  this.humiService = this.accessory.getService(this.hapServ.HumiditySensor)
62
- || this.accessory.addService(this.hapServ.HumiditySensor)
62
+ || this.accessory.addService(this.hapServ.HumiditySensor)
63
63
 
64
64
  // Add the get handlers only if the user hasn't disabled the disableNoResponse setting
65
65
  if (!platform.config.disableNoResponse) {
@@ -63,7 +63,7 @@ export default class {
63
63
 
64
64
  // Add the heater service if it doesn't already exist
65
65
  this.service = this.accessory.getService(this.hapServ.HeaterCooler)
66
- || this.accessory.addService(this.hapServ.HeaterCooler)
66
+ || this.accessory.addService(this.hapServ.HeaterCooler)
67
67
 
68
68
  // Set custom properties of the current temperature characteristic
69
69
  this.service.getCharacteristic(this.hapChar.CurrentTemperature).setProps({
@@ -127,7 +127,7 @@ export default class {
127
127
  // Initialise these caches now since they aren't determined by the initial externalUpdate()
128
128
  this.cacheState = this.service.getCharacteristic(this.hapChar.Active).value === 1 ? 'on' : 'off'
129
129
  this.cacheCool = this.cacheState === 'on'
130
- && this.service.getCharacteristic(this.hapChar.CurrentHeaterCoolerState).value === 3
130
+ && this.service.getCharacteristic(this.hapChar.CurrentHeaterCoolerState).value === 3
131
131
  ? 'on'
132
132
  : 'off'
133
133
 
@@ -49,7 +49,7 @@ export default class {
49
49
 
50
50
  // Add the doorbell service if it doesn't already exist
51
51
  this.service = this.accessory.getService(this.hapServ.Doorbell)
52
- || this.accessory.addService(this.hapServ.Doorbell)
52
+ || this.accessory.addService(this.hapServ.Doorbell)
53
53
 
54
54
  // Set up the device type and power readings if necessary
55
55
  if (platformConsts.devices.switchSingle.includes(this.accessory.context.eweUIID)) {
@@ -77,7 +77,7 @@ export default class {
77
77
 
78
78
  // Add the heater service if it doesn't already exist
79
79
  this.service = this.accessory.getService(this.hapServ.HeaterCooler)
80
- || this.accessory.addService(this.hapServ.HeaterCooler)
80
+ || this.accessory.addService(this.hapServ.HeaterCooler)
81
81
 
82
82
  // Set custom properties of the current temperature characteristic
83
83
  this.service.getCharacteristic(this.hapChar.CurrentTemperature).setProps({
@@ -141,7 +141,7 @@ export default class {
141
141
  // Initialise these caches now since they aren't determined by the initial externalUpdate()
142
142
  this.cacheState = this.service.getCharacteristic(this.hapChar.Active).value === 1 ? 'on' : 'off'
143
143
  this.cacheHeat = this.cacheState === 'on'
144
- && this.service.getCharacteristic(this.hapChar.CurrentHeaterCoolerState).value === 2
144
+ && this.service.getCharacteristic(this.hapChar.CurrentHeaterCoolerState).value === 2
145
145
  ? 'on'
146
146
  : 'off'
147
147
 
@@ -17,10 +17,10 @@ import devicePurifier from './purifier.js'
17
17
  import deviceRfBlind from './rf-blind.js'
18
18
  import deviceRfDoor from './rf-door.js'
19
19
  import deviceRfWindow from './rf-window.js'
20
- import deviceSensor from './sensor.js'
21
20
  import deviceSensorHidden from './sensor-hidden.js'
22
21
  import deviceSensorLeak from './sensor-leak.js'
23
22
  import deviceSensorVisible from './sensor-visible.js'
23
+ import deviceSensor from './sensor.js'
24
24
  import deviceSwitchValve from './switch-valve.js'
25
25
  import deviceTapOne from './tap-one.js'
26
26
  import deviceTapTwo from './tap-two.js'
@@ -52,7 +52,7 @@ export default class {
52
52
 
53
53
  // Add the fan service if it doesn't already exist
54
54
  this.service = this.accessory.getService(this.hapServ.Fan)
55
- || this.accessory.addService(this.hapServ.Fan)
55
+ || this.accessory.addService(this.hapServ.Fan)
56
56
 
57
57
  // Add the set handler to the fan on/off characteristic
58
58
  this.service
@@ -55,7 +55,7 @@ export default class {
55
55
 
56
56
  // Add the lock service if it doesn't already exist
57
57
  this.service = this.accessory.getService(this.hapServ.LockMechanism)
58
- || this.accessory.addService(this.hapServ.LockMechanism)
58
+ || this.accessory.addService(this.hapServ.LockMechanism)
59
59
 
60
60
  // Add the set handler to the lock target state characteristic
61
61
  this.service.getCharacteristic(this.hapChar.LockTargetState).onSet((value) => {
@@ -56,7 +56,7 @@ export default class {
56
56
 
57
57
  // Add the lock service if it doesn't already exist
58
58
  this.service = this.accessory.getService(this.hapServ.LockMechanism)
59
- || this.accessory.addService(this.hapServ.LockMechanism)
59
+ || this.accessory.addService(this.hapServ.LockMechanism)
60
60
 
61
61
  // Set up the device type and power readings if necessary
62
62
  if (platformConsts.devices.switchSingle.includes(this.accessory.context.eweUIID)) {
@@ -49,7 +49,7 @@ export default class {
49
49
 
50
50
  // Add the stateless programmable switch service if it doesn't already exist
51
51
  this.service = this.accessory.getService(this.hapServ.StatelessProgrammableSwitch)
52
- || this.accessory.addService(this.hapServ.StatelessProgrammableSwitch)
52
+ || this.accessory.addService(this.hapServ.StatelessProgrammableSwitch)
53
53
 
54
54
  // Remove the double and long press options
55
55
  this.service.getCharacteristic(this.hapChar.ProgrammableSwitchEvent).setProps({
@@ -54,7 +54,7 @@ export default class {
54
54
 
55
55
  // Add the air purifier service if it doesn't already exist
56
56
  this.service = this.accessory.getService(this.hapServ.AirPurifier)
57
- || this.accessory.addService(this.hapServ.AirPurifier)
57
+ || this.accessory.addService(this.hapServ.AirPurifier)
58
58
 
59
59
  // Set up the device type and power readings if necessary
60
60
  if (platformConsts.devices.switchSingle.includes(this.accessory.context.eweUIID)) {
@@ -55,7 +55,7 @@ export default class {
55
55
 
56
56
  // Add the battery service if it doesn't already exist
57
57
  this.batteryService = this.accessory.getService(this.hapServ.Battery)
58
- || this.accessory.addService(this.hapServ.Battery)
58
+ || this.accessory.addService(this.hapServ.Battery)
59
59
 
60
60
  // Pass the accessory to Fakegato to set up with Eve
61
61
  this.accessory.eveService = new platform.eveService('motion', this.accessory, {
@@ -87,7 +87,7 @@ export default class {
87
87
  if (this.hasBattery) {
88
88
  // Add the battery service if it doesn't already exist
89
89
  this.batteryService = this.accessory.getService(this.hapServ.Battery)
90
- || this.accessory.addService(this.hapServ.Battery)
90
+ || this.accessory.addService(this.hapServ.Battery)
91
91
  }
92
92
 
93
93
  // Pass the accessory to Fakegato to set up with Eve
@@ -44,7 +44,7 @@ export default class {
44
44
 
45
45
  // Add the switch service if it doesn't already exist
46
46
  this.sService = this.accessory.getService(this.hapServ.Switch)
47
- || this.accessory.addService(this.hapServ.Switch)
47
+ || this.accessory.addService(this.hapServ.Switch)
48
48
 
49
49
  // Add the valve service if it doesn't already exist
50
50
  this.vService = this.accessory.getService(this.hapServ.Valve)
@@ -88,7 +88,7 @@ export default class {
88
88
 
89
89
  // Add the heater service if it doesn't already exist
90
90
  this.service = this.accessory.getService(this.hapServ.HeaterCooler)
91
- || this.accessory.addService(this.hapServ.HeaterCooler)
91
+ || this.accessory.addService(this.hapServ.HeaterCooler)
92
92
 
93
93
  // The DS18B20 sensor does not provide humidity readings
94
94
  if (this.accessory.context.sensorType === 'DS18B20') {
@@ -98,7 +98,7 @@ export default class {
98
98
  } else {
99
99
  // Add the humidity sensor service if it doesn't already exist
100
100
  this.humiService = this.accessory.getService(this.hapServ.HumiditySensor)
101
- || this.accessory.addService(this.hapServ.HumiditySensor)
101
+ || this.accessory.addService(this.hapServ.HumiditySensor)
102
102
  }
103
103
 
104
104
  // Set the heater as the primary service
@@ -181,7 +181,7 @@ export default class {
181
181
  // Initialise these caches now since they aren't determined by the initial externalUpdate()
182
182
  this.cacheState = this.service.getCharacteristic(this.hapChar.Active).value === 1 ? 'on' : 'off'
183
183
  this.cacheCool = this.cacheState === 'on'
184
- && this.service.getCharacteristic(this.hapChar.CurrentHeaterCoolerState).value === 3
184
+ && this.service.getCharacteristic(this.hapChar.CurrentHeaterCoolerState).value === 3
185
185
  ? 'on'
186
186
  : 'off'
187
187
 
@@ -89,11 +89,11 @@ export default class {
89
89
 
90
90
  // Add the dehumidifier service if it doesn't already exist
91
91
  this.service = this.accessory.getService(this.hapServ.HumidifierDehumidifier)
92
- || this.accessory.addService(this.hapServ.HumidifierDehumidifier)
92
+ || this.accessory.addService(this.hapServ.HumidifierDehumidifier)
93
93
 
94
94
  // Add the temperature sensor service if it doesn't already exist
95
95
  this.tempService = this.accessory.getService(this.hapServ.TemperatureSensor)
96
- || this.accessory.addService(this.hapServ.TemperatureSensor)
96
+ || this.accessory.addService(this.hapServ.TemperatureSensor)
97
97
  this.cacheTemp = this.tempService.getCharacteristic(this.hapChar.CurrentTemperature).value
98
98
  this.updateCache()
99
99
 
@@ -168,7 +168,7 @@ export default class {
168
168
  // Initialise these caches now since they aren't determined by the initial externalUpdate()
169
169
  this.cacheState = this.service.getCharacteristic(this.hapChar.Active).value === 1 ? 'on' : 'off'
170
170
  this.cacheHumid = this.cacheState === 'on'
171
- && this.service.getCharacteristic(this.hapChar.CurrentHumidifierDehumidifierState).value === 3
171
+ && this.service.getCharacteristic(this.hapChar.CurrentHumidifierDehumidifierState).value === 3
172
172
  ? 'on'
173
173
  : 'off'
174
174
 
@@ -89,7 +89,7 @@ export default class {
89
89
 
90
90
  // Add the heater service if it doesn't already exist
91
91
  this.service = this.accessory.getService(this.hapServ.HeaterCooler)
92
- || this.accessory.addService(this.hapServ.HeaterCooler)
92
+ || this.accessory.addService(this.hapServ.HeaterCooler)
93
93
 
94
94
  // The DS18B20 sensor does not provide humidity readings
95
95
  if (this.accessory.context.sensorType === 'DS18B20') {
@@ -99,7 +99,7 @@ export default class {
99
99
  } else {
100
100
  // Add the humidity sensor service if it doesn't already exist
101
101
  this.humiService = this.accessory.getService(this.hapServ.HumiditySensor)
102
- || this.accessory.addService(this.hapServ.HumiditySensor)
102
+ || this.accessory.addService(this.hapServ.HumiditySensor)
103
103
  }
104
104
 
105
105
  // Set the heater as the primary service
@@ -180,7 +180,7 @@ export default class {
180
180
  // Initialise these caches now since they aren't determined by the initial externalUpdate()
181
181
  this.cacheState = this.service.getCharacteristic(this.hapChar.Active).value === 1 ? 'on' : 'off'
182
182
  this.cacheHeat = this.cacheState === 'on'
183
- && this.service.getCharacteristic(this.hapChar.CurrentHeaterCoolerState).value === 2
183
+ && this.service.getCharacteristic(this.hapChar.CurrentHeaterCoolerState).value === 2
184
184
  ? 'on'
185
185
  : 'off'
186
186
 
@@ -89,11 +89,11 @@ export default class {
89
89
 
90
90
  // Add the humidifier service if it doesn't already exist
91
91
  this.service = this.accessory.getService(this.hapServ.HumidifierDehumidifier)
92
- || this.accessory.addService(this.hapServ.HumidifierDehumidifier)
92
+ || this.accessory.addService(this.hapServ.HumidifierDehumidifier)
93
93
 
94
94
  // Add the temperature sensor service if it doesn't already exist
95
95
  this.tempService = this.accessory.getService(this.hapServ.TemperatureSensor)
96
- || this.accessory.addService(this.hapServ.TemperatureSensor)
96
+ || this.accessory.addService(this.hapServ.TemperatureSensor)
97
97
  this.cacheTemp = this.tempService.getCharacteristic(this.hapChar.CurrentTemperature).value
98
98
  this.updateCache()
99
99
 
@@ -168,7 +168,7 @@ export default class {
168
168
  // Initialise these caches now since they aren't determined by the initial externalUpdate()
169
169
  this.cacheState = this.service.getCharacteristic(this.hapChar.Active).value === 1 ? 'on' : 'off'
170
170
  this.cacheHumid = this.cacheState === 'on'
171
- && this.service.getCharacteristic(this.hapChar.CurrentHumidifierDehumidifierState).value === 2
171
+ && this.service.getCharacteristic(this.hapChar.CurrentHumidifierDehumidifierState).value === 2
172
172
  ? 'on'
173
173
  : 'off'
174
174
 
@@ -105,7 +105,7 @@ export default class {
105
105
 
106
106
  // Add the thermostat service if it doesn't already exist
107
107
  this.service = this.accessory.getService(this.hapServ.Thermostat)
108
- || this.accessory.addService(this.hapServ.Thermostat)
108
+ || this.accessory.addService(this.hapServ.Thermostat)
109
109
 
110
110
  // The DS18B20 sensor does not provide humidity readings
111
111
  if (this.accessory.context.sensorType === 'DS18B20') {
@@ -44,7 +44,7 @@ export default class {
44
44
 
45
45
  // Add the tv service if it doesn't already exist
46
46
  this.service = this.accessory.getService(this.hapServ.Television)
47
- || this.accessory.addService(this.hapServ.Television)
47
+ || this.accessory.addService(this.hapServ.Television)
48
48
 
49
49
  // Set up the device type and power readings if necessary
50
50
  if (platformConsts.devices.switchSingle.includes(this.accessory.context.eweUIID)) {
@@ -43,7 +43,7 @@ export default class {
43
43
 
44
44
  // Add the stateless switch service if it doesn't already exist
45
45
  this.service = this.accessory.getService(this.hapServ.StatelessProgrammableSwitch)
46
- || this.accessory.addService(this.hapServ.StatelessProgrammableSwitch)
46
+ || this.accessory.addService(this.hapServ.StatelessProgrammableSwitch)
47
47
 
48
48
  // Output the customised options to the log
49
49
  const normalLogging = this.enableLogging ? 'standard' : 'disable'
@@ -61,7 +61,7 @@ export default class {
61
61
 
62
62
  // Add the switch service if it doesn't already exist
63
63
  this.service = this.accessory.getService(this.hapServ.Switch)
64
- || this.accessory.addService(this.hapServ.Switch)
64
+ || this.accessory.addService(this.hapServ.Switch)
65
65
 
66
66
  if (platformConsts.devices.switchMultiPower.includes(this.accessory.context.eweUIID)) {
67
67
  // Add Eve power characteristics