@homebridge-plugins/homebridge-govee 11.32.2-beta.2 → 11.32.2-beta.21

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 (73) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/config.schema.json +1 -1
  3. package/lib/connection/ble.js +26 -1
  4. package/lib/connection/openapi.js +18 -0
  5. package/lib/device/appliance-basic.js +377 -0
  6. package/lib/device/dehumidifier-H7150.js +9 -3
  7. package/lib/device/diffuser-H7161.js +7 -1
  8. package/lib/device/fan-H1370.js +7 -1
  9. package/lib/device/fan-H7100.js +36 -4
  10. package/lib/device/fan-H7105.js +7 -1
  11. package/lib/device/fan-H7107.js +7 -1
  12. package/lib/device/heater1a.js +52 -12
  13. package/lib/device/heater1b.js +14 -3
  14. package/lib/device/heater2.js +7 -1
  15. package/lib/device/humidifier-H7140.js +7 -1
  16. package/lib/device/humidifier-H7141.js +7 -1
  17. package/lib/device/humidifier-H7142.js +7 -1
  18. package/lib/device/humidifier-H7143.js +7 -1
  19. package/lib/device/humidifier-H7160.js +7 -1
  20. package/lib/device/ice-maker-H7172.js +19 -7
  21. package/lib/device/index.js +44 -51
  22. package/lib/device/kettle.js +7 -1
  23. package/lib/device/outlet-single.js +7 -1
  24. package/lib/device/purifier-H7120.js +14 -25
  25. package/lib/device/purifier-H7122.js +7 -1
  26. package/lib/device/purifier-H7123.js +9 -3
  27. package/lib/device/purifier-H7126.js +7 -1
  28. package/lib/device/{sensor-button.js → sensor-basic.js} +14 -2
  29. package/lib/device/sensor-presence.js +7 -1
  30. package/lib/device/sensor-thermo4.js +13 -2
  31. package/lib/device/switch-double.js +34 -15
  32. package/lib/device/switch-triple.js +36 -17
  33. package/lib/device/template.js +15 -2
  34. package/lib/platform.js +83 -799
  35. package/lib/utils/capabilities.js +220 -0
  36. package/lib/utils/command-builder.js +6 -4
  37. package/lib/utils/config-parser.js +280 -0
  38. package/lib/utils/constants.js +120 -8
  39. package/lib/utils/decode.js +4 -1
  40. package/lib/utils/device-capabilities.js +77 -3
  41. package/lib/utils/device-context.js +179 -0
  42. package/lib/utils/device-merge.js +251 -0
  43. package/lib/utils/dispatch.js +159 -0
  44. package/lib/utils/functions.js +9 -0
  45. package/lib/utils/lang-en.js +0 -2
  46. package/lib/utils/report-unknown.js +156 -0
  47. package/package.json +1 -1
  48. package/lib/device/dehumidifier-H7151.js +0 -189
  49. package/lib/device/dehumidifier-H7152.js +0 -180
  50. package/lib/device/diffuser-H7162.js +0 -123
  51. package/lib/device/fan-H1310.js +0 -284
  52. package/lib/device/fan-H7101.js +0 -340
  53. package/lib/device/fan-H7102.js +0 -284
  54. package/lib/device/fan-H7106.js +0 -284
  55. package/lib/device/fan-H7111.js +0 -345
  56. package/lib/device/humidifier-H7145.js +0 -187
  57. package/lib/device/humidifier-H7147.js +0 -187
  58. package/lib/device/humidifier-H7148.js +0 -187
  59. package/lib/device/humidifier-H7149.js +0 -187
  60. package/lib/device/humidifier-H714E.js +0 -187
  61. package/lib/device/ice-maker-H717D.js +0 -218
  62. package/lib/device/ice-maker-H8120.js +0 -218
  63. package/lib/device/outlet-double.js +0 -188
  64. package/lib/device/outlet-triple.js +0 -160
  65. package/lib/device/purifier-H7121.js +0 -406
  66. package/lib/device/purifier-H7124.js +0 -504
  67. package/lib/device/purifier-H7127.js +0 -359
  68. package/lib/device/purifier-H7128.js +0 -359
  69. package/lib/device/purifier-H7129.js +0 -359
  70. package/lib/device/purifier-H712C.js +0 -359
  71. package/lib/device/sensor-contact.js +0 -22
  72. package/lib/utils/ble-timeouts.test.js +0 -44
  73. package/lib/utils/functions.test.js +0 -292
