@switchbot/homebridge-switchbot 1.6.4-beta.5 → 1.7.1-beta.10
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 +23 -2
- package/config.schema.json +125 -33
- package/dist/devices/bots.d.ts +21 -9
- package/dist/devices/bots.d.ts.map +1 -1
- package/dist/devices/bots.js +352 -48
- package/dist/devices/bots.js.map +1 -1
- package/dist/devices/colorbulb.d.ts +6 -1
- package/dist/devices/colorbulb.d.ts.map +1 -1
- package/dist/devices/colorbulb.js +18 -11
- package/dist/devices/colorbulb.js.map +1 -1
- package/dist/devices/contact.d.ts +10 -2
- package/dist/devices/contact.d.ts.map +1 -1
- package/dist/devices/contact.js +92 -51
- package/dist/devices/contact.js.map +1 -1
- package/dist/devices/curtains.d.ts +10 -3
- package/dist/devices/curtains.d.ts.map +1 -1
- package/dist/devices/curtains.js +52 -34
- package/dist/devices/curtains.js.map +1 -1
- package/dist/devices/humidifiers.d.ts +8 -2
- package/dist/devices/humidifiers.d.ts.map +1 -1
- package/dist/devices/humidifiers.js +28 -35
- package/dist/devices/humidifiers.js.map +1 -1
- package/dist/devices/meters.d.ts +14 -12
- package/dist/devices/meters.d.ts.map +1 -1
- package/dist/devices/meters.js +63 -103
- package/dist/devices/meters.js.map +1 -1
- package/dist/devices/motion.d.ts +10 -3
- package/dist/devices/motion.d.ts.map +1 -1
- package/dist/devices/motion.js +114 -68
- package/dist/devices/motion.js.map +1 -1
- package/dist/devices/plugs.d.ts +3 -1
- package/dist/devices/plugs.d.ts.map +1 -1
- package/dist/devices/plugs.js +8 -1
- package/dist/devices/plugs.js.map +1 -1
- package/dist/irdevices/airconditioners.d.ts +1 -0
- package/dist/irdevices/airconditioners.d.ts.map +1 -1
- package/dist/irdevices/airconditioners.js +6 -0
- package/dist/irdevices/airconditioners.js.map +1 -1
- package/dist/irdevices/airpurifiers.d.ts +1 -0
- package/dist/irdevices/airpurifiers.d.ts.map +1 -1
- package/dist/irdevices/airpurifiers.js +6 -0
- package/dist/irdevices/airpurifiers.js.map +1 -1
- package/dist/irdevices/cameras.d.ts +1 -0
- package/dist/irdevices/cameras.d.ts.map +1 -1
- package/dist/irdevices/cameras.js +6 -0
- package/dist/irdevices/cameras.js.map +1 -1
- package/dist/irdevices/fans.d.ts +1 -0
- package/dist/irdevices/fans.d.ts.map +1 -1
- package/dist/irdevices/fans.js +6 -0
- package/dist/irdevices/fans.js.map +1 -1
- package/dist/irdevices/lights.d.ts +1 -0
- package/dist/irdevices/lights.d.ts.map +1 -1
- package/dist/irdevices/lights.js +6 -0
- package/dist/irdevices/lights.js.map +1 -1
- package/dist/irdevices/others.d.ts +1 -0
- package/dist/irdevices/others.d.ts.map +1 -1
- package/dist/irdevices/others.js +6 -0
- package/dist/irdevices/others.js.map +1 -1
- package/dist/irdevices/tvs.d.ts +1 -0
- package/dist/irdevices/tvs.d.ts.map +1 -1
- package/dist/irdevices/tvs.js +6 -0
- package/dist/irdevices/tvs.js.map +1 -1
- package/dist/irdevices/vacuumcleaners.d.ts +1 -0
- package/dist/irdevices/vacuumcleaners.d.ts.map +1 -1
- package/dist/irdevices/vacuumcleaners.js +6 -0
- package/dist/irdevices/vacuumcleaners.js.map +1 -1
- package/dist/irdevices/waterheaters.d.ts +1 -0
- package/dist/irdevices/waterheaters.d.ts.map +1 -1
- package/dist/irdevices/waterheaters.js +6 -0
- package/dist/irdevices/waterheaters.js.map +1 -1
- package/dist/platform.d.ts +2 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +14 -1
- package/dist/platform.js.map +1 -1
- package/dist/settings.d.ts +14 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js.map +1 -1
- package/package.json +5 -5
- package/src/devices/bots.ts +355 -52
- package/src/devices/colorbulb.ts +24 -14
- package/src/devices/contact.ts +99 -55
- package/src/devices/curtains.ts +60 -36
- package/src/devices/humidifiers.ts +36 -36
- package/src/devices/meters.ts +79 -113
- package/src/devices/motion.ts +125 -74
- package/src/devices/plugs.ts +11 -2
- package/src/irdevices/airconditioners.ts +7 -0
- package/src/irdevices/airpurifiers.ts +7 -0
- package/src/irdevices/cameras.ts +7 -0
- package/src/irdevices/fans.ts +7 -0
- package/src/irdevices/lights.ts +7 -0
- package/src/irdevices/others.ts +7 -0
- package/src/irdevices/tvs.ts +7 -0
- package/src/irdevices/vacuumcleaners.ts +7 -0
- package/src/irdevices/waterheaters.ts +7 -0
- package/src/platform.ts +14 -1
- package/src/settings.ts +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/)
|
|
4
4
|
|
|
5
|
-
## [Beta - Version 1.
|
|
5
|
+
## [Beta - Version 1.8.0](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.8.0) (2022-01-XX)
|
|
6
|
+
|
|
7
|
+
## What's Changed
|
|
8
|
+
* Added option to display Bot a Stateful Programmable Switch.
|
|
9
|
+
* This will only Works in 3rd Party Home App, Like [Eve](https://apps.apple.com/us/app/eve-for-homekit/id917695792) or [Home+ 5](https://apps.apple.com/us/app/home-5/id995994352)
|
|
10
|
+
* Add option to Hide Motion Sensor's Light Sensor.
|
|
11
|
+
* Add option to Set Motion Sensor's Light Sensor `set_minLux` and `set_maxLux`.
|
|
12
|
+
* Fixed Bug: Where BLE config would show for devices that don't support BLE.
|
|
13
|
+
* Fixed Bug: Contact Sensors's Motion Sensor and Light Sensor showing undefined values.
|
|
14
|
+
* Fixed Bug: Motion Sensors's Light Sensor showing undefined values.
|
|
15
|
+
* Fixed Bug: Battery Service wouldn't be removed from Curtain, Contact Sensor, or Motion Sensor when switching from BLE to OpenAPI.
|
|
16
|
+
* Enhancments: Made some improvemnt on the switch from BLE to OpenAPI when BLE connection fails.
|
|
17
|
+
* Enhancments: Made Optional Switchbot Device Settings and Optional IR Device Settings more managable by using Tabs.
|
|
18
|
+
* Housekeeping and updated dependencies.
|
|
19
|
+
|
|
20
|
+
**Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v1.7.0...v1.8.0
|
|
21
|
+
|
|
22
|
+
## [Version 1.7.0](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.7.0) (2022-01-05)
|
|
6
23
|
|
|
7
24
|
## What's Changed
|
|
8
|
-
* Added option to display Bot a
|
|
25
|
+
* Added option to display Bot a Fan.
|
|
9
26
|
* Added option to display Bot a Door. [#179](https://github.com/OpenWonderLabs/homebridge-switchbot/issues/179)
|
|
10
27
|
* Added option to display Bot a Lock. [#179](https://github.com/OpenWonderLabs/homebridge-switchbot/issues/179)
|
|
28
|
+
* Added option to display Bot a Faucet.
|
|
29
|
+
* Added option to display Bot a Window.
|
|
30
|
+
* Added option to display Bot a WindowCovering.
|
|
31
|
+
* Added option to display Bot a Garage Door Opener. [#179](https://github.com/OpenWonderLabs/homebridge-switchbot/issues/179)
|
|
11
32
|
|
|
12
33
|
**Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v1.6.3...v1.7.0
|
|
13
34
|
|
package/config.schema.json
CHANGED
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
"name": {
|
|
12
12
|
"type": "string",
|
|
13
13
|
"title": "Name",
|
|
14
|
-
"default": "SwitchBot"
|
|
15
|
-
"required": true
|
|
14
|
+
"default": "SwitchBot"
|
|
16
15
|
},
|
|
17
16
|
"credentials": {
|
|
18
17
|
"type": "object",
|
|
@@ -20,7 +19,6 @@
|
|
|
20
19
|
"openToken": {
|
|
21
20
|
"title": "Token",
|
|
22
21
|
"type": "string",
|
|
23
|
-
"required": true,
|
|
24
22
|
"x-schema-form": {
|
|
25
23
|
"type": "password"
|
|
26
24
|
}
|
|
@@ -28,10 +26,13 @@
|
|
|
28
26
|
"notice": {
|
|
29
27
|
"title": "Notice",
|
|
30
28
|
"type": "string",
|
|
31
|
-
"required": true,
|
|
32
29
|
"default": "Keep your token a secret!"
|
|
33
30
|
}
|
|
34
|
-
}
|
|
31
|
+
},
|
|
32
|
+
"required": [
|
|
33
|
+
"openToken",
|
|
34
|
+
"notice"
|
|
35
|
+
]
|
|
35
36
|
},
|
|
36
37
|
"options": {
|
|
37
38
|
"type": "object",
|
|
@@ -52,7 +53,7 @@
|
|
|
52
53
|
"type": "string",
|
|
53
54
|
"placeholder": "SwitchBot",
|
|
54
55
|
"condition": {
|
|
55
|
-
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId
|
|
56
|
+
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId);"
|
|
56
57
|
}
|
|
57
58
|
},
|
|
58
59
|
"hide_device": {
|
|
@@ -137,11 +138,11 @@
|
|
|
137
138
|
"title": "Enable Bluetooth Low Energy (BLE) Connection",
|
|
138
139
|
"type": "boolean",
|
|
139
140
|
"condition": {
|
|
140
|
-
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device);"
|
|
141
|
+
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Humidifier' || model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Bot'));"
|
|
141
142
|
}
|
|
142
143
|
},
|
|
143
144
|
"scanDuration": {
|
|
144
|
-
"title": "Scan Duration (Default is 1 Second)",
|
|
145
|
+
"title": "BLE Scan Duration (Default is 1 Second)",
|
|
145
146
|
"type": "number",
|
|
146
147
|
"placeholder": 1,
|
|
147
148
|
"condition": {
|
|
@@ -200,6 +201,36 @@
|
|
|
200
201
|
"lock"
|
|
201
202
|
]
|
|
202
203
|
},
|
|
204
|
+
{
|
|
205
|
+
"title": "Faucet",
|
|
206
|
+
"enum": [
|
|
207
|
+
"faucet"
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"title": "Fan",
|
|
212
|
+
"enum": [
|
|
213
|
+
"fan"
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"title": "Window",
|
|
218
|
+
"enum": [
|
|
219
|
+
"window"
|
|
220
|
+
]
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"title": "Window Covering",
|
|
224
|
+
"enum": [
|
|
225
|
+
"windowcovering"
|
|
226
|
+
]
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"title": "Stateful Programmable Switch (Only Works in 3rd Party Home Apps)",
|
|
230
|
+
"enum": [
|
|
231
|
+
"stateful"
|
|
232
|
+
]
|
|
233
|
+
},
|
|
203
234
|
{
|
|
204
235
|
"title": "Switch",
|
|
205
236
|
"enum": [
|
|
@@ -343,6 +374,22 @@
|
|
|
343
374
|
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Contact Sensor' && model.options.devices[arrayIndices].deviceId);"
|
|
344
375
|
}
|
|
345
376
|
},
|
|
377
|
+
"set_minlux": {
|
|
378
|
+
"title": "Set Min Lux",
|
|
379
|
+
"type": "number",
|
|
380
|
+
"placeholder": "1",
|
|
381
|
+
"condition": {
|
|
382
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Contact Sensor' && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].contact.hide_lightsensor);"
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
"set_maxlux": {
|
|
386
|
+
"title": "Set Max Lux",
|
|
387
|
+
"type": "number",
|
|
388
|
+
"placeholder": "6001",
|
|
389
|
+
"condition": {
|
|
390
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Contact Sensor' && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].contact.hide_lightsensor);"
|
|
391
|
+
}
|
|
392
|
+
},
|
|
346
393
|
"hide_motionsensor": {
|
|
347
394
|
"title": "Hide Contact Sensor's Motion Sensor",
|
|
348
395
|
"type": "boolean",
|
|
@@ -352,6 +399,34 @@
|
|
|
352
399
|
}
|
|
353
400
|
}
|
|
354
401
|
},
|
|
402
|
+
"motion": {
|
|
403
|
+
"type": "object",
|
|
404
|
+
"properties": {
|
|
405
|
+
"hide_lightsensor": {
|
|
406
|
+
"title": "Hide Motion Sensor's Light Sensor",
|
|
407
|
+
"type": "boolean",
|
|
408
|
+
"condition": {
|
|
409
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Motion Sensor' && model.options.devices[arrayIndices].deviceId);"
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
"set_minlux": {
|
|
413
|
+
"title": "Set Min Lux",
|
|
414
|
+
"type": "number",
|
|
415
|
+
"placeholder": "1",
|
|
416
|
+
"condition": {
|
|
417
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Motion Sensor' && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].motion.hide_lightsensor);"
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
"set_maxlux": {
|
|
421
|
+
"title": "Set Max Lux",
|
|
422
|
+
"type": "number",
|
|
423
|
+
"placeholder": "6001",
|
|
424
|
+
"condition": {
|
|
425
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Motion Sensor' && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].motion.hide_lightsensor);"
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
},
|
|
355
430
|
"colorbulb": {
|
|
356
431
|
"type": "object",
|
|
357
432
|
"properties": {
|
|
@@ -381,7 +456,7 @@
|
|
|
381
456
|
"placeholder": 360,
|
|
382
457
|
"description": "Indicates the number of seconds between polls of SwitchBot API.",
|
|
383
458
|
"condition": {
|
|
384
|
-
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device);"
|
|
459
|
+
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType);"
|
|
385
460
|
}
|
|
386
461
|
},
|
|
387
462
|
"logging": {
|
|
@@ -408,11 +483,17 @@
|
|
|
408
483
|
}
|
|
409
484
|
],
|
|
410
485
|
"condition": {
|
|
411
|
-
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device);"
|
|
486
|
+
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType);"
|
|
412
487
|
}
|
|
413
488
|
}
|
|
414
|
-
}
|
|
415
|
-
|
|
489
|
+
},
|
|
490
|
+
"required": [
|
|
491
|
+
"deviceId",
|
|
492
|
+
"configDeviceType",
|
|
493
|
+
"configDeviceName"
|
|
494
|
+
]
|
|
495
|
+
},
|
|
496
|
+
"uniqueItems": true
|
|
416
497
|
},
|
|
417
498
|
"irdevices": {
|
|
418
499
|
"type": "array",
|
|
@@ -730,11 +811,16 @@
|
|
|
730
811
|
}
|
|
731
812
|
],
|
|
732
813
|
"condition": {
|
|
733
|
-
"functionBody": "return (model.options && model.options.irdevices && model.options.irdevices[arrayIndices].deviceId && !model.options.irdevices[arrayIndices].hide_device);"
|
|
814
|
+
"functionBody": "return (model.options && model.options.irdevices && model.options.irdevices[arrayIndices].deviceId && !model.options.irdevices[arrayIndices].hide_device && model.options.irdevices[arrayIndices].configRemoteType);"
|
|
734
815
|
}
|
|
735
816
|
}
|
|
736
|
-
}
|
|
737
|
-
|
|
817
|
+
},
|
|
818
|
+
"required": [
|
|
819
|
+
"deviceId",
|
|
820
|
+
"configRemoteType"
|
|
821
|
+
]
|
|
822
|
+
},
|
|
823
|
+
"uniqueItems": true
|
|
738
824
|
},
|
|
739
825
|
"refreshRate": {
|
|
740
826
|
"title": "Refresh Rate",
|
|
@@ -775,7 +861,10 @@
|
|
|
775
861
|
}
|
|
776
862
|
}
|
|
777
863
|
}
|
|
778
|
-
}
|
|
864
|
+
},
|
|
865
|
+
"required": [
|
|
866
|
+
"name"
|
|
867
|
+
]
|
|
779
868
|
},
|
|
780
869
|
"layout": [
|
|
781
870
|
{
|
|
@@ -788,28 +877,27 @@
|
|
|
788
877
|
]
|
|
789
878
|
},
|
|
790
879
|
{
|
|
791
|
-
"key": "options.devices",
|
|
792
|
-
"notitle": false,
|
|
793
|
-
"add": "Add Another Device",
|
|
794
880
|
"type": "fieldset",
|
|
795
881
|
"title": "Optional SwitchBot Device Settings",
|
|
796
882
|
"expandable": true,
|
|
797
883
|
"expanded": false,
|
|
798
|
-
"orderable": false,
|
|
799
|
-
"buttonText": "Add Device",
|
|
800
884
|
"items": [
|
|
801
885
|
{
|
|
802
|
-
"
|
|
803
|
-
"
|
|
804
|
-
"
|
|
886
|
+
"key": "options.devices",
|
|
887
|
+
"notitle": false,
|
|
888
|
+
"type": "tabarray",
|
|
889
|
+
"title": "{{ value.configDeviceName || value.deviceId || 'New SwitchBot Device' }}",
|
|
890
|
+
"expandable": true,
|
|
891
|
+
"expanded": false,
|
|
892
|
+
"orderable": false,
|
|
805
893
|
"items": [
|
|
806
894
|
"options.devices[].configDeviceName",
|
|
807
895
|
"options.devices[].deviceId",
|
|
808
896
|
"options.devices[].hide_device",
|
|
897
|
+
"options.devices[].configDeviceType",
|
|
809
898
|
"options.devices[].offline",
|
|
810
899
|
"options.devices[].ble",
|
|
811
900
|
"options.devices[].scanDuration",
|
|
812
|
-
"options.devices[].configDeviceType",
|
|
813
901
|
"options.devices[].bot.mode",
|
|
814
902
|
"options.devices[].bot.deviceType",
|
|
815
903
|
"options.devices[].bot.doublePress",
|
|
@@ -826,7 +914,12 @@
|
|
|
826
914
|
"options.devices[].curtain.set_minlux",
|
|
827
915
|
"options.devices[].curtain.set_maxlux",
|
|
828
916
|
"options.devices[].contact.hide_lightsensor",
|
|
917
|
+
"options.devices[].contact.set_minlux",
|
|
918
|
+
"options.devices[].contact.set_maxlux",
|
|
829
919
|
"options.devices[].contact.hide_motionsensor",
|
|
920
|
+
"options.devices[].motion.hide_lightsensor",
|
|
921
|
+
"options.devices[].motion.set_minlux",
|
|
922
|
+
"options.devices[].motion.set_maxlux",
|
|
830
923
|
"options.devices[].colorbulb.set_minStep",
|
|
831
924
|
"options.devices[].colorbulb.adaptiveLightingShift",
|
|
832
925
|
"options.devices[].refreshRate",
|
|
@@ -836,20 +929,19 @@
|
|
|
836
929
|
]
|
|
837
930
|
},
|
|
838
931
|
{
|
|
839
|
-
"key": "options.irdevices",
|
|
840
|
-
"notitle": false,
|
|
841
|
-
"add": "Add Another IR Device",
|
|
842
932
|
"type": "fieldset",
|
|
843
933
|
"title": "Optional IR Device Settings",
|
|
844
934
|
"expandable": true,
|
|
845
935
|
"expanded": false,
|
|
846
|
-
"orderable": false,
|
|
847
|
-
"buttonText": "Add IR Device",
|
|
848
936
|
"items": [
|
|
849
937
|
{
|
|
850
|
-
"
|
|
851
|
-
"
|
|
852
|
-
"
|
|
938
|
+
"key": "options.irdevices",
|
|
939
|
+
"notitle": false,
|
|
940
|
+
"type": "tabarray",
|
|
941
|
+
"title": "{{ value.configDeviceName || value.deviceId || 'New IR Device' }}",
|
|
942
|
+
"expandable": true,
|
|
943
|
+
"expanded": false,
|
|
944
|
+
"orderable": false,
|
|
853
945
|
"items": [
|
|
854
946
|
"options.irdevices[].deviceId",
|
|
855
947
|
"options.irdevices[].hide_device",
|
package/dist/devices/bots.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Subject } from 'rxjs';
|
|
2
2
|
import { SwitchBotPlatform } from '../platform';
|
|
3
3
|
import { PlatformAccessory, CharacteristicValue } from 'homebridge';
|
|
4
|
-
import { device, devicesConfig, serviceData, switchbot, deviceStatusResponse } from '../settings';
|
|
4
|
+
import { device, devicesConfig, serviceData, switchbot, deviceStatusResponse, deviceStatus } from '../settings';
|
|
5
5
|
/**
|
|
6
6
|
* Platform Accessory
|
|
7
7
|
* An instance of this class is created for each accessory your platform registers
|
|
@@ -11,19 +11,26 @@ export declare class Bot {
|
|
|
11
11
|
private readonly platform;
|
|
12
12
|
private accessory;
|
|
13
13
|
device: device & devicesConfig;
|
|
14
|
-
private
|
|
14
|
+
private fanService?;
|
|
15
15
|
private doorService?;
|
|
16
16
|
private lockService?;
|
|
17
|
-
private
|
|
17
|
+
private faucetService?;
|
|
18
|
+
private windowService?;
|
|
19
|
+
private switchService?;
|
|
18
20
|
private outletService?;
|
|
19
21
|
private batteryService?;
|
|
22
|
+
private garageDoorService?;
|
|
23
|
+
private windowCoveringService?;
|
|
24
|
+
private statefulProgrammableSwitchService?;
|
|
20
25
|
On: CharacteristicValue;
|
|
21
26
|
OnCached: CharacteristicValue;
|
|
22
27
|
BatteryLevel: CharacteristicValue;
|
|
23
28
|
StatusLowBattery: CharacteristicValue;
|
|
29
|
+
power: deviceStatus['power'];
|
|
24
30
|
deviceStatus: deviceStatusResponse;
|
|
25
31
|
connected?: boolean;
|
|
26
32
|
switchbot: switchbot;
|
|
33
|
+
SwitchToOpenAPI?: boolean;
|
|
27
34
|
serviceData: serviceData;
|
|
28
35
|
mode: serviceData['mode'];
|
|
29
36
|
state: serviceData['state'];
|
|
@@ -36,11 +43,17 @@ export declare class Bot {
|
|
|
36
43
|
botUpdateInProgress: boolean;
|
|
37
44
|
doBotUpdate: Subject<void>;
|
|
38
45
|
constructor(platform: SwitchBotPlatform, accessory: PlatformAccessory, device: device & devicesConfig);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
config(device: device & devicesConfig): void;
|
|
47
|
+
removeOutletService(accessory: PlatformAccessory): void;
|
|
48
|
+
removeGarageDoorService(accessory: PlatformAccessory): void;
|
|
49
|
+
removeDoorService(accessory: PlatformAccessory): void;
|
|
50
|
+
removeLockService(accessory: PlatformAccessory): void;
|
|
51
|
+
removeFaucetService(accessory: PlatformAccessory): void;
|
|
52
|
+
removeFanService(accessory: PlatformAccessory): void;
|
|
53
|
+
removeWindowService(accessory: PlatformAccessory): void;
|
|
54
|
+
removeWindowCoveringService(accessory: PlatformAccessory): void;
|
|
55
|
+
removeStatefulProgrammableSwitchService(accessory: PlatformAccessory): void;
|
|
56
|
+
removeSwitchService(accessory: PlatformAccessory): void;
|
|
44
57
|
refreshRate(): void;
|
|
45
58
|
scan(): void;
|
|
46
59
|
logs(): void;
|
|
@@ -55,7 +68,6 @@ export declare class Bot {
|
|
|
55
68
|
* Asks the SwitchBot API for the latest device information
|
|
56
69
|
*/
|
|
57
70
|
refreshStatus(): Promise<void>;
|
|
58
|
-
connectBLE(): Promise<any>;
|
|
59
71
|
private BLERefreshStatus;
|
|
60
72
|
private openAPIRefreshStatus;
|
|
61
73
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bots.d.ts","sourceRoot":"","sources":["../../src/devices/bots.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,OAAO,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAW,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAa,MAAM,EAAE,aAAa,EAAE,WAAW,EAAM,SAAS,EAAE,oBAAoB,EAAW,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"bots.d.ts","sourceRoot":"","sources":["../../src/devices/bots.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,OAAO,EAAE,MAAM,MAAM,CAAC;A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