@switchbot/homebridge-switchbot 1.10.2-beta.7 → 1.11.2
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 +20 -3
- package/config.schema.json +49 -0
- package/dist/device/bot.d.ts +43 -40
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +26 -26
- package/dist/device/bot.js.map +1 -1
- package/dist/device/colorbulb.d.ts +25 -21
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +176 -140
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts +15 -15
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +14 -13
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts +25 -22
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +50 -37
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/humidifier.d.ts +23 -20
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +38 -38
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/lock.d.ts +16 -13
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +17 -17
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts +15 -15
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +11 -11
- package/dist/device/meter.js.map +1 -1
- package/dist/device/motion.d.ts +14 -14
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +13 -13
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts +10 -7
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +19 -19
- package/dist/device/plug.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts +22 -22
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +44 -44
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts +12 -9
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +20 -20
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts +10 -7
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +11 -11
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts +12 -9
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +29 -29
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/light.d.ts +10 -7
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +13 -13
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts +12 -9
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +17 -17
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts +13 -10
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +25 -25
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts +10 -7
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +13 -13
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts +10 -7
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +16 -16
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/settings.d.ts +4 -1
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js.map +1 -1
- package/package.json +76 -76
- package/src/device/bot.ts +50 -50
- package/src/device/colorbulb.ts +206 -157
- package/src/device/contact.ts +31 -30
- package/src/device/curtain.ts +68 -57
- package/src/device/humidifier.ts +65 -53
- package/src/device/lock.ts +25 -25
- package/src/device/meter.ts +25 -25
- package/src/device/motion.ts +27 -27
- package/src/device/plug.ts +22 -22
- package/src/irdevice/airconditioner.ts +54 -54
- package/src/irdevice/airpurifier.ts +30 -30
- package/src/irdevice/camera.ts +19 -19
- package/src/irdevice/fan.ts +40 -40
- package/src/irdevice/light.ts +23 -23
- package/src/irdevice/other.ts +25 -25
- package/src/irdevice/tv.ts +42 -42
- package/src/irdevice/vacuumcleaner.ts +21 -21
- package/src/irdevice/waterheater.ts +24 -24
- package/src/platform.ts +4 -4
- package/src/settings.ts +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,10 +2,27 @@
|
|
|
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 1.11.2](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.11.2) (2022-01-29)
|
|
6
6
|
|
|
7
7
|
## What's Changed
|
|
8
|
-
*
|
|
8
|
+
* Fix: Use `updateRate` instead of `refreshRate` when overriding `scanDuration`.
|
|
9
|
+
|
|
10
|
+
**Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v1.11.1...v1.11.2
|
|
11
|
+
|
|
12
|
+
## [Version 1.11.1](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.11.1) (2022-01-29)
|
|
13
|
+
|
|
14
|
+
## What's Changed
|
|
15
|
+
* Fix: `This plugin generated a warning from the characteristic 'Brightness': characteristic value expected valid finite number and received "undefined" (undefined)`.
|
|
16
|
+
* Fix: `This plugin generated a warning from the characteristic 'Color Temperature': characteristic value expected valid finite number and received "undefined" (undefined)`.
|
|
17
|
+
* Fix: `This plugin generated a warning from the characteristic 'Hue': characteristic value expected valid finite number and received "undefined" (undefined)`.
|
|
18
|
+
* Fix: `This plugin generated a warning from the characteristic 'Saturation': characteristic value expected valid finite number and received "undefined" (undefined)`.
|
|
19
|
+
|
|
20
|
+
**Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v1.11.0...v1.11.1
|
|
21
|
+
|
|
22
|
+
## [Version 1.11.0](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.11.0) (2022-01-29)
|
|
23
|
+
|
|
24
|
+
## What's Changed
|
|
25
|
+
* Add Support for SwitchBot Smart Lock
|
|
9
26
|
* Add Support for SwitchBot Strip Light
|
|
10
27
|
* Add Support for SwitchBot Meter Plus (US)
|
|
11
28
|
* Add Support for SwitchBot Meter Plus (JP)
|
|
@@ -14,7 +31,7 @@ All notable changes to this project will be documented in this file. This projec
|
|
|
14
31
|
* Fixed: Curtain `set_min` and `set_max` options not work correctly with minimum and maximum curtain state. [#123](https://github.com/OpenWonderLabs/homebridge-switchbot/issues/123)
|
|
15
32
|
* Housekeeping and updated dependencies.
|
|
16
33
|
|
|
17
|
-
**Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v1.10.1...v1.
|
|
34
|
+
**Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v1.10.1...v1.11.0
|
|
18
35
|
|
|
19
36
|
## [Version 1.10.1](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.10.1) (2022-01-26)
|
|
20
37
|
|
package/config.schema.json
CHANGED
|
@@ -128,6 +128,42 @@
|
|
|
128
128
|
"enum": [
|
|
129
129
|
"Smart Fan"
|
|
130
130
|
]
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"title": "Smart Lock",
|
|
134
|
+
"enum": [
|
|
135
|
+
"Smart Lock"
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"title": "Strip Light",
|
|
140
|
+
"enum": [
|
|
141
|
+
"Strip Light"
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"title": "Meter Plus (US)",
|
|
146
|
+
"enum": [
|
|
147
|
+
"Meter Plus (US)"
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"title": "Meter Plus (JP)",
|
|
152
|
+
"enum": [
|
|
153
|
+
"Meter Plus (JP)"
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"title": "Plug Mini (US)",
|
|
158
|
+
"enum": [
|
|
159
|
+
"Plug Mini (US)"
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"title": "Plug Mini (JP)",
|
|
164
|
+
"enum": [
|
|
165
|
+
"Plug Mini (JP)"
|
|
166
|
+
]
|
|
131
167
|
}
|
|
132
168
|
],
|
|
133
169
|
"condition": {
|
|
@@ -457,6 +493,18 @@
|
|
|
457
493
|
}
|
|
458
494
|
}
|
|
459
495
|
},
|
|
496
|
+
"lock": {
|
|
497
|
+
"type": "object",
|
|
498
|
+
"properties": {
|
|
499
|
+
"hide_contactsensor": {
|
|
500
|
+
"title": "Hide Lock's Contact Sensor",
|
|
501
|
+
"type": "boolean",
|
|
502
|
+
"condition": {
|
|
503
|
+
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Smart Lock' && model.options.devices[arrayIndices].deviceId);"
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
},
|
|
460
508
|
"refreshRate": {
|
|
461
509
|
"title": "Device Refresh Rate",
|
|
462
510
|
"type": "number",
|
|
@@ -938,6 +986,7 @@
|
|
|
938
986
|
"options.devices[].motion.set_maxlux",
|
|
939
987
|
"options.devices[].colorbulb.set_minStep",
|
|
940
988
|
"options.devices[].colorbulb.adaptiveLightingShift",
|
|
989
|
+
"options.devices[].lock.hide_contactsensor",
|
|
941
990
|
"options.devices[].refreshRate",
|
|
942
991
|
"options.devices[].logging"
|
|
943
992
|
]
|
package/dist/device/bot.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
1
2
|
import { Subject } from 'rxjs';
|
|
2
3
|
import { SwitchBotPlatform } from '../platform';
|
|
3
|
-
import { PlatformAccessory, CharacteristicValue } from 'homebridge';
|
|
4
|
+
import { Service, PlatformAccessory, CharacteristicValue } from 'homebridge';
|
|
4
5
|
import { device, devicesConfig, serviceData, switchbot, deviceStatusResponse, deviceStatus } from '../settings';
|
|
5
6
|
/**
|
|
6
7
|
* Platform Accessory
|
|
@@ -11,17 +12,17 @@ export declare class Bot {
|
|
|
11
12
|
private readonly platform;
|
|
12
13
|
private accessory;
|
|
13
14
|
device: device & devicesConfig;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
fanService?: Service;
|
|
16
|
+
doorService?: Service;
|
|
17
|
+
lockService?: Service;
|
|
18
|
+
faucetService?: Service;
|
|
19
|
+
windowService?: Service;
|
|
20
|
+
switchService?: Service;
|
|
21
|
+
outletService?: Service;
|
|
22
|
+
batteryService?: Service;
|
|
23
|
+
garageDoorService?: Service;
|
|
24
|
+
windowCoveringService?: Service;
|
|
25
|
+
statefulProgrammableSwitchService?: Service;
|
|
25
26
|
On: CharacteristicValue;
|
|
26
27
|
OnCached: CharacteristicValue;
|
|
27
28
|
BatteryLevel: CharacteristicValue;
|
|
@@ -48,14 +49,14 @@ export declare class Bot {
|
|
|
48
49
|
* Parse the device status from the SwitchBot api
|
|
49
50
|
*/
|
|
50
51
|
parseStatus(): Promise<void>;
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
BLEparseStatus(): Promise<void>;
|
|
53
|
+
openAPIparseStatus(): Promise<void>;
|
|
53
54
|
/**
|
|
54
55
|
* Asks the SwitchBot API for the latest device information
|
|
55
56
|
*/
|
|
56
57
|
refreshStatus(): Promise<void>;
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
BLERefreshStatus(): Promise<void>;
|
|
59
|
+
openAPIRefreshStatus(): Promise<void>;
|
|
59
60
|
/**
|
|
60
61
|
* Pushes the requested changes to the SwitchBot API
|
|
61
62
|
* deviceType commandType Command command parameter Description
|
|
@@ -64,36 +65,38 @@ export declare class Bot {
|
|
|
64
65
|
* Bot - "command" "press" "default" = trigger press
|
|
65
66
|
*/
|
|
66
67
|
pushChanges(): Promise<void>;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
BLEpushChanges(): Promise<void>;
|
|
69
|
+
turnOnOff(device_list: any): Promise<any>;
|
|
70
|
+
openAPIpushChanges(): Promise<void>;
|
|
70
71
|
/**
|
|
71
72
|
* Updates the status for each of the HomeKit Characteristics
|
|
72
73
|
*/
|
|
73
|
-
updateHomeKitCharacteristics(): void
|
|
74
|
-
apiError(e: any): void
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
updateHomeKitCharacteristics(): Promise<void>;
|
|
75
|
+
apiError(e: any): Promise<void>;
|
|
76
|
+
statusCode(push: AxiosResponse<{
|
|
77
|
+
statusCode: number;
|
|
78
|
+
}>): Promise<void>;
|
|
79
|
+
offlineOff(): Promise<void>;
|
|
77
80
|
/**
|
|
78
81
|
* Handle requests to set the "On" characteristic
|
|
79
82
|
*/
|
|
80
|
-
handleOnSet(value: CharacteristicValue): void
|
|
81
|
-
config(device: device & devicesConfig): void
|
|
82
|
-
refreshRate(device: device & devicesConfig): void
|
|
83
|
-
scan(device: device & devicesConfig): void
|
|
84
|
-
logs(device: device & devicesConfig): void
|
|
85
|
-
PressOrSwitch(device: device & devicesConfig): void
|
|
86
|
-
allowPushChanges(device: device & devicesConfig): void
|
|
87
|
-
removeOutletService(accessory: PlatformAccessory): void
|
|
88
|
-
removeGarageDoorService(accessory: PlatformAccessory): void
|
|
89
|
-
removeDoorService(accessory: PlatformAccessory): void
|
|
90
|
-
removeLockService(accessory: PlatformAccessory): void
|
|
91
|
-
removeFaucetService(accessory: PlatformAccessory): void
|
|
92
|
-
removeFanService(accessory: PlatformAccessory): void
|
|
93
|
-
removeWindowService(accessory: PlatformAccessory): void
|
|
94
|
-
removeWindowCoveringService(accessory: PlatformAccessory): void
|
|
95
|
-
removeStatefulProgrammableSwitchService(accessory: PlatformAccessory): void
|
|
96
|
-
removeSwitchService(accessory: PlatformAccessory): void
|
|
83
|
+
handleOnSet(value: CharacteristicValue): Promise<void>;
|
|
84
|
+
config(device: device & devicesConfig): Promise<void>;
|
|
85
|
+
refreshRate(device: device & devicesConfig): Promise<void>;
|
|
86
|
+
scan(device: device & devicesConfig): Promise<void>;
|
|
87
|
+
logs(device: device & devicesConfig): Promise<void>;
|
|
88
|
+
PressOrSwitch(device: device & devicesConfig): Promise<void>;
|
|
89
|
+
allowPushChanges(device: device & devicesConfig): Promise<void>;
|
|
90
|
+
removeOutletService(accessory: PlatformAccessory): Promise<void>;
|
|
91
|
+
removeGarageDoorService(accessory: PlatformAccessory): Promise<void>;
|
|
92
|
+
removeDoorService(accessory: PlatformAccessory): Promise<void>;
|
|
93
|
+
removeLockService(accessory: PlatformAccessory): Promise<void>;
|
|
94
|
+
removeFaucetService(accessory: PlatformAccessory): Promise<void>;
|
|
95
|
+
removeFanService(accessory: PlatformAccessory): Promise<void>;
|
|
96
|
+
removeWindowService(accessory: PlatformAccessory): Promise<void>;
|
|
97
|
+
removeWindowCoveringService(accessory: PlatformAccessory): Promise<void>;
|
|
98
|
+
removeStatefulProgrammableSwitchService(accessory: PlatformAccessory): Promise<void>;
|
|
99
|
+
removeSwitchService(accessory: PlatformAccessory): Promise<void>;
|
|
97
100
|
/**
|
|
98
101
|
* Logging for Device
|
|
99
102
|
*/
|
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":"
|
|
1
|
+
{"version":3,"file":"bot.d.ts","sourceRoot":"","sources":["../../src/device/bot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAY,OAAO,EAAE,MAAM,MAAM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SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAStE;;OAEG;IACH,OAAO,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAM5B,OAAO,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAM5B,QAAQ,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAM7B,QAAQ,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAU7B,qBAAqB,IAAI,OAAO;CAGjC"}
|
package/dist/device/bot.js
CHANGED
|
@@ -274,8 +274,8 @@ class Bot {
|
|
|
274
274
|
// Start an update interval
|
|
275
275
|
(0, rxjs_1.interval)(this.deviceRefreshRate * 1000)
|
|
276
276
|
.pipe((0, operators_1.skipWhile)(() => this.botUpdateInProgress))
|
|
277
|
-
.subscribe(() => {
|
|
278
|
-
this.refreshStatus();
|
|
277
|
+
.subscribe(async () => {
|
|
278
|
+
await this.refreshStatus();
|
|
279
279
|
});
|
|
280
280
|
// Watch for Bot change events
|
|
281
281
|
// We put in a debounce of 100ms so we don't make duplicate calls
|
|
@@ -495,8 +495,8 @@ class Bot {
|
|
|
495
495
|
(0, rxjs_1.interval)(5000)
|
|
496
496
|
.pipe((0, operators_1.skipWhile)(() => this.botUpdateInProgress))
|
|
497
497
|
.pipe((0, operators_1.take)(1))
|
|
498
|
-
.subscribe(() => {
|
|
499
|
-
this.refreshStatus();
|
|
498
|
+
.subscribe(async () => {
|
|
499
|
+
await this.refreshStatus();
|
|
500
500
|
});
|
|
501
501
|
}
|
|
502
502
|
async BLEpushChanges() {
|
|
@@ -591,7 +591,7 @@ class Bot {
|
|
|
591
591
|
this.OnCached = this.On;
|
|
592
592
|
this.accessory.context.On = this.OnCached;
|
|
593
593
|
}
|
|
594
|
-
turnOnOff(device_list) {
|
|
594
|
+
async turnOnOff(device_list) {
|
|
595
595
|
if (this.On) {
|
|
596
596
|
return device_list[0].turnOn({ id: this.device.bleMac });
|
|
597
597
|
}
|
|
@@ -651,7 +651,7 @@ class Bot {
|
|
|
651
651
|
/**
|
|
652
652
|
* Updates the status for each of the HomeKit Characteristics
|
|
653
653
|
*/
|
|
654
|
-
updateHomeKitCharacteristics() {
|
|
654
|
+
async updateHomeKitCharacteristics() {
|
|
655
655
|
if (this.device.bot?.deviceType === 'garagedoor') {
|
|
656
656
|
if (this.On === undefined) {
|
|
657
657
|
this.debugLog(`Bot: ${this.accessory.displayName} On: ${this.On}`);
|
|
@@ -833,7 +833,7 @@ class Bot {
|
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
835
|
}
|
|
836
|
-
apiError(e) {
|
|
836
|
+
async apiError(e) {
|
|
837
837
|
if (this.device.bot?.deviceType === 'garagedoor') {
|
|
838
838
|
this.garageDoorService?.updateCharacteristic(this.platform.Characteristic.TargetDoorState, e);
|
|
839
839
|
this.garageDoorService?.updateCharacteristic(this.platform.Characteristic.CurrentDoorState, e);
|
|
@@ -880,7 +880,7 @@ class Bot {
|
|
|
880
880
|
}
|
|
881
881
|
//throw new this.platform.api.hap.HapStatusError(HAPStatus.SERVICE_COMMUNICATION_FAILURE);
|
|
882
882
|
}
|
|
883
|
-
statusCode(push) {
|
|
883
|
+
async statusCode(push) {
|
|
884
884
|
switch (push.data.statusCode) {
|
|
885
885
|
case 151:
|
|
886
886
|
this.errorLog(`Bot: ${this.accessory.displayName} Command not supported by this device type.`);
|
|
@@ -910,7 +910,7 @@ class Bot {
|
|
|
910
910
|
this.debugLog(`Bot: ${this.accessory.displayName} Unknown statusCode.`);
|
|
911
911
|
}
|
|
912
912
|
}
|
|
913
|
-
offlineOff() {
|
|
913
|
+
async offlineOff() {
|
|
914
914
|
if (this.device.offline) {
|
|
915
915
|
this.On = false;
|
|
916
916
|
if (this.device.bot?.deviceType === 'switch') {
|
|
@@ -924,7 +924,7 @@ class Bot {
|
|
|
924
924
|
/**
|
|
925
925
|
* Handle requests to set the "On" characteristic
|
|
926
926
|
*/
|
|
927
|
-
handleOnSet(value) {
|
|
927
|
+
async handleOnSet(value) {
|
|
928
928
|
if (this.device.bot?.deviceType === 'garagedoor') {
|
|
929
929
|
this.debugLog(`Bot: ${this.accessory.displayName} TargetDoorState: ${value}`);
|
|
930
930
|
if (value === this.platform.Characteristic.TargetDoorState.CLOSED) {
|
|
@@ -978,7 +978,7 @@ class Bot {
|
|
|
978
978
|
}
|
|
979
979
|
this.doBotUpdate.next();
|
|
980
980
|
}
|
|
981
|
-
config(device) {
|
|
981
|
+
async config(device) {
|
|
982
982
|
let config = {};
|
|
983
983
|
if (device.bot) {
|
|
984
984
|
config = device.bot;
|
|
@@ -1002,7 +1002,7 @@ class Bot {
|
|
|
1002
1002
|
this.warnLog(`Bot: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
1003
1003
|
}
|
|
1004
1004
|
}
|
|
1005
|
-
refreshRate(device) {
|
|
1005
|
+
async refreshRate(device) {
|
|
1006
1006
|
if (device.refreshRate) {
|
|
1007
1007
|
this.deviceRefreshRate = this.accessory.context.refreshRate = device.refreshRate;
|
|
1008
1008
|
this.debugLog(`Bot: ${this.accessory.displayName} Using Device Config refreshRate: ${this.deviceRefreshRate}`);
|
|
@@ -1012,7 +1012,7 @@ class Bot {
|
|
|
1012
1012
|
this.debugLog(`Bot: ${this.accessory.displayName} Using Platform Config refreshRate: ${this.deviceRefreshRate}`);
|
|
1013
1013
|
}
|
|
1014
1014
|
}
|
|
1015
|
-
scan(device) {
|
|
1015
|
+
async scan(device) {
|
|
1016
1016
|
if (device.scanDuration) {
|
|
1017
1017
|
this.scanDuration = this.accessory.context.scanDuration = device.scanDuration;
|
|
1018
1018
|
if (device.ble) {
|
|
@@ -1026,7 +1026,7 @@ class Bot {
|
|
|
1026
1026
|
}
|
|
1027
1027
|
}
|
|
1028
1028
|
}
|
|
1029
|
-
logs(device) {
|
|
1029
|
+
async logs(device) {
|
|
1030
1030
|
if (this.platform.debugMode) {
|
|
1031
1031
|
this.deviceLogging = this.accessory.context.logging = 'debugMode';
|
|
1032
1032
|
this.debugLog(`Bot: ${this.accessory.displayName} Using Debug Mode Logging: ${this.deviceLogging}`);
|
|
@@ -1044,7 +1044,7 @@ class Bot {
|
|
|
1044
1044
|
this.debugLog(`Bot: ${this.accessory.displayName} Logging Not Set, Using: ${this.deviceLogging}`);
|
|
1045
1045
|
}
|
|
1046
1046
|
}
|
|
1047
|
-
PressOrSwitch(device) {
|
|
1047
|
+
async PressOrSwitch(device) {
|
|
1048
1048
|
if (!device.bot?.mode) {
|
|
1049
1049
|
this.botMode = 'switch';
|
|
1050
1050
|
this.warnLog(`Bot: ${this.accessory.displayName} does not have bot mode set in the Plugin's SwitchBot Device Settings,`);
|
|
@@ -1062,7 +1062,7 @@ class Bot {
|
|
|
1062
1062
|
throw new Error(`Bot: ${this.accessory.displayName} Bot Mode: ${this.botMode}`);
|
|
1063
1063
|
}
|
|
1064
1064
|
}
|
|
1065
|
-
allowPushChanges(device) {
|
|
1065
|
+
async allowPushChanges(device) {
|
|
1066
1066
|
if (device.bot?.allowPush) {
|
|
1067
1067
|
this.allowPush = true;
|
|
1068
1068
|
}
|
|
@@ -1071,7 +1071,7 @@ class Bot {
|
|
|
1071
1071
|
}
|
|
1072
1072
|
this.debugLog(`Bot: ${this.accessory.displayName} Allowing Push Changes: ${this.allowPush}`);
|
|
1073
1073
|
}
|
|
1074
|
-
removeOutletService(accessory) {
|
|
1074
|
+
async removeOutletService(accessory) {
|
|
1075
1075
|
// If outletService still pressent, then remove first
|
|
1076
1076
|
this.outletService = this.accessory.getService(this.platform.Service.Outlet);
|
|
1077
1077
|
if (this.outletService) {
|
|
@@ -1079,7 +1079,7 @@ class Bot {
|
|
|
1079
1079
|
}
|
|
1080
1080
|
accessory.removeService(this.outletService);
|
|
1081
1081
|
}
|
|
1082
|
-
removeGarageDoorService(accessory) {
|
|
1082
|
+
async removeGarageDoorService(accessory) {
|
|
1083
1083
|
// If garageDoorService still pressent, then remove first
|
|
1084
1084
|
this.garageDoorService = this.accessory.getService(this.platform.Service.GarageDoorOpener);
|
|
1085
1085
|
if (this.garageDoorService) {
|
|
@@ -1087,7 +1087,7 @@ class Bot {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
accessory.removeService(this.garageDoorService);
|
|
1089
1089
|
}
|
|
1090
|
-
removeDoorService(accessory) {
|
|
1090
|
+
async removeDoorService(accessory) {
|
|
1091
1091
|
// If doorService still pressent, then remove first
|
|
1092
1092
|
this.doorService = this.accessory.getService(this.platform.Service.Door);
|
|
1093
1093
|
if (this.doorService) {
|
|
@@ -1095,7 +1095,7 @@ class Bot {
|
|
|
1095
1095
|
}
|
|
1096
1096
|
accessory.removeService(this.doorService);
|
|
1097
1097
|
}
|
|
1098
|
-
removeLockService(accessory) {
|
|
1098
|
+
async removeLockService(accessory) {
|
|
1099
1099
|
// If lockService still pressent, then remove first
|
|
1100
1100
|
this.lockService = this.accessory.getService(this.platform.Service.LockMechanism);
|
|
1101
1101
|
if (this.lockService) {
|
|
@@ -1103,7 +1103,7 @@ class Bot {
|
|
|
1103
1103
|
}
|
|
1104
1104
|
accessory.removeService(this.lockService);
|
|
1105
1105
|
}
|
|
1106
|
-
removeFaucetService(accessory) {
|
|
1106
|
+
async removeFaucetService(accessory) {
|
|
1107
1107
|
// If faucetService still pressent, then remove first
|
|
1108
1108
|
this.faucetService = this.accessory.getService(this.platform.Service.Faucet);
|
|
1109
1109
|
if (this.faucetService) {
|
|
@@ -1111,7 +1111,7 @@ class Bot {
|
|
|
1111
1111
|
}
|
|
1112
1112
|
accessory.removeService(this.faucetService);
|
|
1113
1113
|
}
|
|
1114
|
-
removeFanService(accessory) {
|
|
1114
|
+
async removeFanService(accessory) {
|
|
1115
1115
|
// If fanService still pressent, then remove first
|
|
1116
1116
|
this.fanService = this.accessory.getService(this.platform.Service.Fan);
|
|
1117
1117
|
if (this.fanService) {
|
|
@@ -1119,7 +1119,7 @@ class Bot {
|
|
|
1119
1119
|
}
|
|
1120
1120
|
accessory.removeService(this.fanService);
|
|
1121
1121
|
}
|
|
1122
|
-
removeWindowService(accessory) {
|
|
1122
|
+
async removeWindowService(accessory) {
|
|
1123
1123
|
// If windowService still pressent, then remove first
|
|
1124
1124
|
this.windowService = this.accessory.getService(this.platform.Service.Window);
|
|
1125
1125
|
if (this.windowService) {
|
|
@@ -1127,7 +1127,7 @@ class Bot {
|
|
|
1127
1127
|
}
|
|
1128
1128
|
accessory.removeService(this.windowService);
|
|
1129
1129
|
}
|
|
1130
|
-
removeWindowCoveringService(accessory) {
|
|
1130
|
+
async removeWindowCoveringService(accessory) {
|
|
1131
1131
|
// If windowCoveringService still pressent, then remove first
|
|
1132
1132
|
this.windowCoveringService = this.accessory.getService(this.platform.Service.WindowCovering);
|
|
1133
1133
|
if (this.windowCoveringService) {
|
|
@@ -1135,7 +1135,7 @@ class Bot {
|
|
|
1135
1135
|
}
|
|
1136
1136
|
accessory.removeService(this.windowCoveringService);
|
|
1137
1137
|
}
|
|
1138
|
-
removeStatefulProgrammableSwitchService(accessory) {
|
|
1138
|
+
async removeStatefulProgrammableSwitchService(accessory) {
|
|
1139
1139
|
// If statefulProgrammableSwitchService still pressent, then remove first
|
|
1140
1140
|
this.statefulProgrammableSwitchService = this.accessory.getService(this.platform.Service.StatefulProgrammableSwitch);
|
|
1141
1141
|
if (this.statefulProgrammableSwitchService) {
|
|
@@ -1143,7 +1143,7 @@ class Bot {
|
|
|
1143
1143
|
}
|
|
1144
1144
|
accessory.removeService(this.statefulProgrammableSwitchService);
|
|
1145
1145
|
}
|
|
1146
|
-
removeSwitchService(accessory) {
|
|
1146
|
+
async removeSwitchService(accessory) {
|
|
1147
1147
|
// If switchService still pressent, then remove first
|
|
1148
1148
|
this.switchService = this.accessory.getService(this.platform.Service.Switch);
|
|
1149
1149
|
if (this.switchService) {
|