homebridge-easy-mqtt 1.4.0-beta.5 → 1.4.0-beta.7
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.
- package/CHANGELOG.md +3 -2
- package/README.md +38 -25
- package/config.schema.json +160 -33
- package/dist/accessory/abstract/helper.js +3 -0
- package/dist/accessory/abstract/helper.js.map +1 -1
- package/dist/accessory/climate/active.d.ts +11 -0
- package/dist/accessory/climate/active.js +44 -0
- package/dist/accessory/climate/active.js.map +1 -0
- package/dist/accessory/climate/heaterCooler.d.ts +2 -6
- package/dist/accessory/climate/heaterCooler.js +3 -37
- package/dist/accessory/climate/heaterCooler.js.map +1 -1
- package/dist/accessory/climate/purifier.d.ts +19 -0
- package/dist/accessory/climate/purifier.js +112 -0
- package/dist/accessory/climate/purifier.js.map +1 -0
- package/dist/accessory/climate/{climate.d.ts → temperatureControl.d.ts} +3 -2
- package/dist/accessory/climate/{climate.js → temperatureControl.js} +7 -5
- package/dist/accessory/climate/temperatureControl.js.map +1 -0
- package/dist/accessory/climate/thermostat.d.ts +2 -2
- package/dist/accessory/climate/thermostat.js +3 -2
- package/dist/accessory/climate/thermostat.js.map +1 -1
- package/dist/accessory/valve.js +1 -1
- package/dist/accessory/valve.js.map +1 -1
- package/dist/homebridge-ui/public/index.html +1 -1
- package/dist/homebridge-ui/public/ui.js +1 -1
- package/dist/i18n/en.d.ts +21 -2
- package/dist/i18n/en.js +40 -21
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/fr.d.ts +21 -2
- package/dist/i18n/i18n.d.ts +23 -3
- package/dist/i18n/i18n.js +6 -0
- package/dist/i18n/i18n.js.map +1 -1
- package/dist/i18n/ro.d.ts +744 -0
- package/dist/i18n/ro.js +381 -0
- package/dist/i18n/ro.js.map +1 -0
- package/dist/i18n/template.d.ts +21 -2
- package/dist/model/enums.d.ts +3 -0
- package/dist/model/enums.js +3 -0
- package/dist/model/enums.js.map +1 -1
- package/dist/model/types.d.ts +34 -22
- package/package.json +1 -1
- package/dist/accessory/climate/climate.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to homebridge-dummy will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## 1.4.0-beta.
|
|
5
|
+
## 1.4.0-beta.7 (2025-09-22)
|
|
6
6
|
|
|
7
7
|
### Added
|
|
8
|
-
- Support for HeaterCooler, LightSensor, and Valve
|
|
8
|
+
- Support for Air Purifier, HeaterCooler, LightSensor, and Valve
|
|
9
|
+
- Traduceri în limba română. Mulțumesc, [@rursache](https://github.com/sponsors/rursache)!
|
|
9
10
|
|
|
10
11
|
### Changed
|
|
11
12
|
- Optimized MQTT connections by sharing across multiple accessories when possible
|
package/README.md
CHANGED
|
@@ -188,7 +188,7 @@ As with topics, you will also need to populate the appropriate values based on t
|
|
|
188
188
|
- `topicGetCurrentTemperature*` - The current temperature of the sensor
|
|
189
189
|
- `temperatureUnits` - The temperature units of the incoming value supplied by the sensor, `C` for Celsius (default) `F` for Fahrenheit
|
|
190
190
|
|
|
191
|
-
###
|
|
191
|
+
### Temperature Control
|
|
192
192
|
- `temperatureUnits` - The temperature units of the incoming value supplied by the thermostat, `C` for Celsius (default) `F` for Fahrenheit
|
|
193
193
|
- `topicGetCurrentTemperature*` - Get the current temperature
|
|
194
194
|
- `topicGetCoolingThresholdTemperature` - Get the cooling threshold temperature
|
|
@@ -196,30 +196,6 @@ As with topics, you will also need to populate the appropriate values based on t
|
|
|
196
196
|
- `topicGetHeatingThresholdTemperature` - Get the heating threshold temperature
|
|
197
197
|
- `topicSetHeatingThresholdTemperature` - Set the heating threshold temperature
|
|
198
198
|
|
|
199
|
-
#### HeaterCooler
|
|
200
|
-
- `topicGetHeaterCoolerActive*` - Get whether or not the accessory is currently active
|
|
201
|
-
- `topicSetHeaterCoolerActive*` - Set whether or not the accessory is currently active
|
|
202
|
-
- `topicGetCurrentHeaterCoolerState*` - Get the current mode (i.e. inactive, idle, heating, cooling)
|
|
203
|
-
- `topicGetTargetHeaterCoolerState*` - Get the target mode (i.e. auto, heat, cool)
|
|
204
|
-
- `topicSetTargetHeaterCoolerState*` - Set the target mode (i.e. auto, heat, cool)
|
|
205
|
-
- `topicGetLockPhysicalControls` - Get whether or not the physical controls are locked
|
|
206
|
-
- `topicSetLockPhysicalControls` - Set whether or not the physical controls are locked
|
|
207
|
-
- `topicGetRotationSpeed` - Get the rotation speed as a percentage
|
|
208
|
-
- `topicSetRotationSpeed` - Set the rotation speed as a percentage
|
|
209
|
-
- `topicGetSwingMode` - Get whether or not accessory is oscillating
|
|
210
|
-
- `topicSetSwingMode` - Set whether or not accessory is oscillating
|
|
211
|
-
- `valueStateActive*` - Accessory is currently active
|
|
212
|
-
- `valueStateInactive*` - Accessory is currently inactive
|
|
213
|
-
- `valueModeAuto` - Mode is auto
|
|
214
|
-
- `valueModeCool` - Mode is cool/cooling
|
|
215
|
-
- `valueModeHeat` - Mode is heat/heating
|
|
216
|
-
- `valueModeIdle` - Mode is idle
|
|
217
|
-
- `valueModeInactive` - Mode is inactive
|
|
218
|
-
- `valueControlLock` - Physical controls are locked
|
|
219
|
-
- `valueControlUnlock` - Physical controls are unlocked
|
|
220
|
-
- `valueSwingEnabled` - Accessory is oscillating
|
|
221
|
-
- `valueSwingDisabled` - Accessory is not oscillating
|
|
222
|
-
|
|
223
199
|
#### Thermostat
|
|
224
200
|
- `topicGetCurrentHeatingCoolingState*` - Get the current mode (i.e. cooling, heating, off)
|
|
225
201
|
- `topicGetTargetHeatingCoolingState*` - Get the target mode (i.e. auto, cooling, heating, off)
|
|
@@ -234,6 +210,43 @@ As with topics, you will also need to populate the appropriate values based on t
|
|
|
234
210
|
- `valueModeHeat` - Heat mode
|
|
235
211
|
- `valueModeOff` - Thermostat off
|
|
236
212
|
|
|
213
|
+
### Active Climate Control
|
|
214
|
+
`Temperature Control` topics above plus…
|
|
215
|
+
- `topicGetActive*` - Get whether or not the accessory is currently active
|
|
216
|
+
- `topicSetActive*` - Set whether or not the accessory is currently active
|
|
217
|
+
- `topicGetLockPhysicalControls` - Get whether or not the physical controls are locked
|
|
218
|
+
- `topicSetLockPhysicalControls` - Set whether or not the physical controls are locked
|
|
219
|
+
- `topicGetRotationSpeed` - Get the rotation speed as a percentage
|
|
220
|
+
- `topicSetRotationSpeed` - Set the rotation speed as a percentage
|
|
221
|
+
- `topicGetSwingMode` - Get whether or not accessory is oscillating
|
|
222
|
+
- `topicSetSwingMode` - Set whether or not accessory is oscillating
|
|
223
|
+
- `valueStateActive*` - Accessory is currently active
|
|
224
|
+
- `valueStateInactive*` - Accessory is currently inactive
|
|
225
|
+
- `valueControlLock` - Physical controls are locked
|
|
226
|
+
- `valueControlUnlock` - Physical controls are unlocked
|
|
227
|
+
- `valueSwingEnabled` - Accessory is oscillating
|
|
228
|
+
- `valueSwingDisabled` - Accessory is not oscillating
|
|
229
|
+
|
|
230
|
+
#### Air Purifier
|
|
231
|
+
- `topicGetCurrentPurifierState*` - Get the current mode (i.e. inactive, idle, purifying)
|
|
232
|
+
- `topicGetTargetPurifierState*` - Get the target mode (i.e. auto, manual)
|
|
233
|
+
- `topicSetTargetPurifierState*` - Set the target mode (i.e. auto, manual)
|
|
234
|
+
- `valueModeAuto` - Auto target mode
|
|
235
|
+
- `valueModeIdle` - Idle mode
|
|
236
|
+
- `valueModeInactive` - Inactive mode
|
|
237
|
+
- `valueModeManual` - Manual target mode
|
|
238
|
+
- `valueModePurifying` - Purifying mode
|
|
239
|
+
|
|
240
|
+
#### HeaterCooler
|
|
241
|
+
- `topicGetCurrentHeaterCoolerState*` - Get the current mode (i.e. inactive, idle, heating, cooling)
|
|
242
|
+
- `topicGetTargetHeaterCoolerState*` - Get the target mode (i.e. auto, heat, cool)
|
|
243
|
+
- `topicSetTargetHeaterCoolerState*` - Set the target mode (i.e. auto, heat, cool)
|
|
244
|
+
- `valueModeAuto` - Mode is auto
|
|
245
|
+
- `valueModeCool` - Mode is cool/cooling
|
|
246
|
+
- `valueModeHeat` - Mode is heat/heating
|
|
247
|
+
- `valueModeIdle` - Mode is idle
|
|
248
|
+
- `valueModeInactive` - Mode is inactive
|
|
249
|
+
|
|
237
250
|
### Others
|
|
238
251
|
|
|
239
252
|
#### LockMechanism
|
package/config.schema.json
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"type": {
|
|
22
22
|
"type": "string",
|
|
23
23
|
"title": "${config.title.type}",
|
|
24
|
-
"enum": [ "CarbonMonoxideSensor", "CarbonDioxideSensor", "ContactSensor", "HeaterCooler", "HumiditySensor", "LeakSensor", "Lightbulb", "LightSensor", "LockMechanism", "MotionSensor", "OccupancySensor", "Outlet", "SecuritySystem", "SmokeSensor", "Switch", "TemperatureSensor", "Thermostat", "Valve"],
|
|
25
|
-
"enumNames": ["${config.enumNames.carbonMonoxideSensor}", "${config.enumNames.carbonDioxideSensor}", "${config.enumNames.contactSensor}", "${config.enumNames.heaterCooler}", "${config.enumNames.humiditySensor}", "${config.enumNames.leakSensor}", "${config.enumNames.lightbulb}", "${config.enumNames.lightSensor}", "${config.enumNames.lockMechanism}", "${config.enumNames.motionSensor}", "${config.enumNames.occupancySensor}", "${config.enumNames.outlet}", "${config.enumNames.securitySystem}", "${config.enumNames.smokeSensor}", "${config.enumNames.switch}", "${config.enumNames.temperatureSensor}", "${config.enumNames.thermostat}", "${config.enumNames.valve}"],
|
|
24
|
+
"enum": [ "AirPurifier", "CarbonMonoxideSensor", "CarbonDioxideSensor", "ContactSensor", "HeaterCooler", "HumiditySensor", "LeakSensor", "Lightbulb", "LightSensor", "LockMechanism", "MotionSensor", "OccupancySensor", "Outlet", "SecuritySystem", "SmokeSensor", "Switch", "TemperatureSensor", "Thermostat", "Valve"],
|
|
25
|
+
"enumNames": ["${config.enumNames.airPurifier}", "${config.enumNames.carbonMonoxideSensor}", "${config.enumNames.carbonDioxideSensor}", "${config.enumNames.contactSensor}", "${config.enumNames.heaterCooler}", "${config.enumNames.humiditySensor}", "${config.enumNames.leakSensor}", "${config.enumNames.lightbulb}", "${config.enumNames.lightSensor}", "${config.enumNames.lockMechanism}", "${config.enumNames.motionSensor}", "${config.enumNames.occupancySensor}", "${config.enumNames.outlet}", "${config.enumNames.securitySystem}", "${config.enumNames.smokeSensor}", "${config.enumNames.switch}", "${config.enumNames.temperatureSensor}", "${config.enumNames.thermostat}", "${config.enumNames.valve}"],
|
|
26
26
|
"required": true
|
|
27
27
|
},
|
|
28
28
|
"group": {
|
|
@@ -308,9 +308,9 @@
|
|
|
308
308
|
"type": "string",
|
|
309
309
|
"title": "${config.title.topicSetHeatingThresholdTemperature}"
|
|
310
310
|
},
|
|
311
|
-
"
|
|
311
|
+
"topicGetActive": {
|
|
312
312
|
"type": "string",
|
|
313
|
-
"title": "${config.title.
|
|
313
|
+
"title": "${config.title.topicGetActive}"
|
|
314
314
|
},
|
|
315
315
|
"topicGetCurrentHeaterCoolerState": {
|
|
316
316
|
"type": "string",
|
|
@@ -332,9 +332,9 @@
|
|
|
332
332
|
"type": "string",
|
|
333
333
|
"title": "${config.title.topicGetTargetHeaterCoolerState}"
|
|
334
334
|
},
|
|
335
|
-
"
|
|
335
|
+
"topicSetActive": {
|
|
336
336
|
"type": "string",
|
|
337
|
-
"title": "${config.title.
|
|
337
|
+
"title": "${config.title.topicSetActive}"
|
|
338
338
|
},
|
|
339
339
|
"topicSetLockPhysicalControls": {
|
|
340
340
|
"type": "string",
|
|
@@ -384,6 +384,18 @@
|
|
|
384
384
|
"type": "string",
|
|
385
385
|
"title": "${config.title.topicSetValveSetDuration}"
|
|
386
386
|
},
|
|
387
|
+
"topicGetCurrentPurifierState": {
|
|
388
|
+
"type": "string",
|
|
389
|
+
"title": "${config.title.topicGetCurrentPurifierState}"
|
|
390
|
+
},
|
|
391
|
+
"topicGetTargetPurifierState": {
|
|
392
|
+
"type": "string",
|
|
393
|
+
"title": "${config.title.topicGetTargetPurifierState}"
|
|
394
|
+
},
|
|
395
|
+
"topicSetTargetPurifierState": {
|
|
396
|
+
"type": "string",
|
|
397
|
+
"title": "${config.title.topicSetTargetPurifierState}"
|
|
398
|
+
},
|
|
387
399
|
"valueBatteryLow": {
|
|
388
400
|
"type": "string",
|
|
389
401
|
"title": "${config.title.valueBatteryLow}"
|
|
@@ -540,6 +552,14 @@
|
|
|
540
552
|
"type": "string",
|
|
541
553
|
"title": "${config.title.valueInactive}"
|
|
542
554
|
},
|
|
555
|
+
"valueModeManual": {
|
|
556
|
+
"type": "string",
|
|
557
|
+
"title": "${config.title.valueModeManual}"
|
|
558
|
+
},
|
|
559
|
+
"valueModePurifying": {
|
|
560
|
+
"type": "string",
|
|
561
|
+
"title": "${config.title.valueModePurifying}"
|
|
562
|
+
},
|
|
543
563
|
"disableLogging": {
|
|
544
564
|
"type": "boolean",
|
|
545
565
|
"title": "${config.title.disableLogging}"
|
|
@@ -737,6 +757,27 @@
|
|
|
737
757
|
"required": ["topicGetCurrentTemperature"]
|
|
738
758
|
}
|
|
739
759
|
},
|
|
760
|
+
{
|
|
761
|
+
"if": {
|
|
762
|
+
"properties": {
|
|
763
|
+
"info": {
|
|
764
|
+
"properties": {
|
|
765
|
+
"type" : {
|
|
766
|
+
"const": "AirPurifier"
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
},
|
|
772
|
+
"then": {
|
|
773
|
+
"required": ["topicGetActive", "topicSetActive", "topicGetCurrentPurifierState", "topicGetTargetPurifierState", "topicSetTargetPurifierState", "valueStateActive", "valueStateInactive"],
|
|
774
|
+
"anyOf": [
|
|
775
|
+
{ "required": ["valueModeIdle"] },
|
|
776
|
+
{ "required": ["valueModeInactive"] },
|
|
777
|
+
{ "required": ["valueModePurifying"] }
|
|
778
|
+
]
|
|
779
|
+
}
|
|
780
|
+
},
|
|
740
781
|
{
|
|
741
782
|
"if": {
|
|
742
783
|
"properties": {
|
|
@@ -750,7 +791,7 @@
|
|
|
750
791
|
}
|
|
751
792
|
},
|
|
752
793
|
"then": {
|
|
753
|
-
"required": ["
|
|
794
|
+
"required": ["topicGetActive", "topicSetActive", "topicGetCurrentHeaterCoolerState", "topicGetCurrentTemperature", "topicGetTargetHeaterCoolerState", "topicSetTargetHeaterCoolerState", "valueStateActive", "valueStateInactive"],
|
|
754
795
|
"anyOf": [
|
|
755
796
|
{ "required": ["valueModeCool"] },
|
|
756
797
|
{ "required": ["valueModeHeat"] }
|
|
@@ -1292,7 +1333,7 @@
|
|
|
1292
1333
|
"type": "fieldset",
|
|
1293
1334
|
"notitle": true,
|
|
1294
1335
|
"condition": {
|
|
1295
|
-
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === '
|
|
1336
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'AirPurifier';"
|
|
1296
1337
|
},
|
|
1297
1338
|
"items": [
|
|
1298
1339
|
{
|
|
@@ -1301,12 +1342,8 @@
|
|
|
1301
1342
|
"flex-direction": "row",
|
|
1302
1343
|
"items": [
|
|
1303
1344
|
{
|
|
1304
|
-
"key": "accessories[].
|
|
1345
|
+
"key": "accessories[].topicGetCurrentPurifierState",
|
|
1305
1346
|
"flex": "0 0 50%"
|
|
1306
|
-
},
|
|
1307
|
-
{
|
|
1308
|
-
"key": "accessories[].temperatureUnits",
|
|
1309
|
-
"flex": "0 0 25%"
|
|
1310
1347
|
}
|
|
1311
1348
|
]
|
|
1312
1349
|
},
|
|
@@ -1316,23 +1353,36 @@
|
|
|
1316
1353
|
"flex-direction": "row",
|
|
1317
1354
|
"items": [
|
|
1318
1355
|
{
|
|
1319
|
-
"key": "accessories[].
|
|
1356
|
+
"key": "accessories[].topicGetTargetPurifierState",
|
|
1320
1357
|
"flex": "0 0 50%"
|
|
1321
1358
|
},
|
|
1322
1359
|
{
|
|
1323
|
-
"key": "accessories[].
|
|
1360
|
+
"key": "accessories[].topicSetTargetPurifierState",
|
|
1324
1361
|
"flex": "0 0 50%"
|
|
1325
1362
|
}
|
|
1326
1363
|
]
|
|
1327
|
-
}
|
|
1364
|
+
}
|
|
1365
|
+
]
|
|
1366
|
+
},
|
|
1367
|
+
{
|
|
1368
|
+
"type": "fieldset",
|
|
1369
|
+
"notitle": true,
|
|
1370
|
+
"condition": {
|
|
1371
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'HeaterCooler';"
|
|
1372
|
+
},
|
|
1373
|
+
"items": [
|
|
1328
1374
|
{
|
|
1329
1375
|
"type": "div",
|
|
1330
1376
|
"displayFlex": true,
|
|
1331
1377
|
"flex-direction": "row",
|
|
1332
1378
|
"items": [
|
|
1333
1379
|
{
|
|
1334
|
-
"key": "accessories[].
|
|
1380
|
+
"key": "accessories[].topicGetCurrentTemperature",
|
|
1335
1381
|
"flex": "0 0 50%"
|
|
1382
|
+
},
|
|
1383
|
+
{
|
|
1384
|
+
"key": "accessories[].temperatureUnits",
|
|
1385
|
+
"flex": "0 0 25%"
|
|
1336
1386
|
}
|
|
1337
1387
|
]
|
|
1338
1388
|
},
|
|
@@ -1342,11 +1392,7 @@
|
|
|
1342
1392
|
"flex-direction": "row",
|
|
1343
1393
|
"items": [
|
|
1344
1394
|
{
|
|
1345
|
-
"key": "accessories[].
|
|
1346
|
-
"flex": "0 0 50%"
|
|
1347
|
-
},
|
|
1348
|
-
{
|
|
1349
|
-
"key": "accessories[].topicSetTargetHeaterCoolerState",
|
|
1395
|
+
"key": "accessories[].topicGetCurrentHeaterCoolerState",
|
|
1350
1396
|
"flex": "0 0 50%"
|
|
1351
1397
|
}
|
|
1352
1398
|
]
|
|
@@ -1357,30 +1403,48 @@
|
|
|
1357
1403
|
"flex-direction": "row",
|
|
1358
1404
|
"items": [
|
|
1359
1405
|
{
|
|
1360
|
-
"key": "accessories[].
|
|
1406
|
+
"key": "accessories[].topicGetTargetHeaterCoolerState",
|
|
1361
1407
|
"flex": "0 0 50%"
|
|
1362
1408
|
},
|
|
1363
1409
|
{
|
|
1364
|
-
"key": "accessories[].
|
|
1410
|
+
"key": "accessories[].topicSetTargetHeaterCoolerState",
|
|
1365
1411
|
"flex": "0 0 50%"
|
|
1366
1412
|
}
|
|
1367
1413
|
]
|
|
1368
|
-
}
|
|
1414
|
+
}
|
|
1415
|
+
]
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
"type": "fieldset",
|
|
1419
|
+
"notitle": true,
|
|
1420
|
+
"condition": {
|
|
1421
|
+
"functionBody": "return ['HeaterCooler', 'AirPurifier'].includes(model.accessories?.[arguments[1]]?.info?.type);"
|
|
1422
|
+
},
|
|
1423
|
+
"items": [
|
|
1369
1424
|
{
|
|
1370
1425
|
"type": "div",
|
|
1371
1426
|
"displayFlex": true,
|
|
1372
1427
|
"flex-direction": "row",
|
|
1373
1428
|
"items": [
|
|
1374
1429
|
{
|
|
1375
|
-
"key": "accessories[].
|
|
1430
|
+
"key": "accessories[].topicGetActive",
|
|
1376
1431
|
"flex": "0 0 50%"
|
|
1377
1432
|
},
|
|
1378
1433
|
{
|
|
1379
|
-
"key": "accessories[].
|
|
1434
|
+
"key": "accessories[].topicSetActive",
|
|
1380
1435
|
"flex": "0 0 50%"
|
|
1381
1436
|
}
|
|
1382
1437
|
]
|
|
1383
|
-
}
|
|
1438
|
+
}
|
|
1439
|
+
]
|
|
1440
|
+
},
|
|
1441
|
+
{
|
|
1442
|
+
"type": "fieldset",
|
|
1443
|
+
"notitle": true,
|
|
1444
|
+
"condition": {
|
|
1445
|
+
"functionBody": "return ['HeaterCooler', 'AirPurifier'].includes(model.accessories?.[arguments[1]]?.info?.type);"
|
|
1446
|
+
},
|
|
1447
|
+
"items": [
|
|
1384
1448
|
{
|
|
1385
1449
|
"type": "div",
|
|
1386
1450
|
"displayFlex": true,
|
|
@@ -1619,7 +1683,16 @@
|
|
|
1619
1683
|
"flex": "0 0 50%"
|
|
1620
1684
|
}
|
|
1621
1685
|
]
|
|
1622
|
-
}
|
|
1686
|
+
}
|
|
1687
|
+
]
|
|
1688
|
+
},
|
|
1689
|
+
{
|
|
1690
|
+
"type": "fieldset",
|
|
1691
|
+
"notitle": true,
|
|
1692
|
+
"condition": {
|
|
1693
|
+
"functionBody": "return ['HeaterCooler', 'Thermostat'].includes(model.accessories?.[arguments[1]]?.info?.type);"
|
|
1694
|
+
},
|
|
1695
|
+
"items": [
|
|
1623
1696
|
{
|
|
1624
1697
|
"type": "div",
|
|
1625
1698
|
"displayFlex": true,
|
|
@@ -1705,11 +1778,11 @@
|
|
|
1705
1778
|
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type !== undefined;"
|
|
1706
1779
|
},
|
|
1707
1780
|
"items": [
|
|
1708
|
-
|
|
1781
|
+
{
|
|
1709
1782
|
"type": "fieldset",
|
|
1710
1783
|
"notitle": true,
|
|
1711
1784
|
"condition": {
|
|
1712
|
-
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type
|
|
1785
|
+
"functionBody": "return ['HeaterCooler', 'AirPurifier'].includes(model.accessories?.[arguments[1]]?.info?.type);"
|
|
1713
1786
|
},
|
|
1714
1787
|
"items": [
|
|
1715
1788
|
{
|
|
@@ -1726,7 +1799,52 @@
|
|
|
1726
1799
|
"flex": "0 0 20%"
|
|
1727
1800
|
}
|
|
1728
1801
|
]
|
|
1729
|
-
}
|
|
1802
|
+
}
|
|
1803
|
+
]
|
|
1804
|
+
},
|
|
1805
|
+
{
|
|
1806
|
+
"type": "fieldset",
|
|
1807
|
+
"notitle": true,
|
|
1808
|
+
"condition": {
|
|
1809
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'AirPurifier';"
|
|
1810
|
+
},
|
|
1811
|
+
"items": [
|
|
1812
|
+
{
|
|
1813
|
+
"type": "div",
|
|
1814
|
+
"displayFlex": true,
|
|
1815
|
+
"flex-direction": "row",
|
|
1816
|
+
"items": [
|
|
1817
|
+
{
|
|
1818
|
+
"key": "accessories[].valueModeAuto",
|
|
1819
|
+
"flex": "0 0 20%"
|
|
1820
|
+
},
|
|
1821
|
+
{
|
|
1822
|
+
"key": "accessories[].valueModeManual",
|
|
1823
|
+
"flex": "0 0 20%"
|
|
1824
|
+
},
|
|
1825
|
+
{
|
|
1826
|
+
"key": "accessories[].valueModePurifying",
|
|
1827
|
+
"flex": "0 0 20%"
|
|
1828
|
+
},
|
|
1829
|
+
{
|
|
1830
|
+
"key": "accessories[].valueModeIdle",
|
|
1831
|
+
"flex": "0 0 20%"
|
|
1832
|
+
},
|
|
1833
|
+
{
|
|
1834
|
+
"key": "accessories[].valueModeInactive",
|
|
1835
|
+
"flex": "0 0 20%"
|
|
1836
|
+
}
|
|
1837
|
+
]
|
|
1838
|
+
}
|
|
1839
|
+
]
|
|
1840
|
+
},
|
|
1841
|
+
{
|
|
1842
|
+
"type": "fieldset",
|
|
1843
|
+
"notitle": true,
|
|
1844
|
+
"condition": {
|
|
1845
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'HeaterCooler';"
|
|
1846
|
+
},
|
|
1847
|
+
"items": [
|
|
1730
1848
|
{
|
|
1731
1849
|
"type": "div",
|
|
1732
1850
|
"displayFlex": true,
|
|
@@ -1753,7 +1871,16 @@
|
|
|
1753
1871
|
"flex": "0 0 20%"
|
|
1754
1872
|
}
|
|
1755
1873
|
]
|
|
1756
|
-
}
|
|
1874
|
+
}
|
|
1875
|
+
]
|
|
1876
|
+
},
|
|
1877
|
+
{
|
|
1878
|
+
"type": "fieldset",
|
|
1879
|
+
"notitle": true,
|
|
1880
|
+
"condition": {
|
|
1881
|
+
"functionBody": "return ['HeaterCooler', 'AirPurifier'].includes(model.accessories?.[arguments[1]]?.info?.type);"
|
|
1882
|
+
},
|
|
1883
|
+
"items": [
|
|
1757
1884
|
{
|
|
1758
1885
|
"type": "div",
|
|
1759
1886
|
"displayFlex": true,
|
|
@@ -3,6 +3,7 @@ import { AccessoryType } from '../../model/enums.js';
|
|
|
3
3
|
import { LockMechanismAccessory } from '../lock.js';
|
|
4
4
|
import { SecuritySystemAccessory } from '../security.js';
|
|
5
5
|
import { HeaterCoolerAccessory } from '../climate/heaterCooler.js';
|
|
6
|
+
import { PurifierAccessory } from '../climate/purifier.js';
|
|
6
7
|
import { ThermostatAccessory } from '../climate/thermostat.js';
|
|
7
8
|
import { LightbulbAccessory } from '../onoff/lightbulb.js';
|
|
8
9
|
import { OutletAccessory } from '../onoff/outlet.js';
|
|
@@ -28,6 +29,8 @@ export function createAccessory(Service, Characteristic, platformAccessory, acce
|
|
|
28
29
|
return new ContactSensorAccessory(Service, Characteristic, platformAccessory, accessoryConfig, log, isGrouped);
|
|
29
30
|
case AccessoryType.HeaterCooler:
|
|
30
31
|
return new HeaterCoolerAccessory(Service, Characteristic, platformAccessory, accessoryConfig, log, isGrouped);
|
|
32
|
+
case AccessoryType.AirPurifier:
|
|
33
|
+
return new PurifierAccessory(Service, Characteristic, platformAccessory, accessoryConfig, log, isGrouped);
|
|
31
34
|
case AccessoryType.HumiditySensor:
|
|
32
35
|
return new HumiditySensorAccessory(Service, Characteristic, platformAccessory, accessoryConfig, log, isGrouped);
|
|
33
36
|
case AccessoryType.LeakSensor:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/accessory/abstract/helper.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,M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AAE,cAAc,EAAE,iBAAiB,EAAE,eAA2C,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;QAC1I,KAAK,aAAa,CAAC,KAAK;YACtB,OAAO,IAAI,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAsC,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IAChI,CAAC;IAED,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PlatformAccessory } from 'homebridge';
|
|
2
|
+
import { TemperatureControlAccessory } from './temperatureControl.js';
|
|
3
|
+
import { CharacteristicType, ActiveClimateConfig, ServiceType } from '../../model/types.js';
|
|
4
|
+
import { Log } from '../../tools/log.js';
|
|
5
|
+
export declare abstract class ActiveClimateAccessory<C extends ActiveClimateConfig = ActiveClimateConfig> extends TemperatureControlAccessory<C> {
|
|
6
|
+
constructor(Service: ServiceType, Characteristic: CharacteristicType, accessory: PlatformAccessory, config: C, log: Log, isGrouped: boolean);
|
|
7
|
+
private onSetActive;
|
|
8
|
+
private onSetLockControls;
|
|
9
|
+
private onSetRotationSpeed;
|
|
10
|
+
private onSetSwingMode;
|
|
11
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { TemperatureControlAccessory } from './temperatureControl.js';
|
|
2
|
+
import { strings } from '../../i18n/i18n.js';
|
|
3
|
+
import { CharacteristicKey } from '../../model/enums.js';
|
|
4
|
+
export class ActiveClimateAccessory extends TemperatureControlAccessory {
|
|
5
|
+
constructor(Service, Characteristic, accessory, config, log, isGrouped) {
|
|
6
|
+
super(Service, Characteristic, accessory, config, log, isGrouped);
|
|
7
|
+
this.setupCharacteristic(CharacteristicKey.Active, Characteristic.Active.INACTIVE, 'topicGetActive', this.bindOnUpdateNumericBoolean(CharacteristicKey.Active, 'valueStateActive', strings.heaterCooler.active, strings.heaterCooler.notActive), true, 'topicSetActive', this.onSetActive.bind(this));
|
|
8
|
+
this.setupCharacteristic(CharacteristicKey.LockPhysicalControls, Characteristic.LockPhysicalControls.CONTROL_LOCK_DISABLED, 'topicGetLockPhysicalControls', this.bindOnUpdateNumericBoolean(CharacteristicKey.LockPhysicalControls, 'valueControlLock', strings.heaterCooler.controlsLocked, strings.heaterCooler.controlsUnLocked), false, 'topicSetLockPhysicalControls', this.onSetLockControls.bind(this));
|
|
9
|
+
this.setupCharacteristic(CharacteristicKey.RotationSpeed, 0, 'topicGetRotationSpeed', this.bindOnUpdateNumeric(CharacteristicKey.RotationSpeed, strings.heaterCooler.rotationUpdate), false, 'topicSetRotationSpeed', this.onSetRotationSpeed.bind(this));
|
|
10
|
+
this.setupCharacteristic(CharacteristicKey.SwingMode, Characteristic.SwingMode.SWING_DISABLED, 'topicGetSwingMode', this.bindOnUpdateNumericBoolean(CharacteristicKey.SwingMode, 'valueSwingEnabled', strings.heaterCooler.swingEnabled, strings.heaterCooler.swingDisabled), false, 'topicSetSwingMode', this.onSetSwingMode.bind(this));
|
|
11
|
+
}
|
|
12
|
+
async onSetActive(value) {
|
|
13
|
+
if (!this.assert('valueStateActive', 'valueStateInactive')) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const active = value === this.Characteristic.Active.ACTIVE;
|
|
17
|
+
const logString = active ? strings.heaterCooler.activeSet : strings.heaterCooler.inactiveSet;
|
|
18
|
+
const publish = active ? this.config.valueStateActive : this.config.valueStateInactive;
|
|
19
|
+
this.onSet(CharacteristicKey.Active, value, publish, 'topicSetActive', logString);
|
|
20
|
+
}
|
|
21
|
+
async onSetLockControls(value) {
|
|
22
|
+
if (!this.assert('valueControlLock', 'valueControlUnlock')) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const lock = value === this.Characteristic.LockPhysicalControls.CONTROL_LOCK_ENABLED;
|
|
26
|
+
const logString = lock ? strings.heaterCooler.controlsLockFuture : strings.heaterCooler.controlsUnlockFuture;
|
|
27
|
+
const publish = lock ? this.config.valueControlLock : this.config.valueControlUnlock;
|
|
28
|
+
this.onSet(CharacteristicKey.LockPhysicalControls, value, publish, 'topicSetLockPhysicalControls', logString);
|
|
29
|
+
}
|
|
30
|
+
async onSetRotationSpeed(value) {
|
|
31
|
+
const logString = strings.heaterCooler.rotationSet.replace('%d', value.toString());
|
|
32
|
+
this.onSet(CharacteristicKey.RotationSpeed, value, value, 'topicSetRotationSpeed', logString);
|
|
33
|
+
}
|
|
34
|
+
async onSetSwingMode(value) {
|
|
35
|
+
if (!this.assert('valueSwingEnabled', 'valueSwingDisabled')) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const swing = value === this.Characteristic.SwingMode.SWING_ENABLED;
|
|
39
|
+
const logString = swing ? strings.heaterCooler.swingEnabledFuture : strings.heaterCooler.swingDisabledFuture;
|
|
40
|
+
const publish = swing ? this.config.valueSwingEnabled : this.config.valueSwingDisabled;
|
|
41
|
+
this.onSet(CharacteristicKey.SwingMode, value, publish, 'topicSetSwingMode', logString);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=active.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"active.js","sourceRoot":"","sources":["../../../src/accessory/climate/active.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAKzD,MAAM,OAAgB,sBAA4E,SAAQ,2BAA8B;IAEtI,YAAY,OAAoB,EAAE,cAAkC,EAAE,SAA4B,EAAE,MAAS,EAAE,GAAQ,EAAE,SAAkB;QACzI,KAAK,CAAC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC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AAC;QACvF,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,oBAAoB,EAAE,KAAK,EAAE,OAAO,EAAE,8BAA8B,EAAE,SAAS,CAAC,CAAC;IAChH,CAAC;IAEO,KAAK,CAAC,kBAAkB,CAAC,KAA0B;QACzD,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QACnF,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,aAAa,EAAE,KAAK,EAAE,KAAe,EAAE,uBAAuB,EAAE,SAAS,CAAC,CAAC;IAC1G,CAAC;IAEO,KAAK,CAAC,cAAc,CAAC,KAA0B;QAErD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,EAAE,CAAC;YAC5D,OAAO;QACT,CAAC;QAED,MAAM,KAAK,GAAG,KAAK,KAAK,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,aAAa,CAAC;QACpE,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,mBAAmB,CAAC;QAC7G,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAmB,CAAC;QACzF,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,SAAS,CAAC,CAAC;IAC1F,CAAC;CACF"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PlatformAccessory } from 'homebridge';
|
|
2
|
-
import {
|
|
2
|
+
import { ActiveClimateAccessory } from './active.js';
|
|
3
3
|
import { AccessoryType } from '../../model/enums.js';
|
|
4
4
|
import { CharacteristicType, ServiceType, HeaterCoolerConfig } from '../../model/types.js';
|
|
5
5
|
import { Log } from '../../tools/log.js';
|
|
6
|
-
export declare class HeaterCoolerAccessory extends
|
|
6
|
+
export declare class HeaterCoolerAccessory extends ActiveClimateAccessory<HeaterCoolerConfig> {
|
|
7
7
|
private readonly CURRENT_STATE_MAP;
|
|
8
8
|
private readonly TARGET_STATE_MAP;
|
|
9
9
|
constructor(Service: ServiceType, Characteristic: CharacteristicType, accessory: PlatformAccessory, config: HeaterCoolerConfig, log: Log, isGrouped: boolean);
|
|
@@ -11,10 +11,6 @@ export declare class HeaterCoolerAccessory extends ClimateControlAccessory<Heate
|
|
|
11
11
|
private onCurrentStateUpdate;
|
|
12
12
|
private onTargetStateUpdate;
|
|
13
13
|
private onSetTargetState;
|
|
14
|
-
private onSetActive;
|
|
15
|
-
private onSetLockControls;
|
|
16
|
-
private onSetRotationSpeed;
|
|
17
|
-
private onSetSwingMode;
|
|
18
14
|
private fromCVState;
|
|
19
15
|
private toCurrentCVState;
|
|
20
16
|
private toTargetCVState;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ActiveClimateAccessory } from './active.js';
|
|
2
2
|
import { strings } from '../../i18n/i18n.js';
|
|
3
3
|
import { AccessoryType, CharacteristicKey } from '../../model/enums.js';
|
|
4
|
-
export class HeaterCoolerAccessory extends
|
|
4
|
+
export class HeaterCoolerAccessory extends ActiveClimateAccessory {
|
|
5
5
|
CURRENT_STATE_MAP;
|
|
6
6
|
TARGET_STATE_MAP;
|
|
7
7
|
constructor(Service, Characteristic, accessory, config, log, isGrouped) {
|
|
8
8
|
super(Service, Characteristic, accessory, config, log, isGrouped);
|
|
9
|
+
this.setupTemperatureControlCharacteristics();
|
|
9
10
|
this.CURRENT_STATE_MAP = new Map([
|
|
10
11
|
['valueModeInactive', Characteristic.CurrentHeaterCoolerState.INACTIVE],
|
|
11
12
|
['valueModeIdle', Characteristic.CurrentHeaterCoolerState.IDLE],
|
|
@@ -31,10 +32,6 @@ export class HeaterCoolerAccessory extends ClimateControlAccessory {
|
|
|
31
32
|
}
|
|
32
33
|
this.setupCharacteristic(CharacteristicKey.TargetHeaterCoolerState, this.TARGET_STATE_MAP.get(validTargetStates[0]), 'topicGetTargetHeaterCoolerState', this.onTargetStateUpdate.bind(this), true, 'topicSetTargetHeaterCoolerState', this.onSetTargetState.bind(this))
|
|
33
34
|
?.setProps({ validValues: validTargetStates.map((key) => this.TARGET_STATE_MAP.get(key)) });
|
|
34
|
-
this.setupCharacteristic(CharacteristicKey.Active, Characteristic.Active.INACTIVE, 'topicGetHeaterCoolerActive', this.bindOnUpdateNumericBoolean(CharacteristicKey.Active, 'valueStateActive', strings.heaterCooler.active, strings.heaterCooler.notActive), true, 'topicSetHeaterCoolerActive', this.onSetActive.bind(this));
|
|
35
|
-
this.setupCharacteristic(CharacteristicKey.LockPhysicalControls, Characteristic.LockPhysicalControls.CONTROL_LOCK_DISABLED, 'topicGetLockPhysicalControls', this.bindOnUpdateNumericBoolean(CharacteristicKey.LockPhysicalControls, 'valueControlLock', strings.heaterCooler.controlsLocked, strings.heaterCooler.controlsUnLocked), false, 'topicSetLockPhysicalControls', this.onSetLockControls.bind(this));
|
|
36
|
-
this.setupCharacteristic(CharacteristicKey.RotationSpeed, 0, 'topicGetRotationSpeed', this.bindOnUpdateNumeric(CharacteristicKey.RotationSpeed, strings.heaterCooler.rotationUpdate), false, 'topicSetRotationSpeed', this.onSetRotationSpeed.bind(this));
|
|
37
|
-
this.setupCharacteristic(CharacteristicKey.SwingMode, Characteristic.SwingMode.SWING_DISABLED, 'topicGetSwingMode', this.bindOnUpdateNumericBoolean(CharacteristicKey.SwingMode, 'valueSwingEnabled', strings.heaterCooler.swingEnabled, strings.heaterCooler.swingDisabled), false, 'topicSetSwingMode', this.onSetSwingMode.bind(this));
|
|
38
35
|
}
|
|
39
36
|
getAccessoryType() {
|
|
40
37
|
return AccessoryType.HeaterCooler;
|
|
@@ -60,37 +57,6 @@ export class HeaterCoolerAccessory extends ClimateControlAccessory {
|
|
|
60
57
|
}
|
|
61
58
|
this.onSet(CharacteristicKey.TargetHeaterCoolerState, value, target, 'topicSetTargetHeaterCoolerState', this.stateStringForTargetCV(value));
|
|
62
59
|
}
|
|
63
|
-
async onSetActive(value) {
|
|
64
|
-
if (!this.assert('valueStateActive', 'valueStateInactive')) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
const active = value === this.Characteristic.Active.ACTIVE;
|
|
68
|
-
const logString = active ? strings.heaterCooler.activeSet : strings.heaterCooler.inactiveSet;
|
|
69
|
-
const publish = active ? this.config.valueStateActive : this.config.valueStateInactive;
|
|
70
|
-
this.onSet(CharacteristicKey.Active, value, publish, 'topicSetHeaterCoolerActive', logString);
|
|
71
|
-
}
|
|
72
|
-
async onSetLockControls(value) {
|
|
73
|
-
if (!this.assert('valueControlLock', 'valueControlUnlock')) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
const lock = value === this.Characteristic.LockPhysicalControls.CONTROL_LOCK_ENABLED;
|
|
77
|
-
const logString = lock ? strings.heaterCooler.controlsLockFuture : strings.heaterCooler.controlsUnlockFuture;
|
|
78
|
-
const publish = lock ? this.config.valueControlLock : this.config.valueControlUnlock;
|
|
79
|
-
this.onSet(CharacteristicKey.LockPhysicalControls, value, publish, 'topicSetLockPhysicalControls', logString);
|
|
80
|
-
}
|
|
81
|
-
async onSetRotationSpeed(value) {
|
|
82
|
-
const logString = strings.heaterCooler.rotationSet.replace('%d', value.toString());
|
|
83
|
-
this.onSet(CharacteristicKey.RotationSpeed, value, value, 'topicSetRotationSpeed', logString);
|
|
84
|
-
}
|
|
85
|
-
async onSetSwingMode(value) {
|
|
86
|
-
if (!this.assert('valueSwingEnabled', 'valueSwingDisabled')) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
const swing = value === this.Characteristic.SwingMode.SWING_ENABLED;
|
|
90
|
-
const logString = swing ? strings.heaterCooler.swingEnabledFuture : strings.heaterCooler.swingDisabledFuture;
|
|
91
|
-
const publish = swing ? this.config.valueSwingEnabled : this.config.valueSwingDisabled;
|
|
92
|
-
this.onSet(CharacteristicKey.SwingMode, value, publish, 'topicSetSwingMode', logString);
|
|
93
|
-
}
|
|
94
60
|
fromCVState(value) {
|
|
95
61
|
let primative = undefined;
|
|
96
62
|
this.TARGET_STATE_MAP.forEach((test, key) => {
|