homebridge-easy-mqtt 1.3.0-beta.2 → 1.3.0-beta.4
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 -1
- package/README.md +158 -106
- package/config.schema.json +579 -6
- package/dist/accessory/abstract/base.d.ts +0 -1
- package/dist/accessory/abstract/base.js +0 -19
- package/dist/accessory/abstract/base.js.map +1 -1
- package/dist/accessory/abstract/mqtt.d.ts +4 -1
- package/dist/accessory/abstract/mqtt.js +40 -3
- package/dist/accessory/abstract/mqtt.js.map +1 -1
- package/dist/accessory/lock.js +2 -2
- package/dist/accessory/lock.js.map +1 -1
- package/dist/accessory/onoff/lightbulb.js +4 -4
- package/dist/accessory/onoff/onoff.js +2 -2
- package/dist/accessory/security.js +7 -7
- package/dist/accessory/security.js.map +1 -1
- package/dist/accessory/sensor/carbonDioxide.d.ts +8 -0
- package/dist/accessory/sensor/carbonDioxide.js +15 -0
- package/dist/accessory/sensor/carbonDioxide.js.map +1 -0
- package/dist/accessory/sensor/carbonMonoxide.d.ts +8 -0
- package/dist/accessory/sensor/carbonMonoxide.js +15 -0
- package/dist/accessory/sensor/carbonMonoxide.js.map +1 -0
- package/dist/accessory/sensor/contact.d.ts +9 -0
- package/dist/accessory/sensor/contact.js +17 -0
- package/dist/accessory/sensor/contact.js.map +1 -0
- package/dist/accessory/sensor/humidity.d.ts +8 -0
- package/dist/accessory/sensor/humidity.js +13 -0
- package/dist/accessory/sensor/humidity.js.map +1 -0
- package/dist/accessory/sensor/leak.d.ts +8 -0
- package/dist/accessory/sensor/leak.js +13 -0
- package/dist/accessory/sensor/leak.js.map +1 -0
- package/dist/accessory/sensor/motion.d.ts +8 -0
- package/dist/accessory/sensor/motion.js +13 -0
- package/dist/accessory/sensor/motion.js.map +1 -0
- package/dist/accessory/sensor/occupancy.d.ts +8 -0
- package/dist/accessory/sensor/occupancy.js +13 -0
- package/dist/accessory/sensor/occupancy.js.map +1 -0
- package/dist/accessory/sensor/sensor.d.ts +9 -0
- package/dist/accessory/sensor/sensor.js +36 -0
- package/dist/accessory/sensor/sensor.js.map +1 -0
- package/dist/accessory/sensor/smoke.d.ts +8 -0
- package/dist/accessory/sensor/smoke.js +13 -0
- package/dist/accessory/sensor/smoke.js.map +1 -0
- package/dist/accessory/{temperatureSensor.d.ts → sensor/temperature.d.ts} +4 -5
- package/dist/accessory/sensor/temperature.js +13 -0
- package/dist/accessory/sensor/temperature.js.map +1 -0
- package/dist/accessory/thermostat.d.ts +19 -0
- package/dist/accessory/thermostat.js +116 -0
- package/dist/accessory/thermostat.js.map +1 -0
- package/dist/homebridge/platform.js +37 -1
- package/dist/homebridge/platform.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 +127 -27
- package/dist/i18n/en.js +171 -71
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/i18n.d.ts +127 -27
- package/dist/i18n/template.d.ts +127 -27
- package/dist/model/enums.d.ts +30 -2
- package/dist/model/enums.js +28 -0
- package/dist/model/enums.js.map +1 -1
- package/dist/model/types.d.ts +85 -27
- package/package.json +1 -1
- package/dist/accessory/temperatureSensor.js +0 -25
- package/dist/accessory/temperatureSensor.js.map +0 -1
package/config.schema.json
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"type": {
|
|
22
22
|
"type": "string",
|
|
23
23
|
"title": "${config.title.type}",
|
|
24
|
-
"enum": [ "Lightbulb", "LockMechanism", "Outlet", "SecuritySystem", "Switch", "TemperatureSensor"],
|
|
25
|
-
"enumNames": ["${config.enumNames.lightbulb}", "${config.enumNames.lockMechanism}", "${config.enumNames.outlet}", "${config.enumNames.securitySystem}", "${config.enumNames.switch}", "${config.enumNames.temperatureSensor}"],
|
|
24
|
+
"enum": [ "CarbonMonoxideSensor", "CarbonDioxideSensor", "ContactSensor", "HumiditySensor", "LeakSensor", "Lightbulb", "LockMechanism", "MotionSensor", "OccupancySensor", "Outlet", "SecuritySystem", "SmokeSensor", "Switch", "TemperatureSensor", "Thermostat"],
|
|
25
|
+
"enumNames": ["${config.enumNames.carbonMonoxideSensor}", "${config.enumNames.carbonDioxideSensor}", "${config.enumNames.contactSensor}", "${config.enumNames.humiditySensor}", "${config.enumNames.leakSensor}", "${config.enumNames.lightbulb}", "${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}"],
|
|
26
26
|
"required": true
|
|
27
27
|
},
|
|
28
28
|
"manufacturer": {
|
|
@@ -175,10 +175,6 @@
|
|
|
175
175
|
"type": "string",
|
|
176
176
|
"title": "${config.title.topicGetOutletInUse}"
|
|
177
177
|
},
|
|
178
|
-
"topicGetCurrentTemperature": {
|
|
179
|
-
"type": "string",
|
|
180
|
-
"title": "${config.title.topicGetCurrentTemperature}"
|
|
181
|
-
},
|
|
182
178
|
"topicGetCurrentSecurityState": {
|
|
183
179
|
"type": "string",
|
|
184
180
|
"title": "${config.title.topicGetCurrentSecurityState}"
|
|
@@ -199,6 +195,102 @@
|
|
|
199
195
|
"type": "string",
|
|
200
196
|
"title": "${config.title.topicGetStatusFault}"
|
|
201
197
|
},
|
|
198
|
+
"topicGetCarbonMonoxideDetected": {
|
|
199
|
+
"type": "string",
|
|
200
|
+
"title": "${config.title.topicGetCarbonMonoxideDetected}"
|
|
201
|
+
},
|
|
202
|
+
"topicGetCarbonMonoxideLevel": {
|
|
203
|
+
"type": "string",
|
|
204
|
+
"title": "${config.title.topicGetCarbonMonoxideLevel}"
|
|
205
|
+
},
|
|
206
|
+
"topicGetCarbonMonoxidePeakLevel": {
|
|
207
|
+
"type": "string",
|
|
208
|
+
"title": "${config.title.topicGetCarbonMonoxidePeakLevel}"
|
|
209
|
+
},
|
|
210
|
+
"topicGetCarbonDioxideDetected": {
|
|
211
|
+
"type": "string",
|
|
212
|
+
"title": "${config.title.topicGetCarbonDioxideDetected}"
|
|
213
|
+
},
|
|
214
|
+
"topicGetCarbonDioxideLevel": {
|
|
215
|
+
"type": "string",
|
|
216
|
+
"title": "${config.title.topicGetCarbonDioxideLevel}"
|
|
217
|
+
},
|
|
218
|
+
"topicGetCarbonDioxidePeakLevel": {
|
|
219
|
+
"type": "string",
|
|
220
|
+
"title": "${config.title.topicGetCarbonDioxidePeakLevel}"
|
|
221
|
+
},
|
|
222
|
+
"topicGetContactSensorState": {
|
|
223
|
+
"type": "string",
|
|
224
|
+
"title": "${config.title.topicGetContactSensorState}"
|
|
225
|
+
},
|
|
226
|
+
"topicGetCurrentRelativeHumidity": {
|
|
227
|
+
"type": "string",
|
|
228
|
+
"title": "${config.title.topicGetCurrentRelativeHumidity}"
|
|
229
|
+
},
|
|
230
|
+
"topicGetLeakDetected": {
|
|
231
|
+
"type": "string",
|
|
232
|
+
"title": "${config.title.topicGetLeakDetected}"
|
|
233
|
+
},
|
|
234
|
+
"topicGetMotionDetected": {
|
|
235
|
+
"type": "string",
|
|
236
|
+
"title": "${config.title.topicGetMotionDetected}"
|
|
237
|
+
},
|
|
238
|
+
"topicGetOccupancyDetected": {
|
|
239
|
+
"type": "string",
|
|
240
|
+
"title": "${config.title.topicGetOccupancyDetected}"
|
|
241
|
+
},
|
|
242
|
+
"topicGetSmokeDetected": {
|
|
243
|
+
"type": "string",
|
|
244
|
+
"title": "${config.title.topicGetSmokeDetected}"
|
|
245
|
+
},
|
|
246
|
+
"topicGetCurrentTemperature": {
|
|
247
|
+
"type": "string",
|
|
248
|
+
"title": "${config.title.topicGetCurrentTemperature}"
|
|
249
|
+
},
|
|
250
|
+
"topicGetCurrentHeatingCoolingState": {
|
|
251
|
+
"type": "string",
|
|
252
|
+
"title": "${config.title.topicGetCurrentHeatingCoolingState}"
|
|
253
|
+
},
|
|
254
|
+
"topicGetTargetHeatingCoolingState": {
|
|
255
|
+
"type": "string",
|
|
256
|
+
"title": "${config.title.topicGetTargetHeatingCoolingState}"
|
|
257
|
+
},
|
|
258
|
+
"topicSetTargetHeatingCoolingState": {
|
|
259
|
+
"type": "string",
|
|
260
|
+
"title": "${config.title.topicSetTargetHeatingCoolingState}"
|
|
261
|
+
},
|
|
262
|
+
"topicGetTargetTemperature": {
|
|
263
|
+
"type": "string",
|
|
264
|
+
"title": "${config.title.topicGetTargetTemperature}"
|
|
265
|
+
},
|
|
266
|
+
"topicSetTargetTemperature": {
|
|
267
|
+
"type": "string",
|
|
268
|
+
"title": "${config.title.topicSetTargetTemperature}"
|
|
269
|
+
},
|
|
270
|
+
"topicGetTargetRelativeHumidity": {
|
|
271
|
+
"type": "string",
|
|
272
|
+
"title": "${config.title.topicGetTargetRelativeHumidity}"
|
|
273
|
+
},
|
|
274
|
+
"topicSetTargetRelativeHumidity": {
|
|
275
|
+
"type": "string",
|
|
276
|
+
"title": "${config.title.topicSetTargetRelativeHumidity}"
|
|
277
|
+
},
|
|
278
|
+
"topicGetCoolingThresholdTemperature": {
|
|
279
|
+
"type": "string",
|
|
280
|
+
"title": "${config.title.topicGetCoolingThresholdTemperature}"
|
|
281
|
+
},
|
|
282
|
+
"topicSetCoolingThresholdTemperature": {
|
|
283
|
+
"type": "string",
|
|
284
|
+
"title": "${config.title.topicSetCoolingThresholdTemperature}"
|
|
285
|
+
},
|
|
286
|
+
"topicGetHeatingThresholdTemperature": {
|
|
287
|
+
"type": "string",
|
|
288
|
+
"title": "${config.title.topicGetHeatingThresholdTemperature}"
|
|
289
|
+
},
|
|
290
|
+
"topicSetHeatingThresholdTemperature": {
|
|
291
|
+
"type": "string",
|
|
292
|
+
"title": "${config.title.topicSetHeatingThresholdTemperature}"
|
|
293
|
+
},
|
|
202
294
|
"valueBatteryLow": {
|
|
203
295
|
"type": "string",
|
|
204
296
|
"title": "${config.title.valueBatteryLow}"
|
|
@@ -259,6 +351,50 @@
|
|
|
259
351
|
"type": "string",
|
|
260
352
|
"title": "${config.title.valueFault}"
|
|
261
353
|
},
|
|
354
|
+
"valueCarbonMonoxideDetected": {
|
|
355
|
+
"type": "string",
|
|
356
|
+
"title": "${config.title.valueCarbonMonoxideDetected}"
|
|
357
|
+
},
|
|
358
|
+
"valueCarbonDioxideDetected": {
|
|
359
|
+
"type": "string",
|
|
360
|
+
"title": "${config.title.valueCarbonDioxideDetected}"
|
|
361
|
+
},
|
|
362
|
+
"valueContactDetected": {
|
|
363
|
+
"type": "string",
|
|
364
|
+
"title": "${config.title.valueContactDetected}"
|
|
365
|
+
},
|
|
366
|
+
"valueLeakDetected": {
|
|
367
|
+
"type": "string",
|
|
368
|
+
"title": "${config.title.valueLeakDetected}"
|
|
369
|
+
},
|
|
370
|
+
"valueMotionDetected": {
|
|
371
|
+
"type": "string",
|
|
372
|
+
"title": "${config.title.valueMotionDetected}"
|
|
373
|
+
},
|
|
374
|
+
"valueOccupancyDetected": {
|
|
375
|
+
"type": "string",
|
|
376
|
+
"title": "${config.title.valueOccupancyDetected}"
|
|
377
|
+
},
|
|
378
|
+
"valueSmokeDetected": {
|
|
379
|
+
"type": "string",
|
|
380
|
+
"title": "${config.title.valueSmokeDetected}"
|
|
381
|
+
},
|
|
382
|
+
"valueModeAuto": {
|
|
383
|
+
"type": "string",
|
|
384
|
+
"title": "${config.title.valueModeAuto}"
|
|
385
|
+
},
|
|
386
|
+
"valueModeCool": {
|
|
387
|
+
"type": "string",
|
|
388
|
+
"title": "${config.title.valueModeCool}"
|
|
389
|
+
},
|
|
390
|
+
"valueModeHeat": {
|
|
391
|
+
"type": "string",
|
|
392
|
+
"title": "${config.title.valueModeHeat}"
|
|
393
|
+
},
|
|
394
|
+
"valueModeOff": {
|
|
395
|
+
"type": "string",
|
|
396
|
+
"title": "${config.title.valueModeOff}"
|
|
397
|
+
},
|
|
262
398
|
"disableLogging": {
|
|
263
399
|
"type": "boolean",
|
|
264
400
|
"title": "${config.title.disableLogging}"
|
|
@@ -519,6 +655,160 @@
|
|
|
519
655
|
}
|
|
520
656
|
]
|
|
521
657
|
},
|
|
658
|
+
{
|
|
659
|
+
"type": "fieldset",
|
|
660
|
+
"notitle": true,
|
|
661
|
+
"condition": {
|
|
662
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'CarbonDioxideSensor';"
|
|
663
|
+
},
|
|
664
|
+
"items": [
|
|
665
|
+
{
|
|
666
|
+
"type": "div",
|
|
667
|
+
"displayFlex": true,
|
|
668
|
+
"flex-direction": "row",
|
|
669
|
+
"items": [
|
|
670
|
+
{
|
|
671
|
+
"key": "accessories[].topicGetCarbonDioxideDetected",
|
|
672
|
+
"flex": "0 0 50%"
|
|
673
|
+
}
|
|
674
|
+
]
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
"type": "div",
|
|
678
|
+
"displayFlex": true,
|
|
679
|
+
"flex-direction": "row",
|
|
680
|
+
"items": [
|
|
681
|
+
{
|
|
682
|
+
"key": "accessories[].topicGetCarbonDioxideLevel",
|
|
683
|
+
"flex": "0 0 50%"
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
"key": "accessories[].topicGetCarbonDioxidePeakLevel",
|
|
687
|
+
"flex": "0 0 50%"
|
|
688
|
+
}
|
|
689
|
+
]
|
|
690
|
+
}
|
|
691
|
+
]
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
"type": "fieldset",
|
|
695
|
+
"notitle": true,
|
|
696
|
+
"condition": {
|
|
697
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'CarbonMonoxideSensor';"
|
|
698
|
+
},
|
|
699
|
+
"items": [
|
|
700
|
+
{
|
|
701
|
+
"type": "div",
|
|
702
|
+
"displayFlex": true,
|
|
703
|
+
"flex-direction": "row",
|
|
704
|
+
"items": [
|
|
705
|
+
{
|
|
706
|
+
"key": "accessories[].topicGetCarbonMonoxideDetected",
|
|
707
|
+
"flex": "0 0 50%"
|
|
708
|
+
}
|
|
709
|
+
]
|
|
710
|
+
},
|
|
711
|
+
{
|
|
712
|
+
"type": "div",
|
|
713
|
+
"displayFlex": true,
|
|
714
|
+
"flex-direction": "row",
|
|
715
|
+
"items": [
|
|
716
|
+
{
|
|
717
|
+
"key": "accessories[].topicGetCarbonMonoxideLevel",
|
|
718
|
+
"flex": "0 0 50%"
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
"key": "accessories[].topicGetCarbonMonoxidePeakLevel",
|
|
722
|
+
"flex": "0 0 50%"
|
|
723
|
+
}
|
|
724
|
+
]
|
|
725
|
+
}
|
|
726
|
+
]
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
"type": "div",
|
|
730
|
+
"displayFlex": true,
|
|
731
|
+
"flex-direction": "row",
|
|
732
|
+
"condition": {
|
|
733
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'ContactSensor';"
|
|
734
|
+
},
|
|
735
|
+
"items": [
|
|
736
|
+
{
|
|
737
|
+
"key": "accessories[].topicGetContactSensorState",
|
|
738
|
+
"flex": "0 0 50%"
|
|
739
|
+
}
|
|
740
|
+
]
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"type": "div",
|
|
744
|
+
"displayFlex": true,
|
|
745
|
+
"flex-direction": "row",
|
|
746
|
+
"condition": {
|
|
747
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'HumiditySensor';"
|
|
748
|
+
},
|
|
749
|
+
"items": [
|
|
750
|
+
{
|
|
751
|
+
"key": "accessories[].topicGetCurrentRelativeHumidity",
|
|
752
|
+
"flex": "0 0 50%"
|
|
753
|
+
}
|
|
754
|
+
]
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
"type": "div",
|
|
758
|
+
"displayFlex": true,
|
|
759
|
+
"flex-direction": "row",
|
|
760
|
+
"condition": {
|
|
761
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'LeakSensor';"
|
|
762
|
+
},
|
|
763
|
+
"items": [
|
|
764
|
+
{
|
|
765
|
+
"key": "accessories[].topicGetLeakDetected",
|
|
766
|
+
"flex": "0 0 50%"
|
|
767
|
+
}
|
|
768
|
+
]
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
"type": "div",
|
|
772
|
+
"displayFlex": true,
|
|
773
|
+
"flex-direction": "row",
|
|
774
|
+
"condition": {
|
|
775
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'MotionSensor';"
|
|
776
|
+
},
|
|
777
|
+
"items": [
|
|
778
|
+
{
|
|
779
|
+
"key": "accessories[].topicGetMotionDetected",
|
|
780
|
+
"flex": "0 0 50%"
|
|
781
|
+
}
|
|
782
|
+
]
|
|
783
|
+
},
|
|
784
|
+
{
|
|
785
|
+
"type": "div",
|
|
786
|
+
"displayFlex": true,
|
|
787
|
+
"flex-direction": "row",
|
|
788
|
+
"condition": {
|
|
789
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'OccupancySensor';"
|
|
790
|
+
},
|
|
791
|
+
"items": [
|
|
792
|
+
{
|
|
793
|
+
"key": "accessories[].topicGetOccupancyDetected",
|
|
794
|
+
"flex": "0 0 50%"
|
|
795
|
+
}
|
|
796
|
+
]
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
"type": "div",
|
|
800
|
+
"displayFlex": true,
|
|
801
|
+
"flex-direction": "row",
|
|
802
|
+
"condition": {
|
|
803
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'SmokeSensor';"
|
|
804
|
+
},
|
|
805
|
+
"items": [
|
|
806
|
+
{
|
|
807
|
+
"key": "accessories[].topicGetSmokeDetected",
|
|
808
|
+
"flex": "0 0 50%"
|
|
809
|
+
}
|
|
810
|
+
]
|
|
811
|
+
},
|
|
522
812
|
{
|
|
523
813
|
"type": "div",
|
|
524
814
|
"displayFlex": true,
|
|
@@ -538,6 +828,147 @@
|
|
|
538
828
|
}
|
|
539
829
|
]
|
|
540
830
|
},
|
|
831
|
+
{
|
|
832
|
+
"type": "fieldset",
|
|
833
|
+
"notitle": true,
|
|
834
|
+
"condition": {
|
|
835
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'Thermostat';"
|
|
836
|
+
},
|
|
837
|
+
"items": [
|
|
838
|
+
{
|
|
839
|
+
"type": "div",
|
|
840
|
+
"displayFlex": true,
|
|
841
|
+
"flex-direction": "row",
|
|
842
|
+
"items": [
|
|
843
|
+
{
|
|
844
|
+
"key": "accessories[].topicGetCurrentHeatingCoolingState",
|
|
845
|
+
"flex": "0 0 50%"
|
|
846
|
+
}
|
|
847
|
+
]
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
"type": "div",
|
|
851
|
+
"displayFlex": true,
|
|
852
|
+
"flex-direction": "row",
|
|
853
|
+
"items": [
|
|
854
|
+
{
|
|
855
|
+
"key": "accessories[].topicGetTargetHeatingCoolingState",
|
|
856
|
+
"flex": "0 0 50%"
|
|
857
|
+
},
|
|
858
|
+
{
|
|
859
|
+
"key": "accessories[].topicSetTargetHeatingCoolingState",
|
|
860
|
+
"flex": "0 0 50%"
|
|
861
|
+
}
|
|
862
|
+
]
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
"type": "div",
|
|
866
|
+
"displayFlex": true,
|
|
867
|
+
"flex-direction": "row",
|
|
868
|
+
"items": [
|
|
869
|
+
{
|
|
870
|
+
"key": "accessories[].topicGetCurrentTemperature",
|
|
871
|
+
"flex": "0 0 50%"
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
"key": "accessories[].temperatureUnits",
|
|
875
|
+
"title": "${config.title.sourceUnits}",
|
|
876
|
+
"flex": "0 0 33%"
|
|
877
|
+
}
|
|
878
|
+
]
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
"type": "div",
|
|
882
|
+
"displayFlex": true,
|
|
883
|
+
"flex-direction": "row",
|
|
884
|
+
"items": [
|
|
885
|
+
{
|
|
886
|
+
"key": "accessories[].topicGetTargetTemperature",
|
|
887
|
+
"flex": "0 0 50%"
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
"key": "accessories[].topicSetTargetTemperature",
|
|
891
|
+
"flex": "0 0 50%"
|
|
892
|
+
}
|
|
893
|
+
]
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
"type": "div",
|
|
897
|
+
"displayFlex": true,
|
|
898
|
+
"flex-direction": "row",
|
|
899
|
+
"items": [
|
|
900
|
+
{
|
|
901
|
+
"key": "accessories[].topicGetCurrentRelativeHumidity",
|
|
902
|
+
"title": "${config.title.topicGetCurrentRelativeHumidityOptional}",
|
|
903
|
+
"flex": "0 0 50%"
|
|
904
|
+
}
|
|
905
|
+
]
|
|
906
|
+
},
|
|
907
|
+
{
|
|
908
|
+
"type": "div",
|
|
909
|
+
"displayFlex": true,
|
|
910
|
+
"flex-direction": "row",
|
|
911
|
+
"items": [
|
|
912
|
+
{
|
|
913
|
+
"key": "accessories[].topicGetTargetRelativeHumidity",
|
|
914
|
+
"flex": "0 0 50%"
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
"key": "accessories[].topicSetTargetRelativeHumidity",
|
|
918
|
+
"flex": "0 0 50%"
|
|
919
|
+
}
|
|
920
|
+
]
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
"type": "div",
|
|
924
|
+
"displayFlex": true,
|
|
925
|
+
"flex-direction": "row",
|
|
926
|
+
"items": [
|
|
927
|
+
{
|
|
928
|
+
"key": "accessories[].topicGetCoolingThresholdTemperature",
|
|
929
|
+
"flex": "0 0 50%"
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
"key": "accessories[].topicSetCoolingThresholdTemperature",
|
|
933
|
+
"flex": "0 0 50%"
|
|
934
|
+
}
|
|
935
|
+
]
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
"type": "div",
|
|
939
|
+
"displayFlex": true,
|
|
940
|
+
"flex-direction": "row",
|
|
941
|
+
"items": [
|
|
942
|
+
{
|
|
943
|
+
"key": "accessories[].topicGetHeatingThresholdTemperature",
|
|
944
|
+
"flex": "0 0 50%"
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
"key": "accessories[].topicSetHeatingThresholdTemperature",
|
|
948
|
+
"flex": "0 0 50%"
|
|
949
|
+
}
|
|
950
|
+
]
|
|
951
|
+
}
|
|
952
|
+
]
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
"type": "div",
|
|
956
|
+
"displayFlex": true,
|
|
957
|
+
"flex-direction": "row",
|
|
958
|
+
"condition": {
|
|
959
|
+
"functionBody": "const type = model.accessories?.[arguments[1]]?.info?.type; return type !== undefined && type.endsWith('Sensor');"
|
|
960
|
+
},
|
|
961
|
+
"items": [
|
|
962
|
+
{
|
|
963
|
+
"key": "accessories[].topicGetStatusFault",
|
|
964
|
+
"flex": "0 0 50%"
|
|
965
|
+
},
|
|
966
|
+
{
|
|
967
|
+
"key": "accessories[].topicGetStatusTampered",
|
|
968
|
+
"flex": "0 0 50%"
|
|
969
|
+
}
|
|
970
|
+
]
|
|
971
|
+
},
|
|
541
972
|
{
|
|
542
973
|
"type": "div",
|
|
543
974
|
"displayFlex": true,
|
|
@@ -678,6 +1109,148 @@
|
|
|
678
1109
|
}
|
|
679
1110
|
]
|
|
680
1111
|
},
|
|
1112
|
+
{
|
|
1113
|
+
"type": "div",
|
|
1114
|
+
"displayFlex": true,
|
|
1115
|
+
"flex-direction": "row",
|
|
1116
|
+
"condition": {
|
|
1117
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'Thermostat';"
|
|
1118
|
+
},
|
|
1119
|
+
"items": [
|
|
1120
|
+
{
|
|
1121
|
+
"key": "accessories[].valueModeAuto",
|
|
1122
|
+
"flex": "0 0 25%"
|
|
1123
|
+
},
|
|
1124
|
+
{
|
|
1125
|
+
"key": "accessories[].valueModeCool",
|
|
1126
|
+
"flex": "0 0 25%"
|
|
1127
|
+
},
|
|
1128
|
+
{
|
|
1129
|
+
"key": "accessories[].valueModeHeat",
|
|
1130
|
+
"flex": "0 0 25%"
|
|
1131
|
+
},
|
|
1132
|
+
{
|
|
1133
|
+
"key": "accessories[].valueModeOff",
|
|
1134
|
+
"flex": "0 0 25%"
|
|
1135
|
+
}
|
|
1136
|
+
]
|
|
1137
|
+
},
|
|
1138
|
+
{
|
|
1139
|
+
"type": "div",
|
|
1140
|
+
"displayFlex": true,
|
|
1141
|
+
"flex-direction": "row",
|
|
1142
|
+
"condition": {
|
|
1143
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'CarbonDioxideSensor';"
|
|
1144
|
+
},
|
|
1145
|
+
"items": [
|
|
1146
|
+
{
|
|
1147
|
+
"key": "accessories[].valueCarbonDioxideDetected",
|
|
1148
|
+
"flex": "0 0 25%"
|
|
1149
|
+
}
|
|
1150
|
+
]
|
|
1151
|
+
},
|
|
1152
|
+
{
|
|
1153
|
+
"type": "div",
|
|
1154
|
+
"displayFlex": true,
|
|
1155
|
+
"flex-direction": "row",
|
|
1156
|
+
"condition": {
|
|
1157
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'CarbonMonoxideSensor';"
|
|
1158
|
+
},
|
|
1159
|
+
"items": [
|
|
1160
|
+
{
|
|
1161
|
+
"key": "accessories[].valueCarbonMonoxideDetected",
|
|
1162
|
+
"flex": "0 0 25%"
|
|
1163
|
+
}
|
|
1164
|
+
]
|
|
1165
|
+
},
|
|
1166
|
+
{
|
|
1167
|
+
"type": "div",
|
|
1168
|
+
"displayFlex": true,
|
|
1169
|
+
"flex-direction": "row",
|
|
1170
|
+
"condition": {
|
|
1171
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'ContactSensor';"
|
|
1172
|
+
},
|
|
1173
|
+
"items": [
|
|
1174
|
+
{
|
|
1175
|
+
"key": "accessories[].valueContactDetected",
|
|
1176
|
+
"flex": "0 0 25%"
|
|
1177
|
+
}
|
|
1178
|
+
]
|
|
1179
|
+
},
|
|
1180
|
+
{
|
|
1181
|
+
"type": "div",
|
|
1182
|
+
"displayFlex": true,
|
|
1183
|
+
"flex-direction": "row",
|
|
1184
|
+
"condition": {
|
|
1185
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'LeakSensor';"
|
|
1186
|
+
},
|
|
1187
|
+
"items": [
|
|
1188
|
+
{
|
|
1189
|
+
"key": "accessories[].valueLeakDetected",
|
|
1190
|
+
"flex": "0 0 25%"
|
|
1191
|
+
}
|
|
1192
|
+
]
|
|
1193
|
+
},
|
|
1194
|
+
{
|
|
1195
|
+
"type": "div",
|
|
1196
|
+
"displayFlex": true,
|
|
1197
|
+
"flex-direction": "row",
|
|
1198
|
+
"condition": {
|
|
1199
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'MotionSensor';"
|
|
1200
|
+
},
|
|
1201
|
+
"items": [
|
|
1202
|
+
{
|
|
1203
|
+
"key": "accessories[].valueMotionDetected",
|
|
1204
|
+
"flex": "0 0 25%"
|
|
1205
|
+
}
|
|
1206
|
+
]
|
|
1207
|
+
},
|
|
1208
|
+
{
|
|
1209
|
+
"type": "div",
|
|
1210
|
+
"displayFlex": true,
|
|
1211
|
+
"flex-direction": "row",
|
|
1212
|
+
"condition": {
|
|
1213
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'OccupancySensor';"
|
|
1214
|
+
},
|
|
1215
|
+
"items": [
|
|
1216
|
+
{
|
|
1217
|
+
"key": "accessories[].valueOccupancyDetected",
|
|
1218
|
+
"flex": "0 0 25%"
|
|
1219
|
+
}
|
|
1220
|
+
]
|
|
1221
|
+
},
|
|
1222
|
+
{
|
|
1223
|
+
"type": "div",
|
|
1224
|
+
"displayFlex": true,
|
|
1225
|
+
"flex-direction": "row",
|
|
1226
|
+
"condition": {
|
|
1227
|
+
"functionBody": "return model.accessories?.[arguments[1]]?.info?.type === 'SmokeSensor';"
|
|
1228
|
+
},
|
|
1229
|
+
"items": [
|
|
1230
|
+
{
|
|
1231
|
+
"key": "accessories[].valueSmokeDetected",
|
|
1232
|
+
"flex": "0 0 25%"
|
|
1233
|
+
}
|
|
1234
|
+
]
|
|
1235
|
+
},
|
|
1236
|
+
{
|
|
1237
|
+
"type": "div",
|
|
1238
|
+
"displayFlex": true,
|
|
1239
|
+
"flex-direction": "row",
|
|
1240
|
+
"condition": {
|
|
1241
|
+
"functionBody": "const type = model.accessories?.[arguments[1]]?.info?.type; return type !== undefined && type.endsWith('Sensor');"
|
|
1242
|
+
},
|
|
1243
|
+
"items": [
|
|
1244
|
+
{
|
|
1245
|
+
"key": "accessories[].valueFault",
|
|
1246
|
+
"flex": "0 0 25%"
|
|
1247
|
+
},
|
|
1248
|
+
{
|
|
1249
|
+
"key": "accessories[].valueTampered",
|
|
1250
|
+
"flex": "0 0 25%"
|
|
1251
|
+
}
|
|
1252
|
+
]
|
|
1253
|
+
},
|
|
681
1254
|
{
|
|
682
1255
|
"type": "div",
|
|
683
1256
|
"displayFlex": true,
|
|
@@ -4,7 +4,6 @@ import { CharacteristicType, BaseAccessoryConfig, ServiceType } from '../../mode
|
|
|
4
4
|
import { Log } from '../../tools/log.js';
|
|
5
5
|
export declare abstract class BaseAccessory<C extends BaseAccessoryConfig = BaseAccessoryConfig> extends MQTTAccessory<C> {
|
|
6
6
|
constructor(Service: ServiceType, Characteristic: CharacteristicType, accessory: PlatformAccessory, config: C, log: Log);
|
|
7
|
-
private handleCustomCharacteristics;
|
|
8
7
|
private onBatteryLowUpdate;
|
|
9
8
|
private onStatusActiveUpdate;
|
|
10
9
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { MQTTAccessory } from './mqtt.js';
|
|
2
|
-
import { CustomCharacteristic } from './customCharacteristic.js';
|
|
3
2
|
import { PLATFORM_NAME } from '../../homebridge/settings.js';
|
|
4
3
|
import { strings } from '../../i18n/i18n.js';
|
|
5
4
|
import { CharacteristicKey } from '../../model/enums.js';
|
|
@@ -18,24 +17,6 @@ export class BaseAccessory extends MQTTAccessory {
|
|
|
18
17
|
this.setupCharacteristic(CharacteristicKey.BatteryLevel, 100, 'topicGetBatteryLevel', this.bindOnUpdateNumeric(CharacteristicKey.BatteryLevel, strings.accessory.batteryLevel), false);
|
|
19
18
|
this.setupCharacteristic(CharacteristicKey.StatusLowBattery, false, 'topicGetBatteryLow', this.onBatteryLowUpdate.bind(this), false);
|
|
20
19
|
this.setupCharacteristic(CharacteristicKey.StatusActive, true, 'topicGetStatusActive', this.onStatusActiveUpdate.bind(this), false);
|
|
21
|
-
this.handleCustomCharacteristics();
|
|
22
|
-
}
|
|
23
|
-
handleCustomCharacteristics() {
|
|
24
|
-
const keepUUIDs = new Set(Object.values(CharacteristicKey).map((key) => this.Characteristic[key].UUID));
|
|
25
|
-
const toRemove = this.accessoryService.characteristics.filter((characteristic) => !keepUUIDs.has(characteristic.UUID));
|
|
26
|
-
for (const characteristic of toRemove) {
|
|
27
|
-
characteristic.updateValue(null);
|
|
28
|
-
this.accessoryService.removeCharacteristic(characteristic);
|
|
29
|
-
}
|
|
30
|
-
if (!this.config.customCharacteristics) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
for (const config of this.config.customCharacteristics) {
|
|
34
|
-
const customChar = CustomCharacteristic.create(this.accessoryService, this.Characteristic, config, this.name, this.log, this.config.disableLogging);
|
|
35
|
-
if (customChar !== undefined) {
|
|
36
|
-
this.addTopicHandler(customChar.topic, customChar.onUpdateHandler);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
20
|
}
|
|
40
21
|
async onBatteryLowUpdate(topic, value) {
|
|
41
22
|
const batteryLow = value === this.getPrimitiveValue('valueBatteryLow');
|