@switchbot/homebridge-switchbot 4.3.7 → 4.3.9
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 +1768 -0
- package/config.schema.json +239 -12
- package/dist/device/airpurifier.d.ts +45 -0
- package/dist/device/airpurifier.d.ts.map +1 -0
- package/dist/device/airpurifier.js +520 -0
- package/dist/device/airpurifier.js.map +1 -0
- package/dist/device/device.d.ts.map +1 -1
- package/dist/device/device.js +36 -0
- package/dist/device/device.js.map +1 -1
- package/dist/device/hub.d.ts.map +1 -1
- package/dist/device/hub.js +2 -0
- package/dist/device/hub.js.map +1 -1
- package/dist/platform.d.ts +1 -0
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +66 -0
- package/dist/platform.js.map +1 -1
- package/dist/settings.d.ts +5 -2
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +1 -0
- package/dist/settings.js.map +1 -1
- package/docs/variables/default.html +1 -1
- package/package.json +1 -1
- package/src/device/airpurifier.ts +561 -0
- package/src/device/device.ts +36 -0
- package/src/device/hub.ts +4 -0
- package/src/platform.ts +68 -0
- package/src/settings.ts +6 -2
package/config.schema.json
CHANGED
|
@@ -162,6 +162,12 @@
|
|
|
162
162
|
"Hub 2"
|
|
163
163
|
]
|
|
164
164
|
},
|
|
165
|
+
{
|
|
166
|
+
"title": "Hub 3",
|
|
167
|
+
"enum": [
|
|
168
|
+
"Hub 3"
|
|
169
|
+
]
|
|
170
|
+
},
|
|
165
171
|
{
|
|
166
172
|
"title": "Humidifier",
|
|
167
173
|
"enum": [
|
|
@@ -601,14 +607,14 @@
|
|
|
601
607
|
"title": "Hide Temperature Sensor",
|
|
602
608
|
"type": "boolean",
|
|
603
609
|
"condition": {
|
|
604
|
-
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Humidifier' || model.options.devices[arrayIndices].configDeviceType === 'Humidifier2' || model.options.devices[arrayIndices].configDeviceType === 'WoIOSensor' || model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro(CO2)') && model.options.devices[arrayIndices].deviceId);"
|
|
610
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Hub 3' || model.options.devices[arrayIndices].configDeviceType === 'Humidifier' || model.options.devices[arrayIndices].configDeviceType === 'Humidifier2' || model.options.devices[arrayIndices].configDeviceType === 'WoIOSensor' || model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro(CO2)') && model.options.devices[arrayIndices].deviceId);"
|
|
605
611
|
}
|
|
606
612
|
},
|
|
607
613
|
"convertUnitTo": {
|
|
608
614
|
"title": "Convert Temperature Unit To",
|
|
609
615
|
"type": "string",
|
|
610
616
|
"condition": {
|
|
611
|
-
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Humidifier' || model.options.devices[arrayIndices].configDeviceType === 'Humidifier2' || model.options.devices[arrayIndices].configDeviceType === 'WoIOSensor' || model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro(CO2)') && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_temperature);"
|
|
617
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Hub 3' || model.options.devices[arrayIndices].configDeviceType === 'Humidifier' || model.options.devices[arrayIndices].configDeviceType === 'Humidifier2' || model.options.devices[arrayIndices].configDeviceType === 'WoIOSensor' || model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro(CO2)') && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_temperature);"
|
|
612
618
|
},
|
|
613
619
|
"oneOf": [
|
|
614
620
|
{
|
|
@@ -629,14 +635,14 @@
|
|
|
629
635
|
"title": "Hide Humidity Sensor",
|
|
630
636
|
"type": "boolean",
|
|
631
637
|
"condition": {
|
|
632
|
-
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'WoIOSensor' || model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro(CO2)') && model.options.devices[arrayIndices].deviceId);"
|
|
638
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Hub 3' || model.options.devices[arrayIndices].configDeviceType === 'WoIOSensor' || model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro(CO2)') && model.options.devices[arrayIndices].deviceId);"
|
|
633
639
|
}
|
|
634
640
|
},
|
|
635
641
|
"hide_lightsensor": {
|
|
636
642
|
"title": "Hide Light Sensor",
|
|
637
643
|
"type": "boolean",
|
|
638
644
|
"condition": {
|
|
639
|
-
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Contact Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Motion Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Presence Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Blind Tilt' || model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Curtain3' || model.options.devices[arrayIndices].configDeviceType === 'WoRollerShade' || model.options.devices[arrayIndices].configDeviceType === 'Roller Shade') && model.options.devices[arrayIndices].deviceId);"
|
|
645
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Hub 3' || model.options.devices[arrayIndices].configDeviceType === 'Contact Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Motion Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Presence Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Blind Tilt' || model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Curtain3' || model.options.devices[arrayIndices].configDeviceType === 'WoRollerShade' || model.options.devices[arrayIndices].configDeviceType === 'Roller Shade') && model.options.devices[arrayIndices].deviceId);"
|
|
640
646
|
}
|
|
641
647
|
},
|
|
642
648
|
"hide_motionsensor": {
|
|
@@ -713,7 +719,7 @@
|
|
|
713
719
|
"placeholder": "0",
|
|
714
720
|
"description": "Sets the minimum percentage before needed to set to Open.",
|
|
715
721
|
"condition": {
|
|
716
|
-
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Blind Tilt' || model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Curtain3' || model.options.devices[arrayIndices].configDeviceType === 'WoRollerShade' || model.options.devices[arrayIndices].configDeviceType === 'Roller Shade' || model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Motion Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Contact Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Humidifier' || model.options.devices[arrayIndices].configDeviceType === 'Humidifier2' || model.options.devices[arrayIndices].configDeviceType === 'Strip Light' || model.options.devices[arrayIndices].configDeviceType === 'Ceiling Light' || model.options.devices[arrayIndices].configDeviceType === 'Ceiling Light Pro') && model.options.devices[arrayIndices].deviceId);"
|
|
722
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Blind Tilt' || model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Curtain3' || model.options.devices[arrayIndices].configDeviceType === 'WoRollerShade' || model.options.devices[arrayIndices].configDeviceType === 'Roller Shade' || model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Hub 3' || model.options.devices[arrayIndices].configDeviceType === 'Motion Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Contact Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Humidifier' || model.options.devices[arrayIndices].configDeviceType === 'Humidifier2' || model.options.devices[arrayIndices].configDeviceType === 'Strip Light' || model.options.devices[arrayIndices].configDeviceType === 'Ceiling Light' || model.options.devices[arrayIndices].configDeviceType === 'Ceiling Light Pro') && model.options.devices[arrayIndices].deviceId);"
|
|
717
723
|
}
|
|
718
724
|
},
|
|
719
725
|
"set_max": {
|
|
@@ -722,7 +728,7 @@
|
|
|
722
728
|
"placeholder": "100",
|
|
723
729
|
"description": "Sets the maximum percentage before needing to set to Closed.",
|
|
724
730
|
"condition": {
|
|
725
|
-
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Blind Tilt' || model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Curtain3' || model.options.devices[arrayIndices].configDeviceType === 'WoRollerShade' || model.options.devices[arrayIndices].configDeviceType === 'Roller Shade' || model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Motion Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Contact Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Humidifier' || model.options.devices[arrayIndices].configDeviceType === 'Humidifier2' || model.options.devices[arrayIndices].configDeviceType === 'Strip Light' || model.options.devices[arrayIndices].configDeviceType === 'Ceiling Light' || model.options.devices[arrayIndices].configDeviceType === 'Ceiling Light Pro') && model.options.devices[arrayIndices].deviceId);"
|
|
731
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Blind Tilt' || model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Curtain3' || model.options.devices[arrayIndices].configDeviceType === 'WoRollerShade' || model.options.devices[arrayIndices].configDeviceType === 'Roller Shade' || model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Hub 3' || model.options.devices[arrayIndices].configDeviceType === 'Motion Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Contact Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Humidifier' || model.options.devices[arrayIndices].configDeviceType === 'Humidifier2' || model.options.devices[arrayIndices].configDeviceType === 'Strip Light' || model.options.devices[arrayIndices].configDeviceType === 'Ceiling Light' || model.options.devices[arrayIndices].configDeviceType === 'Ceiling Light Pro') && model.options.devices[arrayIndices].deviceId);"
|
|
726
732
|
}
|
|
727
733
|
},
|
|
728
734
|
"set_minlux": {
|
|
@@ -730,7 +736,7 @@
|
|
|
730
736
|
"type": "number",
|
|
731
737
|
"placeholder": "1",
|
|
732
738
|
"condition": {
|
|
733
|
-
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Contact Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Motion Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Presence Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Blind Tilt' || model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Curtain3' || model.options.devices[arrayIndices].configDeviceType === 'WoRollerShade' || model.options.devices[arrayIndices].configDeviceType === 'Roller Shade') && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_lightsensor);"
|
|
739
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Hub 3' || model.options.devices[arrayIndices].configDeviceType === 'Contact Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Motion Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Presence Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Blind Tilt' || model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Curtain3' || model.options.devices[arrayIndices].configDeviceType === 'WoRollerShade' || model.options.devices[arrayIndices].configDeviceType === 'Roller Shade') && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_lightsensor);"
|
|
734
740
|
}
|
|
735
741
|
},
|
|
736
742
|
"set_maxlux": {
|
|
@@ -738,7 +744,7 @@
|
|
|
738
744
|
"type": "number",
|
|
739
745
|
"placeholder": "6001",
|
|
740
746
|
"condition": {
|
|
741
|
-
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Contact Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Motion Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Presence Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Blind Tilt' || model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Curtain3' || model.options.devices[arrayIndices].configDeviceType === 'WoRollerShade' || model.options.devices[arrayIndices].configDeviceType === 'Roller Shade') && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_lightsensor);"
|
|
747
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Hub 3' || model.options.devices[arrayIndices].configDeviceType === 'Contact Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Motion Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Presence Sensor' || model.options.devices[arrayIndices].configDeviceType === 'Blind Tilt' || model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Curtain3' || model.options.devices[arrayIndices].configDeviceType === 'WoRollerShade' || model.options.devices[arrayIndices].configDeviceType === 'Roller Shade') && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_lightsensor);"
|
|
742
748
|
}
|
|
743
749
|
},
|
|
744
750
|
"setOpenMode": {
|
|
@@ -819,28 +825,28 @@
|
|
|
819
825
|
"type": "string",
|
|
820
826
|
"placeholder": "192.168.7.1",
|
|
821
827
|
"condition": {
|
|
822
|
-
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].deviceId && (model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Water Detector' || model.options.devices[arrayIndices].configDeviceType === 'WoIOSensor' || model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro(CO2)'));"
|
|
828
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].deviceId && (model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Water Detector' || model.options.devices[arrayIndices].configDeviceType === 'WoIOSensor' || model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Hub 3' || model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro(CO2)'));"
|
|
823
829
|
}
|
|
824
830
|
},
|
|
825
831
|
"mqttOptions": {
|
|
826
832
|
"title": "MQTT Options (Device Specific)",
|
|
827
833
|
"type": "string",
|
|
828
834
|
"condition": {
|
|
829
|
-
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].deviceId && model.options.devices[arrayIndices].mqttURL && (model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Water Detector' || model.options.devices[arrayIndices].configDeviceType === 'WoIOSensor' || model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro(CO2)'));"
|
|
835
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].deviceId && model.options.devices[arrayIndices].mqttURL && (model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Water Detector' || model.options.devices[arrayIndices].configDeviceType === 'WoIOSensor' || model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Hub 3' || model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro(CO2)'));"
|
|
830
836
|
}
|
|
831
837
|
},
|
|
832
838
|
"mqttPubOptions": {
|
|
833
839
|
"title": "MQTT Pub Options (Device Specific)",
|
|
834
840
|
"type": "string",
|
|
835
841
|
"condition": {
|
|
836
|
-
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].deviceId && model.options.devices[arrayIndices].mqttURL && (model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Water Detector' || model.options.devices[arrayIndices].configDeviceType === 'WoIOSensor' || model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro(CO2)'));"
|
|
842
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].deviceId && model.options.devices[arrayIndices].mqttURL && (model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Water Detector' || model.options.devices[arrayIndices].configDeviceType === 'WoIOSensor' || model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Hub 3' || model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro(CO2)'));"
|
|
837
843
|
}
|
|
838
844
|
},
|
|
839
845
|
"history": {
|
|
840
846
|
"title": "EVE History",
|
|
841
847
|
"type": "boolean",
|
|
842
848
|
"condition": {
|
|
843
|
-
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].deviceId && (model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Water Detector' || model.options.devices[arrayIndices].configDeviceType === 'WoIOSensor' || model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro(CO2)'));"
|
|
849
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].deviceId && (model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Water Detector' || model.options.devices[arrayIndices].configDeviceType === 'WoIOSensor' || model.options.devices[arrayIndices].configDeviceType === 'Hub 2' || model.options.devices[arrayIndices].configDeviceType === 'Hub 3' || model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro' || model.options.devices[arrayIndices].configDeviceType === 'MeterPro(CO2)'));"
|
|
844
850
|
}
|
|
845
851
|
},
|
|
846
852
|
"offline": {
|
|
@@ -1370,6 +1376,227 @@
|
|
|
1370
1376
|
}
|
|
1371
1377
|
}
|
|
1372
1378
|
},
|
|
1379
|
+
"Hub 3": {
|
|
1380
|
+
"type": "object",
|
|
1381
|
+
"properties": {
|
|
1382
|
+
"hide_device": {
|
|
1383
|
+
"title": "Hide All Hub 3s",
|
|
1384
|
+
"type": "boolean",
|
|
1385
|
+
"description": "If true, device will be removed or hidden from HomeKit."
|
|
1386
|
+
},
|
|
1387
|
+
"hide_temperature": {
|
|
1388
|
+
"title": "Hide Temperature Sensor",
|
|
1389
|
+
"type": "boolean",
|
|
1390
|
+
"condition": {
|
|
1391
|
+
"functionBody": "return (model.options && model.options.deviceConfig && model.options.deviceConfig['Hub 3'] && !model.options.deviceConfig['Hub 3'].hide_device);"
|
|
1392
|
+
}
|
|
1393
|
+
},
|
|
1394
|
+
"convertUnitTo": {
|
|
1395
|
+
"title": "Convert Temperature Unit To",
|
|
1396
|
+
"type": "string",
|
|
1397
|
+
"condition": {
|
|
1398
|
+
"functionBody": "return (model.options && model.options.deviceConfig && model.options.deviceConfig['Hub 3'] && !model.options.deviceConfig['Hub 3'].hide_device);"
|
|
1399
|
+
},
|
|
1400
|
+
"oneOf": [
|
|
1401
|
+
{
|
|
1402
|
+
"title": "Celsius",
|
|
1403
|
+
"enum": [
|
|
1404
|
+
"CELSIUS"
|
|
1405
|
+
]
|
|
1406
|
+
},
|
|
1407
|
+
{
|
|
1408
|
+
"title": "Fahrenheit",
|
|
1409
|
+
"enum": [
|
|
1410
|
+
"FAHRENHEIT"
|
|
1411
|
+
]
|
|
1412
|
+
}
|
|
1413
|
+
]
|
|
1414
|
+
},
|
|
1415
|
+
"hide_humidity": {
|
|
1416
|
+
"title": "Hide Humidity Sensor",
|
|
1417
|
+
"type": "boolean",
|
|
1418
|
+
"condition": {
|
|
1419
|
+
"functionBody": "return (model.options && model.options.deviceConfig && model.options.deviceConfig['Hub 3'] && !model.options.deviceConfig['Hub 3'].hide_device);"
|
|
1420
|
+
}
|
|
1421
|
+
},
|
|
1422
|
+
"connectionType": {
|
|
1423
|
+
"title": "Connection Type",
|
|
1424
|
+
"type": "string",
|
|
1425
|
+
"description": "Bluetooth (BLE) API is only available on certain Device Types, see the Wiki for more information.",
|
|
1426
|
+
"condition": {
|
|
1427
|
+
"functionBody": "return (model.options && model.options.deviceConfig && model.options.deviceConfig['Hub 3'] && !model.options.deviceConfig['Hub 3'].hide_device);"
|
|
1428
|
+
},
|
|
1429
|
+
"oneOf": [
|
|
1430
|
+
{
|
|
1431
|
+
"title": "BLE",
|
|
1432
|
+
"enum": [
|
|
1433
|
+
"BLE"
|
|
1434
|
+
]
|
|
1435
|
+
},
|
|
1436
|
+
{
|
|
1437
|
+
"title": "BLE/OpenAPI",
|
|
1438
|
+
"enum": [
|
|
1439
|
+
"BLE/OpenAPI"
|
|
1440
|
+
]
|
|
1441
|
+
},
|
|
1442
|
+
{
|
|
1443
|
+
"title": "Disable",
|
|
1444
|
+
"enum": [
|
|
1445
|
+
"Disabled"
|
|
1446
|
+
]
|
|
1447
|
+
},
|
|
1448
|
+
{
|
|
1449
|
+
"title": "OpenAPI",
|
|
1450
|
+
"enum": [
|
|
1451
|
+
"OpenAPI"
|
|
1452
|
+
]
|
|
1453
|
+
}
|
|
1454
|
+
]
|
|
1455
|
+
},
|
|
1456
|
+
"disablePlatformBLE": {
|
|
1457
|
+
"title": "Disable Platform BLE",
|
|
1458
|
+
"type": "boolean",
|
|
1459
|
+
"condition": {
|
|
1460
|
+
"functionBody": "return (model.options && model.options.deviceConfig && model.options.deviceConfig['Hub 3'] && !model.options.deviceConfig['Hub 3'].hide_device && model.options.deviceConfig['Hub 3'].connectionType !== 'Disabled');"
|
|
1461
|
+
}
|
|
1462
|
+
},
|
|
1463
|
+
"scanDuration": {
|
|
1464
|
+
"title": "Scan Duration (Default is 1 Second) for BLE",
|
|
1465
|
+
"type": "number",
|
|
1466
|
+
"placeholder": 1,
|
|
1467
|
+
"condition": {
|
|
1468
|
+
"functionBody": "return (model.options && model.options.deviceConfig && model.options.deviceConfig['Hub 3'] && !model.options.deviceConfig['Hub 3'].hide_device && (model.options.deviceConfig['Hub 3'].connectionType === 'BLE' || model.options.deviceConfig['Hub 3'].connectionType === 'BLE/OpenAPI'));"
|
|
1469
|
+
}
|
|
1470
|
+
},
|
|
1471
|
+
"webhook": {
|
|
1472
|
+
"title": "Enable Webhook for all Hub 3s",
|
|
1473
|
+
"type": "boolean",
|
|
1474
|
+
"condition": {
|
|
1475
|
+
"functionBody": "return (model.options && model.options.deviceConfig && model.options.deviceConfig['Hub 3'] && !model.options.deviceConfig['Hub 3'].hide_device && (model.options.deviceConfig['Hub 3'].connectionType === 'OpenAPI' || model.options.deviceConfig['Hub 3'].connectionType === 'BLE/OpenAPI'));"
|
|
1476
|
+
}
|
|
1477
|
+
},
|
|
1478
|
+
"external": {
|
|
1479
|
+
"title": "External Accessory",
|
|
1480
|
+
"type": "boolean",
|
|
1481
|
+
"condition": {
|
|
1482
|
+
"functionBody": "return (model.options && model.options.deviceConfig && model.options.deviceConfig['Hub 3'] && !model.options.deviceConfig['Hub 3'].hide_device);"
|
|
1483
|
+
}
|
|
1484
|
+
},
|
|
1485
|
+
"maxRetry": {
|
|
1486
|
+
"title": "Max Retries for BLE",
|
|
1487
|
+
"type": "number",
|
|
1488
|
+
"placeholder": "5",
|
|
1489
|
+
"condition": {
|
|
1490
|
+
"functionBody": "return (model.options && model.options.deviceConfig && model.options.deviceConfig['Hub 3'] && !model.options.deviceConfig['Hub 3'].hide_device && (model.options.deviceConfig['Hub 3'].connectionType === 'BLE' || model.options.deviceConfig['Hub 3'].connectionType === 'BLE/OpenAPI'));"
|
|
1491
|
+
}
|
|
1492
|
+
},
|
|
1493
|
+
"maxRetries": {
|
|
1494
|
+
"title": "Device Max Retries for OpenAPI",
|
|
1495
|
+
"type": "number",
|
|
1496
|
+
"placeholder": 5,
|
|
1497
|
+
"condition": {
|
|
1498
|
+
"functionBody": "return (model.options && model.options.deviceConfig && model.options.deviceConfig['Hub 3'] && !model.options.deviceConfig['Hub 3'].hide_device && (model.options.deviceConfig['Hub 3'].connectionType === 'OpenAPI' || model.options.deviceConfig['Hub 3'].connectionType === 'BLE/OpenAPI'));"
|
|
1499
|
+
}
|
|
1500
|
+
},
|
|
1501
|
+
"delayBetweenRetries": {
|
|
1502
|
+
"title": "Device Delay Between Retries for OpenAPI (In Seconds)",
|
|
1503
|
+
"type": "number",
|
|
1504
|
+
"placeholder": 3,
|
|
1505
|
+
"condition": {
|
|
1506
|
+
"functionBody": "return (model.options && model.options.deviceConfig && model.options.deviceConfig['Hub 3'] && !model.options.deviceConfig['Hub 3'].hide_device && (model.options.deviceConfig['Hub 3'].connectionType === 'OpenAPI' || model.options.deviceConfig['Hub 3'].connectionType === 'BLE/OpenAPI'));"
|
|
1507
|
+
}
|
|
1508
|
+
},
|
|
1509
|
+
"disableCaching": {
|
|
1510
|
+
"title": "Disable Caching",
|
|
1511
|
+
"type": "boolean",
|
|
1512
|
+
"condition": {
|
|
1513
|
+
"functionBody": "return (model.options && model.options.deviceConfig && model.options.deviceConfig['Hub 3'] && !model.options.deviceConfig['Hub 3'].hide_device);"
|
|
1514
|
+
}
|
|
1515
|
+
},
|
|
1516
|
+
"offline": {
|
|
1517
|
+
"title": "Offline as Off",
|
|
1518
|
+
"type": "boolean",
|
|
1519
|
+
"condition": {
|
|
1520
|
+
"functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Hub 3'].hide_device);"
|
|
1521
|
+
}
|
|
1522
|
+
},
|
|
1523
|
+
"history": {
|
|
1524
|
+
"title": "EVE History",
|
|
1525
|
+
"type": "boolean",
|
|
1526
|
+
"condition": {
|
|
1527
|
+
"functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Hub 3'].hide_device);"
|
|
1528
|
+
}
|
|
1529
|
+
},
|
|
1530
|
+
"firmware": {
|
|
1531
|
+
"title": "Firmware Override",
|
|
1532
|
+
"type": "string",
|
|
1533
|
+
"placeholder": "1.2.8",
|
|
1534
|
+
"condition": {
|
|
1535
|
+
"functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Hub 3'].hide_device);"
|
|
1536
|
+
}
|
|
1537
|
+
},
|
|
1538
|
+
"logging": {
|
|
1539
|
+
"title": "Logging by Device Type",
|
|
1540
|
+
"type": "string",
|
|
1541
|
+
"default": "",
|
|
1542
|
+
"condition": {
|
|
1543
|
+
"functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Hub 3'].hide_device);"
|
|
1544
|
+
},
|
|
1545
|
+
"oneOf": [
|
|
1546
|
+
{
|
|
1547
|
+
"title": "Debug Logging",
|
|
1548
|
+
"enum": [
|
|
1549
|
+
"debug"
|
|
1550
|
+
]
|
|
1551
|
+
},
|
|
1552
|
+
{
|
|
1553
|
+
"title": "Default Logging",
|
|
1554
|
+
"enum": [
|
|
1555
|
+
""
|
|
1556
|
+
]
|
|
1557
|
+
},
|
|
1558
|
+
{
|
|
1559
|
+
"title": "No Logging",
|
|
1560
|
+
"enum": [
|
|
1561
|
+
"none"
|
|
1562
|
+
]
|
|
1563
|
+
},
|
|
1564
|
+
{
|
|
1565
|
+
"title": "Standard Logging",
|
|
1566
|
+
"enum": [
|
|
1567
|
+
"standard"
|
|
1568
|
+
]
|
|
1569
|
+
}
|
|
1570
|
+
]
|
|
1571
|
+
},
|
|
1572
|
+
"refreshRate": {
|
|
1573
|
+
"title": "Device Refresh Rate",
|
|
1574
|
+
"type": "number",
|
|
1575
|
+
"placeholder": 5,
|
|
1576
|
+
"condition": {
|
|
1577
|
+
"functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Hub 3'].hide_device);"
|
|
1578
|
+
}
|
|
1579
|
+
},
|
|
1580
|
+
"updateRate": {
|
|
1581
|
+
"title": "Update Rate",
|
|
1582
|
+
"type": "number",
|
|
1583
|
+
"minimum": 1,
|
|
1584
|
+
"placeholder": 5,
|
|
1585
|
+
"description": "Indicates the number of seconds before refreshing status while updating progress.",
|
|
1586
|
+
"condition": {
|
|
1587
|
+
"functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Hub 3'].hide_device);"
|
|
1588
|
+
}
|
|
1589
|
+
},
|
|
1590
|
+
"pushRate": {
|
|
1591
|
+
"title": "Device Push Rate",
|
|
1592
|
+
"type": "number",
|
|
1593
|
+
"placeholder": 360,
|
|
1594
|
+
"condition": {
|
|
1595
|
+
"functionBody": "return (model.options && model.options.deviceConfig && !model.options.deviceConfig['Hub 3'].hide_device);"
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
},
|
|
1373
1600
|
"Bot": {
|
|
1374
1601
|
"type": "object",
|
|
1375
1602
|
"properties": {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { CharacteristicValue, PlatformAccessory } from 'homebridge';
|
|
2
|
+
import type { airPurifierServiceData, airPurifierStatus, device } from 'node-switchbot';
|
|
3
|
+
import { Subject } from 'rxjs';
|
|
4
|
+
import type { SwitchBotPlatform } from '../platform.js';
|
|
5
|
+
import type { devicesConfig } from '../settings.js';
|
|
6
|
+
import { deviceBase } from './device.js';
|
|
7
|
+
export declare class AirPurifier extends deviceBase {
|
|
8
|
+
readonly platform: SwitchBotPlatform;
|
|
9
|
+
private AirPurifier;
|
|
10
|
+
private AirQualitySensor?;
|
|
11
|
+
deviceStatus: airPurifierStatus;
|
|
12
|
+
serviceData: airPurifierServiceData;
|
|
13
|
+
airPurifierUpdateInProgress: boolean;
|
|
14
|
+
doAirPurifierUpdate: Subject<void>;
|
|
15
|
+
constructor(platform: SwitchBotPlatform, accessory: PlatformAccessory, device: device & devicesConfig);
|
|
16
|
+
BLEparseStatus(): Promise<void>;
|
|
17
|
+
openAPIparseStatus(): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Asks the SwitchBot API for the latest device information
|
|
20
|
+
*/
|
|
21
|
+
refreshStatus(): Promise<void>;
|
|
22
|
+
BLERefreshStatus(): Promise<void>;
|
|
23
|
+
registerPlatformBLE(): Promise<void>;
|
|
24
|
+
openAPIRefreshStatus(): Promise<void>;
|
|
25
|
+
registerWebhook(): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Pushes the requested changes to the SwitchBot API
|
|
28
|
+
* commandType command parameter Description
|
|
29
|
+
* "command" "turnOff" "default" = set to OFF state
|
|
30
|
+
* "command" "turnOn" "default" = set to ON state
|
|
31
|
+
* "command" "setMode" "{0-3}" = 0 for auto, 1 for low, 2 for medium, 3 for high
|
|
32
|
+
*/
|
|
33
|
+
pushChanges(): Promise<void>;
|
|
34
|
+
BLEpushChanges(): Promise<void>;
|
|
35
|
+
openAPIpushChanges(): Promise<void>;
|
|
36
|
+
updateHomeKitCharacteristics(): Promise<void>;
|
|
37
|
+
ActiveSet(value: CharacteristicValue): Promise<void>;
|
|
38
|
+
RotationSpeedSet(value: CharacteristicValue): Promise<void>;
|
|
39
|
+
TargetAirPurifierStateSet(value: CharacteristicValue): Promise<void>;
|
|
40
|
+
BLEPushConnection(): Promise<void>;
|
|
41
|
+
BLERefreshConnection(switchbot: any): Promise<void>;
|
|
42
|
+
offlineOff(): Promise<void>;
|
|
43
|
+
apiError(e: any): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=airpurifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"airpurifier.d.ts","sourceRoot":"","sources":["../../src/device/airpurifier.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAW,MAAM,YAAY,CAAA;AACjF,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAc,MAAM,EAAmB,MAAM,gBAAgB,CAAA;AAMpH,OAAO,EAAqC,OAAO,EAAa,MAAM,MAAM,CAAA;AAE5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,qBAAa,WAAY,SAAQ,UAAU;IA8BvC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB;IA5BtC,OAAO,CAAC,WAAW,CAQlB;IAED,OAAO,CAAC,gBAAgB,CAAC,CAKxB;IAGD,YAAY,EAAG,iBAAiB,CAAA;IAGhC,WAAW,EAAG,sBAAsB,CAAA;IAGpC,2BAA2B,EAAG,OAAO,CAAA;IACrC,mBAAmB,EAAG,OAAO,CAAC,IAAI,CAAC,CAAA;gBAGxB,QAAQ,EAAE,iBAAiB,EACpC,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE,MAAM,GAAG,aAAa;IAsH1B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAoD/B,kBAAkB;IAsDxB;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAa9B,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IA4BjC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IA+BpC,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAoBrC,eAAe;IAkBrB;;;;;;OAMG;IAEG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAoB5B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IA6C/B,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IA6BnC,4BAA4B,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB7C,SAAS,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAMpD,gBAAgB,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAO3D,yBAAyB,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAOpE,iBAAiB;IAOjB,oBAAoB,CAAC,SAAS,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAQnD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAO3B,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAWtC"}
|