@@ -12,6 +12,7 @@ import {
12
12
  sleep,
13
13
  } from '../utils/functions.js'
14
14
  import platformLang from '../utils/lang-en.js'
15
+ import { logUnknownData } from '../utils/report-unknown.js'
15
16
 
16
17
  export default class {
17
18
  constructor(platform, accessory) {
@@ -527,7 +528,12 @@ export default class {
527
528
  break
528
529
  }
529
530
  default:
530
- this.accessory.logDebugWarn(`${platformLang.newScene}: [${command}] [${hexString}]`)
531
+ logUnknownData(this.accessory, {
532
+ kind: 'scene',
533
+ source: params.source,
534
+ raw: command,
535
+ hex: hexString,
536
+ })
531
537
  break
532
538
  }
533
539
  })
@@ -1,3 +1,4 @@
1
+ import { describeSources, resolveControls } from '../utils/capabilities.js'
1
2
  import {
2
3
  base64ToHex,
3
4
  farToCen,
@@ -8,6 +9,7 @@ import {
8
9
  parseError,
9
10
  } from '../utils/functions.js'
10
11
  import platformLang from '../utils/lang-en.js'
12
+ import { logUnknownData } from '../utils/report-unknown.js'
11
13
 
12
14
  /*
13
15
  H7130 (without temperature reporting)
@@ -90,17 +92,37 @@ export default class {
90
92
  .onSet(async value => this.internalSpeedUpdate(value))
91
93
  this.cacheSpeed = this.service.getCharacteristic(this.hapChar.RotationSpeed).value
92
94
 
95
+ // Only offer the controls this model actually has, so a heater without a
96
+ // turning head does not get an oscillation switch that does nothing
97
+ const resolved = resolveControls({
98
+ model: this.accessory.context.gvModel,
99
+ family: 'heater1',
100
+ firmware: this.accessory.context.firmware,
101
+ openApiCapabilities: this.accessory.context.openApiCapabilities,
102
+ deviceConf: platform.deviceConf?.[this.accessory.context.gvDeviceId],
103
+ })
104
+ this.features = resolved.controls
105
+ this.accessory.logDebug(`controls: ${describeSources(resolved.sources)}`)
106
+
93
107
  // Add the set handler to the heater swing mode characteristic (for oscillation)
94
- this.service
95
- .getCharacteristic(this.hapChar.SwingMode)
96
- .onSet(async value => this.internalSwingUpdate(value))
97
- this.cacheSwing = this.service.getCharacteristic(this.hapChar.SwingMode).value === 1 ? 'on' : 'off'
108
+ if (this.features.swing) {
109
+ this.service
110
+ .getCharacteristic(this.hapChar.SwingMode)
111
+ .onSet(async value => this.internalSwingUpdate(value))
112
+ this.cacheSwing = this.service.getCharacteristic(this.hapChar.SwingMode).value === 1 ? 'on' : 'off'
113
+ } else if (this.service.testCharacteristic(this.hapChar.SwingMode)) {
114
+ this.service.removeCharacteristic(this.service.getCharacteristic(this.hapChar.SwingMode))
115
+ }
98
116
 
99
- // Add the set handler to the heater lock characteristic (for oscillation)
100
- this.service
101
- .getCharacteristic(this.hapChar.LockPhysicalControls)
102
- .onSet(async value => this.internalLockUpdate(value))
103
- this.cacheLock = this.service.getCharacteristic(this.hapChar.LockPhysicalControls).value === 1 ? 'on' : 'off'
117
+ // Add the set handler to the heater lock characteristic
118
+ if (this.features.lock) {
119
+ this.service
120
+ .getCharacteristic(this.hapChar.LockPhysicalControls)
121
+ .onSet(async value => this.internalLockUpdate(value))
122
+ this.cacheLock = this.service.getCharacteristic(this.hapChar.LockPhysicalControls).value === 1 ? 'on' : 'off'
123
+ } else if (this.service.testCharacteristic(this.hapChar.LockPhysicalControls)) {
124
+ this.service.removeCharacteristic(this.service.getCharacteristic(this.hapChar.LockPhysicalControls))
125
+ }
104
126
 
105
127
  // Output the customised options to the log
106
128
  const opts = JSON.stringify({
@@ -275,8 +297,15 @@ export default class {
275
297
  if (hasProperty(params, 'temperature')) {
276
298
  const newTemp = nearestHalf(farToCen(params.temperature / 100))
277
299
  if (newTemp <= 100) {
278
- // Device must be one that DOES support ambient temperature
279
- this.accessory.logWarn('you should enable `tempReporting` in the config for this device')
300
+ // A real reading, so this heater does report the room temperature and
301
+ // belongs on the other tile. Remember that for next time rather than
302
+ // asking the owner to work it out and tick a box themselves. The tile
303
+ // is not swapped mid-run, since that would rebuild the accessory
304
+ // underneath HomeKit while it is in use.
305
+ if (!this.accessory.context.supportsAmbientTemp) {
306
+ this.accessory.context.supportsAmbientTemp = true
307
+ this.accessory.logWarn('this heater reports the room temperature, so it will move to a temperature-capable tile the next time homebridge restarts')
308
+ }
280
309
  }
281
310
  }
282
311
 
@@ -330,6 +359,9 @@ export default class {
330
359
  case '1800':
331
360
  case '1801': {
332
361
  // Swing Mode
362
+ if (!this.features.swing) {
363
+ break
364
+ }
333
365
  const newSwing = getTwoItemPosition(hexParts, 3) === '01' ? 'on' : 'off'
334
366
  if (this.cacheSwing !== newSwing) {
335
367
  this.cacheSwing = newSwing
@@ -341,6 +373,9 @@ export default class {
341
373
  case '1000':
342
374
  case '1001': {
343
375
  // Child Lock
376
+ if (!this.features.lock) {
377
+ break
378
+ }
344
379
  const newLock = getTwoItemPosition(hexParts, 3) === '01' ? 'on' : 'off'
345
380
  if (this.cacheLock !== newLock) {
346
381
  this.cacheLock = newLock
@@ -388,7 +423,12 @@ export default class {
388
423
  break
389
424
  }
390
425
  default:
391
- this.accessory.logDebugWarn(`${platformLang.newScene}: [${command}] [${hexString}]`)
426
+ logUnknownData(this.accessory, {
427
+ kind: 'scene',
428
+ source: params.source,
429
+ raw: command,
430
+ hex: hexString,
431
+ })
392
432
  break
393
433
  }
394
434
  })
@@ -8,6 +8,7 @@ import {
8
8
  parseError,
9
9
  } from '../utils/functions.js'
10
10
  import platformLang from '../utils/lang-en.js'
11
+ import { logUnknownData } from '../utils/report-unknown.js'
11
12
 
12
13
  /*
13
14
  H7130 (with temperature reporting)
@@ -498,8 +499,13 @@ export default class {
498
499
  const newTemp = nearestHalf(farToCen(params.temperature / 100))
499
500
  if (newTemp !== this.cacheTemp) {
500
501
  if (newTemp > 100) {
501
- // Device must be one that does not support ambient temperature
502
- this.accessory.logWarn('you should disable `tempReporting` in the config for this device')
502
+ // Not a real reading, so this heater does not report the room
503
+ // temperature and belongs on the simpler tile. Remember that for next
504
+ // time rather than asking the owner to work it out themselves.
505
+ if (this.accessory.context.supportsAmbientTemp !== false) {
506
+ this.accessory.context.supportsAmbientTemp = false
507
+ this.accessory.logWarn('this heater does not report the room temperature, so it will move to a simpler tile the next time homebridge restarts')
508
+ }
503
509
  } else {
504
510
  this.cacheTemp = newTemp
505
511
  this.service.updateCharacteristic(this.hapChar.CurrentTemperature, this.cacheTemp)
@@ -664,7 +670,12 @@ export default class {
664
670
  case '1601': // DND on?
665
671
  break
666
672
  default:
667
- this.accessory.logDebugWarn(`${platformLang.newScene}: [${command}] [${hexString}]`)
673
+ logUnknownData(this.accessory, {
674
+ kind: 'scene',
675
+ source: params.source,
676
+ raw: command,
677
+ hex: hexString,
678
+ })
668
679
  break
669
680
  }
670
681
  })
@@ -13,6 +13,7 @@ import {
13
13
  sleep,
14
14
  } from '../utils/functions.js'
15
15
  import platformLang from '../utils/lang-en.js'
16
+ import { logUnknownData } from '../utils/report-unknown.js'
16
17
 
17
18
  /*
18
19
  H7131 and H7132
@@ -901,7 +902,12 @@ export default class {
901
902
  // We do not need to do anything for these
902
903
  break
903
904
  default:
904
- this.accessory.logDebugWarn(`${platformLang.newScene}: [${command}] [${hexString}]`)
905
+ logUnknownData(this.accessory, {
906
+ kind: 'scene',
907
+ source: params.source,
908
+ raw: command,
909
+ hex: hexString,
910
+ })
905
911
  break
906
912
  }
907
913
  })
@@ -7,6 +7,7 @@ import {
7
7
  parseError,
8
8
  } from '../utils/functions.js'
9
9
  import platformLang from '../utils/lang-en.js'
10
+ import { logUnknownData } from '../utils/report-unknown.js'
10
11
 
11
12
  export default class {
12
13
  constructor(platform, accessory) {
@@ -245,7 +246,12 @@ export default class {
245
246
  break
246
247
  }
247
248
  default:
248
- this.accessory.logDebugWarn(`${platformLang.newScene}: [${command}] [${hexString}]`)
249
+ logUnknownData(this.accessory, {
250
+ kind: 'scene',
251
+ source: params.source,
252
+ raw: command,
253
+ hex: hexString,
254
+ })
249
255
  break
250
256
  }
251
257
  })
@@ -5,6 +5,7 @@ import {
5
5
  parseError,
6
6
  } from '../utils/functions.js'
7
7
  import platformLang from '../utils/lang-en.js'
8
+ import { logUnknownData } from '../utils/report-unknown.js'
8
9
 
9
10
  /*
10
11
  H7141
@@ -249,7 +250,12 @@ export default class {
249
250
  break
250
251
  }
251
252
  default:
252
- this.accessory.logDebugWarn(`${platformLang.newScene}: [${command}] [${hexString}]`)
253
+ logUnknownData(this.accessory, {
254
+ kind: 'scene',
255
+ source: params.source,
256
+ raw: command,
257
+ hex: hexString,
258
+ })
253
259
  break
254
260
  }
255
261
  })
@@ -10,6 +10,7 @@ import {
10
10
  sleep,
11
11
  } from '../utils/functions.js'
12
12
  import platformLang from '../utils/lang-en.js'
13
+ import { logUnknownData } from '../utils/report-unknown.js'
13
14
 
14
15
  /*
15
16
  H7142
@@ -541,7 +542,12 @@ export default class {
541
542
  break
542
543
  }
543
544
  default:
544
- this.accessory.logDebugWarn(`${platformLang.newScene}: [${command}] [${hexString}]`)
545
+ logUnknownData(this.accessory, {
546
+ kind: 'scene',
547
+ source: params.source,
548
+ raw: command,
549
+ hex: hexString,
550
+ })
545
551
  break
546
552
  }
547
553
  })
@@ -5,6 +5,7 @@ import {
5
5
  parseError,
6
6
  } from '../utils/functions.js'
7
7
  import platformLang from '../utils/lang-en.js'
8
+ import { logUnknownData } from '../utils/report-unknown.js'
8
9
 
9
10
  export default class {
10
11
  constructor(platform, accessory) {
@@ -179,7 +180,12 @@ export default class {
179
180
  break
180
181
  }
181
182
  default:
182
- this.accessory.logDebugWarn(`${platformLang.newScene}: [${command}] [${hexString}]`)
183
+ logUnknownData(this.accessory, {
184
+ kind: 'scene',
185
+ source: params.source,
186
+ raw: command,
187
+ hex: hexString,
188
+ })
183
189
  break
184
190
  }
185
191
  })
@@ -10,6 +10,7 @@ import {
10
10
  sleep,
11
11
  } from '../utils/functions.js'
12
12
  import platformLang from '../utils/lang-en.js'
13
+ import { logUnknownData } from '../utils/report-unknown.js'
13
14
 
14
15
  export default class {
15
16
  constructor(platform, accessory) {
@@ -465,7 +466,12 @@ export default class {
465
466
  break
466
467
  }
467
468
  default:
468
- this.accessory.logDebugWarn(`${platformLang.newScene}: [${command}] [${hexString}]`)
469
+ logUnknownData(this.accessory, {
470
+ kind: 'scene',
471
+ source: params.source,
472
+ raw: command,
473
+ hex: hexString,
474
+ })
469
475
  break
470
476
  }
471
477
  })
@@ -1,7 +1,9 @@
1
- import { base64ToHex, getTwoItemPosition, hexToTwoItems, parseError } from '../utils/functions.js'
1
+ import { getDeviceCapabilities } from '../utils/device-capabilities.js'
2
+ import { base64ToHex, generateCodeFromHexValues, getTwoItemPosition, hexToTwoItems, parseError } from '../utils/functions.js'
2
3
  import platformLang from '../utils/lang-en.js'
4
+ import { logUnknownData } from '../utils/report-unknown.js'
3
5
 
4
- export default class {
6
+ export default class GoveeIceMaker {
5
7
  constructor(platform, accessory) {
6
8
  // Set up variables from the platform
7
9
  this.hapChar = platform.api.hap.Characteristic
@@ -13,10 +15,15 @@ export default class {
13
15
  this.accessory = accessory
14
16
 
15
17
  // Ice size codes: small=1, medium=2, large=3 (matching OpenAPI workMode values)
18
+ // Small, medium and large are all `33 05 <size>`. Which byte means which
19
+ // size runs the opposite way on the older models, so the order comes from
20
+ // the model rather than being written out twice
21
+ const ascending = getDeviceCapabilities(accessory.context.gvModel).iceSizeAscending
22
+ const sizeBytes = ascending ? [0x01, 0x02, 0x03] : [0x03, 0x02, 0x01]
16
23
  this.sizeCodes = {
17
- 1: 'MwUDAAAAAAAAAAAAAAAAAAAAADU=', // small
18
- 2: 'MwUCAAAAAAAAAAAAAAAAAAAAADQ=', // medium
19
- 3: 'MwUBAAAAAAAAAAAAAAAAAAAAADc=', // large
24
+ 1: generateCodeFromHexValues([0x33, 0x05, sizeBytes[0]]), // small
25
+ 2: generateCodeFromHexValues([0x33, 0x05, sizeBytes[1]]), // medium
26
+ 3: generateCodeFromHexValues([0x33, 0x05, sizeBytes[2]]), // large
20
27
  }
21
28
 
22
29
  this.sizeLabels = {
@@ -203,14 +210,19 @@ export default class {
203
210
  }
204
211
  case 'aa05': {
205
212
  // Ice size report. The payload encoding is deliberately NOT decoded here:
206
- // sizeCodes runs small=0x03..large=0x01 while the OpenAPI path sends
213
+ // the size byte order differs by model while the OpenAPI path sends
207
214
  // workMode un-inverted, and which is authoritative is unresolved (#1329).
208
215
  // Claiming a mapping here could silently swap sizes, so this case exists
209
216
  // only to stop a routine status report being logged as a new scene code.
210
217
  break
211
218
  }
212
219
  default:
213
- this.accessory.logWarn(`${platformLang.newScene}: [${command}] [${hexString}]`)
220
+ logUnknownData(this.accessory, {
221
+ kind: 'scene',
222
+ source: params.source,
223
+ raw: command,
224
+ hex: hexString,
225
+ })
214
226
  break
215
227
  }
216
228
  })
@@ -1,64 +1,48 @@
1
+ import {
2
+ deviceDehumidifierBasic,
3
+ deviceDiffuserBasic,
4
+ deviceFanBasic,
5
+ deviceHumidifierBasic,
6
+ deviceIceMakerBasic,
7
+ devicePurifierBasic,
8
+ } from './appliance-basic.js'
1
9
  import deviceCoolerSingle from './cooler-single.js'
2
10
  import deviceDehumidifierH7150 from './dehumidifier-H7150.js'
3
- import deviceDehumidifierH7151 from './dehumidifier-H7151.js'
4
- import deviceDehumidifierH7152 from './dehumidifier-H7152.js'
5
11
  import deviceDiffuserH7161 from './diffuser-H7161.js'
6
- import deviceDiffuserH7162 from './diffuser-H7162.js'
7
- import deviceFanH1310 from './fan-H1310.js'
8
12
  import deviceFanH1370 from './fan-H1370.js'
9
13
  import deviceFanH7100 from './fan-H7100.js'
10
- import deviceFanH7101 from './fan-H7101.js'
11
- import deviceFanH7102 from './fan-H7102.js'
12
14
  import deviceFanH7105 from './fan-H7105.js'
13
- import deviceFanH7106 from './fan-H7106.js'
14
15
  import deviceFanH7107 from './fan-H7107.js'
15
- import deviceFanH7111 from './fan-H7111.js'
16
16
  import deviceHeater1A from './heater1a.js'
17
17
  import deviceHeater1B from './heater1b.js'
18
18
  import deviceHeater2 from './heater2.js'
19
19
  import deviceHeaterSingle from './heater-single.js'
20
- import deviceHumidifierH714E from './humidifier-H714E.js'
21
20
  import deviceHumidifierH7140 from './humidifier-H7140.js'
22
21
  import deviceHumidifierH7141 from './humidifier-H7141.js'
23
22
  import deviceHumidifierH7142 from './humidifier-H7142.js'
24
23
  import deviceHumidifierH7143 from './humidifier-H7143.js'
25
- import deviceHumidifierH7145 from './humidifier-H7145.js'
26
- import deviceHumidifierH7147 from './humidifier-H7147.js'
27
- import deviceHumidifierH7148 from './humidifier-H7148.js'
28
- import deviceHumidifierH7149 from './humidifier-H7149.js'
29
24
  import deviceHumidifierH7160 from './humidifier-H7160.js'
30
- import deviceIceMakerH717D from './ice-maker-H717D.js'
31
25
  import deviceIceMakerH7172 from './ice-maker-H7172.js'
32
- import deviceIceMakerH8120 from './ice-maker-H8120.js'
33
26
  import deviceKettle from './kettle.js'
34
27
  import deviceLightSwitch from './light-switch.js'
35
28
  import deviceLight from './light.js'
36
- import deviceOutletDouble from './outlet-double.js'
37
29
  import deviceOutletSingle from './outlet-single.js'
38
- import deviceOutletTriple from './outlet-triple.js'
39
- import devicePurifierH712C from './purifier-H712C.js'
40
30
  import devicePurifierH7120 from './purifier-H7120.js'
41
- import devicePurifierH7121 from './purifier-H7121.js'
42
31
  import devicePurifierH7122 from './purifier-H7122.js'
43
32
  import devicePurifierH7123 from './purifier-H7123.js'
44
- import devicePurifierH7124 from './purifier-H7124.js'
45
33
  import devicePurifierH7126 from './purifier-H7126.js'
46
- import devicePurifierH7127 from './purifier-H7127.js'
47
- import devicePurifierH7128 from './purifier-H7128.js'
48
- import devicePurifierH7129 from './purifier-H7129.js'
49
34
  import devicePurifierSingle from './purifier-single.js'
50
- import deviceSensorButton from './sensor-button.js'
35
+ import deviceSensorBasic from './sensor-basic.js'
51
36
  import deviceSensorCO2 from './sensor-co2.js'
52
- import deviceSensorContact from './sensor-contact.js'
53
37
  import deviceSensorLeak from './sensor-leak.js'
54
38
  import deviceSensorMonitor from './sensor-monitor.js'
55
39
  import deviceSensorPresence from './sensor-presence.js'
56
40
  import deviceSensorThermo4 from './sensor-thermo4.js'
57
41
  import deviceSensorThermoSwitch from './sensor-thermo-switch.js'
58
42
  import deviceSensorThermo from './sensor-thermo.js'
59
- import deviceSwitchDouble from './switch-double.js'
43
+ import deviceSwitchDouble, { asOutlet as deviceOutletDouble } from './switch-double.js'
60
44
  import deviceSwitchSingle from './switch-single.js'
61
- import deviceSwitchTriple from './switch-triple.js'
45
+ import deviceSwitchTriple, { asOutlet as deviceOutletTriple } from './switch-triple.js'
62
46
  import deviceTapSingle from './tap-single.js'
63
47
  import deviceTemplate from './template.js'
64
48
  import deviceTVSingle from './tv-single.js'
@@ -67,57 +51,66 @@ import deviceValveSingle from './valve-single.js'
67
51
  export default {
68
52
  deviceCoolerSingle,
69
53
  deviceDehumidifierH7150,
70
- deviceDehumidifierH7151,
71
- deviceDehumidifierH7152,
54
+ deviceDehumidifierH7151: deviceDehumidifierH7150, // identical to the H7150
55
+ deviceDehumidifierH7152: deviceDehumidifierH7150, // same device, and this gives it proper speed feedback
72
56
  deviceDiffuserH7161,
73
- deviceDiffuserH7162,
74
- deviceFanH1310,
57
+ deviceDiffuserH7162: deviceDiffuserH7161, // identical to the H7161
58
+ deviceDehumidifierBasic,
59
+ deviceDiffuserBasic,
60
+ deviceFanBasic,
61
+ deviceFanH1310: deviceFanH7100, // same fan, minus a confirmed swing status message
75
62
  deviceFanH1370,
76
- deviceFanR1310: deviceFanH1310, // R1310 is the newer naming of the H1310
63
+ deviceFanR1310: deviceFanH7100, // R1310 is the newer naming of the H1310
77
64
  deviceFanH7100,
78
- deviceFanH7101,
79
- deviceFanH7102,
65
+ deviceFanH7102: deviceFanH7100, // identical to the H7100
66
+ deviceFanH7106: deviceFanH7100, // identical to the H7100
67
+ deviceFanH7101: deviceFanH7100, // identical to the H7100, with a turbo mode it is never sent
80
68
  deviceFanH7105,
81
- deviceFanH7106,
82
69
  deviceFanH7107,
83
- deviceFanH7111,
70
+ deviceFanH7111: deviceFanH7100, // same fan without the turbo mode, which is not sent
84
71
  deviceHeaterSingle,
85
72
  deviceHeater1A,
86
73
  deviceHeater1B,
87
74
  deviceHeater2,
88
- deviceHumidifierH714E,
75
+ deviceHumidifierBasic,
89
76
  deviceHumidifierH7140,
90
77
  deviceHumidifierH7141,
91
78
  deviceHumidifierH7142,
92
79
  deviceHumidifierH7143,
93
- deviceHumidifierH7145,
94
- deviceHumidifierH7147,
95
- deviceHumidifierH7148,
96
- deviceHumidifierH7149,
80
+ deviceHumidifierH7145: deviceHumidifierH7143, // identical to the H7143
81
+ deviceHumidifierH7147: deviceHumidifierH7143, // identical to the H7143
82
+ deviceHumidifierH7148: deviceHumidifierH7143, // identical to the H7143
83
+ deviceHumidifierH7149: deviceHumidifierH7143, // identical to the H7143
84
+ deviceHumidifierH714E: deviceHumidifierH7143, // identical to the H7143
97
85
  deviceHumidifierH7160,
86
+ deviceIceMakerBasic,
98
87
  deviceIceMakerH7172,
99
- deviceIceMakerH717D,
100
- deviceIceMakerH8120,
88
+ deviceIceMakerH717D: deviceIceMakerH7172, // identical to the H7172
89
+ deviceIceMakerH8120: deviceIceMakerH7172, // identical to the H7172
90
+ deviceIceMakerH8121: deviceIceMakerH7172, // same handler; its size byte order comes from the model
91
+ deviceIceMakerH8122: deviceIceMakerH7172, // identical to the H8121
101
92
  deviceKettle,
102
93
  deviceLight,
103
94
  deviceLightSwitch,
104
95
  deviceOutletDouble,
105
96
  deviceOutletSingle,
106
97
  deviceOutletTriple,
107
- devicePurifierH712C,
98
+ devicePurifierBasic,
108
99
  devicePurifierH7120,
109
- devicePurifierH7121,
100
+ devicePurifierH7121: devicePurifierH7120, // identical apart from its sleep mode value, which is not sent
110
101
  devicePurifierH7122,
111
102
  devicePurifierH7123,
112
- devicePurifierH7124,
103
+ devicePurifierH7124: devicePurifierH7123, // same device; this also gives it the #1261 air quality fix
113
104
  devicePurifierH7126,
114
- devicePurifierH7127,
115
- devicePurifierH7128,
116
- devicePurifierH7129,
105
+ devicePurifierH7127: devicePurifierH7126, // identical to the H7126
106
+ devicePurifierH7128: devicePurifierH7126, // identical to the H7126
107
+ devicePurifierH7129: devicePurifierH7126, // identical to the H7126
108
+ devicePurifierH712C: devicePurifierH7126, // identical to the H7126
117
109
  devicePurifierSingle,
118
- deviceSensorButton,
110
+ deviceSensorBasic,
111
+ deviceSensorButton: deviceSensorBasic, // nothing decoded yet, so it reports instead
119
112
  deviceSensorCO2,
120
- deviceSensorContact,
113
+ deviceSensorContact: deviceSensorBasic, // nothing decoded yet, so it reports instead
121
114
  deviceSensorLeak,
122
115
  deviceSensorMonitor,
123
116
  deviceSensorPresence,
@@ -6,6 +6,7 @@ import {
6
6
  sleep,
7
7
  } from '../utils/functions.js'
8
8
  import platformLang from '../utils/lang-en.js'
9
+ import { logUnknownData } from '../utils/report-unknown.js'
9
10
 
10
11
  /*
11
12
  Custom Mode: aa050001010000000000000000000000000000af
@@ -298,7 +299,12 @@ export default class {
298
299
  break
299
300
  }
300
301
  default:
301
- this.accessory.logDebugWarn(`${platformLang.newScene}: [${command}] [${hexString}]`)
302
+ logUnknownData(this.accessory, {
303
+ kind: 'scene',
304
+ source: params.source,
305
+ raw: command,
306
+ hex: hexString,
307
+ })
302
308
  break
303
309
  }
304
310
  })
@@ -1,5 +1,6 @@
1
1
  import { base64ToHex, generateRandomString, getTwoItemPosition, hexToTwoItems, parseError } from '../utils/functions.js'
2
2
  import platformLang from '../utils/lang-en.js'
3
+ import { logUnknownData } from '../utils/report-unknown.js'
3
4
 
4
5
  export default class {
5
6
  constructor(platform, accessory) {
@@ -164,7 +165,12 @@ export default class {
164
165
  break
165
166
  }
166
167
  default:
167
- this.accessory.logDebugWarn(`${platformLang.newScene}: [${command}] [${hexString}]`)
168
+ logUnknownData(this.accessory, {
169
+ kind: 'scene',
170
+ source: params.source,
171
+ raw: command,
172
+ hex: hexString,
173
+ })
168
174
  break
169
175
  }
170
176
  })
@@ -5,34 +5,18 @@ import {
5
5
  parseError,
6
6
  } from '../utils/functions.js'
7
7
  import platformLang from '../utils/lang-en.js'
8
+ import { logUnknownData } from '../utils/report-unknown.js'
8
9
 
9
10
  /*
10
- H7120
11
- {
12
- "mode": {
13
- "options": [
14
- {
15
- "name": "Low",
16
- "value": 1
17
- },
18
- {
19
- "name": "Medium",
20
- "value": 2
21
- },
22
- {
23
- "name": "High",
24
- "value": 3
25
- },
26
- {
27
- "name": "Sleep mode",
28
- "value": 5
29
- }
30
- ]
31
- }
32
- }
11
+ The modes these purifiers report over the api. Low, medium and high are the
12
+ gear speeds the plugin drives; sleep is listed for reference and is the one
13
+ place the two models differ, so it must not be sent as a shared value.
14
+
15
+ H7120: Low 1, Medium 2, High 3, "Sleep mode" 5
16
+ H7121: Low 1, Medium 2, High 3, "Sleep" 16
33
17
  */
34
18
 
35
- export default class {
19
+ export default class GoveePurifierH7120 {
36
20
  constructor(platform, accessory) {
37
21
  // Set up variables from the platform
38
22
  this.cusChar = platform.cusChar
@@ -398,7 +382,12 @@ export default class {
398
382
  break
399
383
  }
400
384
  default:
401
- this.accessory.logDebugWarn(`${platformLang.newScene}: [${command}] [${hexString}]`)
385
+ logUnknownData(this.accessory, {
386
+ kind: 'scene',
387
+ source: params.source,
388
+ raw: command,
389
+ hex: hexString,
390
+ })
402
391
  break
403
392
  }
404
393
  })
@@ -8,6 +8,7 @@ import {
8
8
  statusToActionCode,
9
9
  } from '../utils/functions.js'
10
10
  import platformLang from '../utils/lang-en.js'
11
+ import { logUnknownData } from '../utils/report-unknown.js'
11
12
 
12
13
  /*
13
14
  H7122
@@ -534,7 +535,12 @@ export default class {
534
535
  break
535
536
  }
536
537
  default:
537
- this.accessory.logDebugWarn(`${platformLang.newScene}: [${command}] [${hexString}]`)
538
+ logUnknownData(this.accessory, {
539
+ kind: 'scene',
540
+ source: params.source,
541
+ raw: command,
542
+ hex: hexString,
543
+ })
538
544
  break
539
545
  }
540
546
  })