@switchbot/homebridge-switchbot 2.0.0-beta.9 → 2.0.0
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 +10 -1
- package/README.md +3 -2
- package/config.schema.json +91 -19
- package/dist/device/bot.d.ts +34 -28
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +657 -648
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts +137 -0
- package/dist/device/ceilinglight.d.ts.map +1 -0
- package/dist/device/ceilinglight.js +1127 -0
- package/dist/device/ceilinglight.js.map +1 -0
- package/dist/device/colorbulb.d.ts +36 -14
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +472 -297
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts +18 -8
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +306 -237
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts +23 -16
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +566 -502
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/humidifier.d.ts +24 -18
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +453 -369
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/lock.d.ts +27 -8
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +305 -148
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts +22 -16
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +367 -267
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts +24 -12
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +381 -213
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts +18 -8
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +279 -216
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts +27 -17
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +295 -251
- package/dist/device/plug.js.map +1 -1
- package/dist/device/striplight.d.ts +43 -19
- package/dist/device/striplight.d.ts.map +1 -1
- package/dist/device/striplight.js +506 -262
- package/dist/device/striplight.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts +9 -12
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +278 -230
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts +5 -3
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +154 -104
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts +11 -8
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +133 -86
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts +10 -7
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +160 -109
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/light.d.ts +11 -8
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +137 -103
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts +11 -8
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +145 -98
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts +12 -9
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +143 -93
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts +9 -10
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +132 -89
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts +8 -9
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +132 -89
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.d.ts +13 -12
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +524 -418
- package/dist/platform.js.map +1 -1
- package/dist/settings.d.ts +19 -11
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js.map +1 -1
- package/homebridge-ui/public/index.html +1 -0
- package/package.json +11 -9
- package/src/device/bot.ts +656 -659
- package/src/device/ceilinglight.ts +1208 -0
- package/src/device/colorbulb.ts +482 -334
- package/src/device/contact.ts +309 -241
- package/src/device/curtain.ts +571 -516
- package/src/device/humidifier.ts +456 -403
- package/src/device/lock.ts +314 -149
- package/src/device/meter.ts +378 -280
- package/src/device/meterplus.ts +391 -219
- package/src/device/motion.ts +285 -222
- package/src/device/plug.ts +299 -260
- package/src/device/striplight.ts +522 -289
- package/src/irdevice/airconditioner.ts +282 -241
- package/src/irdevice/airpurifier.ts +151 -103
- package/src/irdevice/camera.ts +131 -85
- package/src/irdevice/fan.ts +157 -106
- package/src/irdevice/light.ts +135 -103
- package/src/irdevice/other.ts +143 -97
- package/src/irdevice/tv.ts +142 -93
- package/src/irdevice/vacuumcleaner.ts +131 -89
- package/src/irdevice/waterheater.ts +130 -89
- package/src/platform.ts +522 -446
- package/src/settings.ts +20 -11
- package/.github/npm-version-script.js +0 -81
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,21 @@
|
|
|
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
|
-
## [
|
|
5
|
+
## [Version 2.0.0](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v2.0.0) (2022-10-12)
|
|
6
6
|
|
|
7
7
|
## What's Changed
|
|
8
8
|
|
|
9
9
|
- Moved from v1.0 to v1.1 of [OpenAPI](https://github.com/OpenWonderLabs/SwitchBotAPI)
|
|
10
10
|
- Publish device(s) as an external accessory.
|
|
11
|
+
- Added `connectionType` config, this replaces the `BLE` config.
|
|
12
|
+
- You can now select Both Connections, Only OpenAPI, Only BLE, or Disable.
|
|
13
|
+
- `Both` will use BLE as the default connection and will use OpenAPI as a backup connection.
|
|
14
|
+
- `OpenAPI` will only allow connections through the OpenAPI.
|
|
15
|
+
- `BLE` will only allow connections through Bluetooth (BLE), .
|
|
16
|
+
- `Disable` will disable all connections. This will also allow you to disable commands and refreshes for a specific device but leave it in HomeKit.
|
|
17
|
+
- Added Support for Ceiling Light & Ceiling Light Pro
|
|
18
|
+
- Fixes Smart Lock Issues fixed in v1.1 of OpenAPI. [#462](https://github.com/OpenWonderLabs/homebridge-switchbot/issues/462)
|
|
19
|
+
= Fixes excesive logging from node-switchbot. [#435](https://github.com/OpenWonderLabs/homebridge-switchbot/issues/435), [#444](https://github.com/OpenWonderLabs/homebridge-switchbot/issues/444), [#446](https://github.com/OpenWonderLabs/homebridge-switchbot/issues/446)
|
|
11
20
|
- Housekeeping and updated dependencies.
|
|
12
21
|
|
|
13
22
|
**Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v1.15.0...v2.0.0
|
package/README.md
CHANGED
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
[](https://www.npmjs.com/package/@switchbot/homebridge-switchbot)
|
|
9
9
|
[](https://discord.gg/5wYTbwP4ha)
|
|
10
10
|
|
|
11
|
-
<p>The Homebridge <a href="https://www.switch-bot.com">SwitchBot</a>
|
|
12
|
-
plugin allows you to access your SwitchBot Device(s) from HomeKit with
|
|
11
|
+
<p>The Homebridge <a href="https://www.switch-bot.com">SwitchBot</a> plugin allows you to access your SwitchBot Device(s) from HomeKit with
|
|
13
12
|
<a href="https://homebridge.io">Homebridge</a>.
|
|
14
13
|
</p>
|
|
15
14
|
|
|
@@ -97,6 +96,8 @@ plugin allows you to access your SwitchBot Device(s) from HomeKit with
|
|
|
97
96
|
- Must supply `deviceId` & `deviceName` to Device Config
|
|
98
97
|
- Check `Enable Bluetooth Low Energy (BLE) Connection` on Device Config
|
|
99
98
|
- [SwitchBot Bulb](https://www.switch-bot.com/products/switchbot-color-bulb)
|
|
99
|
+
- [SwitchBot Ceiling Light](https://www.switchbot.jp/collections/all/products/switchbot-ceiling-light)
|
|
100
|
+
- [SwitchBot Ceiling Light Pro](https://www.switchbot.jp/collections/all/products/switchbot-ceiling-light)
|
|
100
101
|
- [SwitchBot Light Strip](https://www.switch-bot.com/products/switchbot-light-strip)
|
|
101
102
|
- Supports OpenAPI Connection Only
|
|
102
103
|
- If using OpenAPI:
|
package/config.schema.json
CHANGED
|
@@ -63,18 +63,11 @@
|
|
|
63
63
|
"hide_device": {
|
|
64
64
|
"title": "Hide Device",
|
|
65
65
|
"type": "boolean",
|
|
66
|
-
"description": "If true
|
|
66
|
+
"description": "If true, device will be removed or hidden from HomeKit.",
|
|
67
67
|
"condition": {
|
|
68
68
|
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId);"
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
-
"offline": {
|
|
72
|
-
"title": "Offline as Off",
|
|
73
|
-
"type": "boolean",
|
|
74
|
-
"condition": {
|
|
75
|
-
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device);"
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
71
|
"configDeviceType": {
|
|
79
72
|
"title": "Device Type",
|
|
80
73
|
"type": "string",
|
|
@@ -144,11 +137,30 @@
|
|
|
144
137
|
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device);"
|
|
145
138
|
}
|
|
146
139
|
},
|
|
147
|
-
"
|
|
148
|
-
"title": "
|
|
149
|
-
"type": "
|
|
140
|
+
"connectionType": {
|
|
141
|
+
"title": "Connection Type",
|
|
142
|
+
"type": "string",
|
|
143
|
+
"oneOf": [
|
|
144
|
+
{
|
|
145
|
+
"title": "BLE/OpenAPI",
|
|
146
|
+
"enum": ["BLE/OpenAPI"]
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"title": "OpenAPI",
|
|
150
|
+
"enum": ["OpenAPI"]
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"title": "BLE",
|
|
154
|
+
"enum": ["BLE"]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"title": "Disable",
|
|
158
|
+
"enum": ["Disabled"]
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"description": "Bluetooth (BLE) API is only available for the following Device Types: Humidifier, Meter, MeterPlus, Curtain, Bot, Motion Sensor, Contact Sensor, Plug Mini (US), Plug Mini (JP), & Color Bulb",
|
|
150
162
|
"condition": {
|
|
151
|
-
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device
|
|
163
|
+
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device);"
|
|
152
164
|
}
|
|
153
165
|
},
|
|
154
166
|
"customBLEaddress": {
|
|
@@ -156,7 +168,7 @@
|
|
|
156
168
|
"type": "string",
|
|
157
169
|
"placeholder": "81F3UT59513F",
|
|
158
170
|
"condition": {
|
|
159
|
-
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].
|
|
171
|
+
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].connectionType === 'BLE' || model.options.devices[arrayIndices].connectionType === 'BLE/OpenAPI'));"
|
|
160
172
|
}
|
|
161
173
|
},
|
|
162
174
|
"scanDuration": {
|
|
@@ -164,7 +176,7 @@
|
|
|
164
176
|
"type": "number",
|
|
165
177
|
"placeholder": 1,
|
|
166
178
|
"condition": {
|
|
167
|
-
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].
|
|
179
|
+
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].connectionType === 'BLE' || model.options.devices[arrayIndices].connectionType === 'BLE/OpenAPI'));"
|
|
168
180
|
}
|
|
169
181
|
},
|
|
170
182
|
"bot": {
|
|
@@ -505,6 +517,35 @@
|
|
|
505
517
|
}
|
|
506
518
|
}
|
|
507
519
|
},
|
|
520
|
+
"mqttURL": {
|
|
521
|
+
"title": "MQTT URL",
|
|
522
|
+
"type": "string",
|
|
523
|
+
"placeholder": "192.168.7.1",
|
|
524
|
+
"condition": {
|
|
525
|
+
"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 === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)'));"
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
"mqttOptions": {
|
|
529
|
+
"title": "MQTT Options",
|
|
530
|
+
"type": "string",
|
|
531
|
+
"condition": {
|
|
532
|
+
"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 === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)'));"
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
"mqttPubOptions": {
|
|
536
|
+
"title": "MQTT Pub Options",
|
|
537
|
+
"type": "string",
|
|
538
|
+
"condition": {
|
|
539
|
+
"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 === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)'));"
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
"history": {
|
|
543
|
+
"title": "EVE History",
|
|
544
|
+
"type": "boolean",
|
|
545
|
+
"condition": {
|
|
546
|
+
"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 === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'MeterPlus' || model.options.devices[arrayIndices].configDeviceType === 'Meter Plus (JP)'));"
|
|
547
|
+
}
|
|
548
|
+
},
|
|
508
549
|
"firmware": {
|
|
509
550
|
"title": "Firmware Override",
|
|
510
551
|
"type": "string",
|
|
@@ -552,7 +593,7 @@
|
|
|
552
593
|
}
|
|
553
594
|
}
|
|
554
595
|
},
|
|
555
|
-
"required": ["deviceId", "configDeviceType", "configDeviceName", "logging"]
|
|
596
|
+
"required": ["deviceId", "configDeviceType", "configDeviceName", "connectionType", "logging"]
|
|
556
597
|
},
|
|
557
598
|
"uniqueItems": true
|
|
558
599
|
},
|
|
@@ -578,6 +619,7 @@
|
|
|
578
619
|
"hide_device": {
|
|
579
620
|
"title": "Hide Device",
|
|
580
621
|
"type": "boolean",
|
|
622
|
+
"description": "If true, device will be removed or hidden from HomeKit.",
|
|
581
623
|
"condition": {
|
|
582
624
|
"functionBody": "return (model.options && model.options.irdevices && model.options.irdevices[arrayIndices].deviceId);"
|
|
583
625
|
}
|
|
@@ -699,6 +741,24 @@
|
|
|
699
741
|
"functionBody": "return (model.options && model.options.irdevices && model.options.irdevices[arrayIndices].deviceId && !model.options.irdevices[arrayIndices].hide_device);"
|
|
700
742
|
}
|
|
701
743
|
},
|
|
744
|
+
"connectionType": {
|
|
745
|
+
"title": "Connection Type",
|
|
746
|
+
"type": "string",
|
|
747
|
+
"oneOf": [
|
|
748
|
+
{
|
|
749
|
+
"title": "OpenAPI",
|
|
750
|
+
"enum": ["OpenAPI"]
|
|
751
|
+
},
|
|
752
|
+
{
|
|
753
|
+
"title": "Disable",
|
|
754
|
+
"enum": ["Disabled"]
|
|
755
|
+
}
|
|
756
|
+
],
|
|
757
|
+
"description": "Enables OpenAPI, if disabled will leave device in HomeKit and commands will not be sent to OpenAPI.",
|
|
758
|
+
"condition": {
|
|
759
|
+
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device);"
|
|
760
|
+
}
|
|
761
|
+
},
|
|
702
762
|
"irair": {
|
|
703
763
|
"type": "object",
|
|
704
764
|
"properties": {
|
|
@@ -807,6 +867,14 @@
|
|
|
807
867
|
}
|
|
808
868
|
}
|
|
809
869
|
},
|
|
870
|
+
"firmware": {
|
|
871
|
+
"title": "Firmware Override",
|
|
872
|
+
"type": "string",
|
|
873
|
+
"placeholder": "1.2.8",
|
|
874
|
+
"condition": {
|
|
875
|
+
"functionBody": "return (model.options && model.options.irdevices && model.options.irdevices[arrayIndices].deviceId && !model.options.irdevices[arrayIndices].hide_device && model.options.irdevices[arrayIndices].configRemoteType);"
|
|
876
|
+
}
|
|
877
|
+
},
|
|
810
878
|
"external": {
|
|
811
879
|
"title": "External Accessory",
|
|
812
880
|
"type": "boolean",
|
|
@@ -836,7 +904,7 @@
|
|
|
836
904
|
}
|
|
837
905
|
}
|
|
838
906
|
},
|
|
839
|
-
"required": ["deviceId", "configRemoteType", "logging"]
|
|
907
|
+
"required": ["deviceId", "configRemoteType", "connectionType", "logging"]
|
|
840
908
|
},
|
|
841
909
|
"uniqueItems": true
|
|
842
910
|
},
|
|
@@ -882,7 +950,7 @@
|
|
|
882
950
|
"title": "SwitchBot Account Info",
|
|
883
951
|
"expandable": true,
|
|
884
952
|
"expanded": false,
|
|
885
|
-
"items": ["credentials.token","credentials.secret"]
|
|
953
|
+
"items": ["credentials.token", "credentials.secret"]
|
|
886
954
|
},
|
|
887
955
|
{
|
|
888
956
|
"type": "fieldset",
|
|
@@ -903,8 +971,7 @@
|
|
|
903
971
|
"options.devices[].deviceId",
|
|
904
972
|
"options.devices[].hide_device",
|
|
905
973
|
"options.devices[].configDeviceType",
|
|
906
|
-
"options.devices[].
|
|
907
|
-
"options.devices[].ble",
|
|
974
|
+
"options.devices[].connectionType",
|
|
908
975
|
"options.devices[].scanDuration",
|
|
909
976
|
"options.devices[].bot.mode",
|
|
910
977
|
"options.devices[].bot.deviceType",
|
|
@@ -935,6 +1002,10 @@
|
|
|
935
1002
|
"options.devices[].colorbulb.set_minStep",
|
|
936
1003
|
"options.devices[].colorbulb.adaptiveLightingShift",
|
|
937
1004
|
"options.devices[].lock.hide_contactsensor",
|
|
1005
|
+
"options.devices[].mqttURL",
|
|
1006
|
+
"options.devices[].mqttOptions",
|
|
1007
|
+
"options.devices[].mqttPubOptions",
|
|
1008
|
+
"options.devices[].history",
|
|
938
1009
|
"options.devices[].firmware",
|
|
939
1010
|
"options.devices[].refreshRate",
|
|
940
1011
|
"options.devices[].external",
|
|
@@ -973,6 +1044,7 @@
|
|
|
973
1044
|
"options.irdevices[].other.deviceType",
|
|
974
1045
|
"options.irdevices[].other.commandOn",
|
|
975
1046
|
"options.irdevices[].other.commandOff",
|
|
1047
|
+
"options.irdevices[].firmware",
|
|
976
1048
|
"options.irdevices[].external",
|
|
977
1049
|
"options.irdevices[].logging"
|
|
978
1050
|
]
|
package/dist/device/bot.d.ts
CHANGED
|
@@ -27,14 +27,12 @@ export declare class Bot {
|
|
|
27
27
|
windowCoveringService?: Service;
|
|
28
28
|
statefulProgrammableSwitchService?: Service;
|
|
29
29
|
On: CharacteristicValue;
|
|
30
|
-
OnCached: CharacteristicValue;
|
|
31
30
|
BatteryLevel: CharacteristicValue;
|
|
32
31
|
StatusLowBattery: CharacteristicValue;
|
|
33
32
|
power: deviceStatus['power'];
|
|
34
33
|
deviceStatus: any;
|
|
35
34
|
connected?: boolean;
|
|
36
35
|
switchbot: switchbot;
|
|
37
|
-
SwitchToOpenAPI?: boolean;
|
|
38
36
|
serviceData: serviceData;
|
|
39
37
|
address: ad['address'];
|
|
40
38
|
mode: serviceData['mode'];
|
|
@@ -48,6 +46,8 @@ export declare class Bot {
|
|
|
48
46
|
doublePress: number;
|
|
49
47
|
botUpdateInProgress: boolean;
|
|
50
48
|
doBotUpdate: Subject<void>;
|
|
49
|
+
private readonly BLE;
|
|
50
|
+
private readonly OpenAPI;
|
|
51
51
|
constructor(platform: SwitchBotPlatform, accessory: PlatformAccessory, device: device & devicesConfig);
|
|
52
52
|
/**
|
|
53
53
|
* Parse the device status from the SwitchBot api
|
|
@@ -60,7 +60,6 @@ export declare class Bot {
|
|
|
60
60
|
*/
|
|
61
61
|
refreshStatus(): Promise<void>;
|
|
62
62
|
BLERefreshStatus(): Promise<void>;
|
|
63
|
-
getCustomBLEAddress(switchbot: any): Promise<void>;
|
|
64
63
|
openAPIRefreshStatus(): Promise<void>;
|
|
65
64
|
/**
|
|
66
65
|
* Pushes the requested changes to the SwitchBot API
|
|
@@ -71,36 +70,15 @@ export declare class Bot {
|
|
|
71
70
|
*/
|
|
72
71
|
pushChanges(): Promise<void>;
|
|
73
72
|
BLEpushChanges(): Promise<void>;
|
|
74
|
-
turnOnOff(device_list: any): Promise<any>;
|
|
75
73
|
openAPIpushChanges(): Promise<void>;
|
|
76
74
|
/**
|
|
77
|
-
*
|
|
75
|
+
* Handle requests to set the "On" characteristic
|
|
78
76
|
*/
|
|
79
|
-
|
|
80
|
-
apiError(e: any): Promise<void>;
|
|
81
|
-
statusCode({ res }: {
|
|
82
|
-
res: IncomingMessage;
|
|
83
|
-
}): Promise<void>;
|
|
84
|
-
offlineOff(): Promise<void>;
|
|
77
|
+
OnSet(value: CharacteristicValue): Promise<void>;
|
|
85
78
|
/**
|
|
86
|
-
*
|
|
79
|
+
* Updates the status for each of the HomeKit Characteristics
|
|
87
80
|
*/
|
|
88
|
-
|
|
89
|
-
retry({ max, fn }: {
|
|
90
|
-
max: number;
|
|
91
|
-
fn: {
|
|
92
|
-
(): any;
|
|
93
|
-
(): Promise<any>;
|
|
94
|
-
};
|
|
95
|
-
}): Promise<null>;
|
|
96
|
-
maxRetry(): Promise<number>;
|
|
97
|
-
config(device: device & devicesConfig): Promise<void>;
|
|
98
|
-
refreshRate(device: device & devicesConfig): Promise<void>;
|
|
99
|
-
scan(device: device & devicesConfig): Promise<void>;
|
|
100
|
-
logs(device: device & devicesConfig): Promise<void>;
|
|
101
|
-
FirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig): CharacteristicValue;
|
|
102
|
-
PressOrSwitch(device: device & devicesConfig): Promise<void>;
|
|
103
|
-
allowPushChanges(device: device & devicesConfig): Promise<void>;
|
|
81
|
+
updateHomeKitCharacteristics(): Promise<void>;
|
|
104
82
|
removeOutletService(accessory: PlatformAccessory): Promise<void>;
|
|
105
83
|
removeGarageDoorService(accessory: PlatformAccessory): Promise<void>;
|
|
106
84
|
removeDoorService(accessory: PlatformAccessory): Promise<void>;
|
|
@@ -111,12 +89,40 @@ export declare class Bot {
|
|
|
111
89
|
removeWindowCoveringService(accessory: PlatformAccessory): Promise<void>;
|
|
112
90
|
removeStatefulProgrammableSwitchService(accessory: PlatformAccessory): Promise<void>;
|
|
113
91
|
removeSwitchService(accessory: PlatformAccessory): Promise<void>;
|
|
92
|
+
private DoublePress;
|
|
93
|
+
getCustomBLEAddress(switchbot: any): Promise<void>;
|
|
94
|
+
BLEPushConnection(): Promise<void>;
|
|
95
|
+
BLERefreshConnection(switchbot: any): Promise<void>;
|
|
96
|
+
turnOnOff(device_list: any): Promise<any>;
|
|
97
|
+
retry({ max, fn }: {
|
|
98
|
+
max: number;
|
|
99
|
+
fn: {
|
|
100
|
+
(): any;
|
|
101
|
+
(): Promise<any>;
|
|
102
|
+
};
|
|
103
|
+
}): Promise<null>;
|
|
104
|
+
maxRetry(): Promise<number>;
|
|
105
|
+
PressOrSwitch(device: device & devicesConfig): Promise<void>;
|
|
106
|
+
allowPushChanges(device: device & devicesConfig): Promise<void>;
|
|
107
|
+
scan(device: device & devicesConfig): Promise<void>;
|
|
108
|
+
statusCode({ res }: {
|
|
109
|
+
res: IncomingMessage;
|
|
110
|
+
}): Promise<void>;
|
|
111
|
+
offlineOff(): Promise<void>;
|
|
112
|
+
apiError(e: any): Promise<void>;
|
|
113
|
+
FirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig): CharacteristicValue;
|
|
114
|
+
private context;
|
|
115
|
+
refreshRate(device: device & devicesConfig): Promise<void>;
|
|
116
|
+
config(device: device & devicesConfig): Promise<void>;
|
|
117
|
+
logs(device: device & devicesConfig): Promise<void>;
|
|
114
118
|
/**
|
|
115
119
|
* Logging for Device
|
|
116
120
|
*/
|
|
117
121
|
infoLog(...log: any[]): void;
|
|
118
122
|
warnLog(...log: any[]): void;
|
|
123
|
+
debugWarnLog(...log: any[]): void;
|
|
119
124
|
errorLog(...log: any[]): void;
|
|
125
|
+
debugErrorLog(...log: any[]): void;
|
|
120
126
|
debugLog(...log: any[]): void;
|
|
121
127
|
enablingDeviceLogging(): boolean;
|
|
122
128
|
}
|
package/dist/device/bot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bot.d.ts","sourceRoot":"","sources":["../../src/device/bot.ts"],"names":[],"mappings":";;AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,EAAY,OAAO,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"bot.d.ts","sourceRoot":"","sources":["../../src/device/bot.ts"],"names":[],"mappings":";;AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,eAAe,E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