@switchbot/homebridge-switchbot 1.10.2-beta.6 → 1.11.1

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.
Files changed (99) hide show
  1. package/CHANGELOG.md +13 -3
  2. package/config.schema.json +49 -0
  3. package/dist/device/bot.d.ts +43 -40
  4. package/dist/device/bot.d.ts.map +1 -1
  5. package/dist/device/bot.js +26 -26
  6. package/dist/device/bot.js.map +1 -1
  7. package/dist/device/colorbulb.d.ts +25 -21
  8. package/dist/device/colorbulb.d.ts.map +1 -1
  9. package/dist/device/colorbulb.js +176 -140
  10. package/dist/device/colorbulb.js.map +1 -1
  11. package/dist/device/contact.d.ts +15 -15
  12. package/dist/device/contact.d.ts.map +1 -1
  13. package/dist/device/contact.js +14 -13
  14. package/dist/device/contact.js.map +1 -1
  15. package/dist/device/curtain.d.ts +25 -22
  16. package/dist/device/curtain.d.ts.map +1 -1
  17. package/dist/device/curtain.js +50 -37
  18. package/dist/device/curtain.js.map +1 -1
  19. package/dist/device/humidifier.d.ts +23 -20
  20. package/dist/device/humidifier.d.ts.map +1 -1
  21. package/dist/device/humidifier.js +38 -38
  22. package/dist/device/humidifier.js.map +1 -1
  23. package/dist/device/lock.d.ts +16 -13
  24. package/dist/device/lock.d.ts.map +1 -1
  25. package/dist/device/lock.js +19 -19
  26. package/dist/device/lock.js.map +1 -1
  27. package/dist/device/meter.d.ts +15 -15
  28. package/dist/device/meter.d.ts.map +1 -1
  29. package/dist/device/meter.js +11 -11
  30. package/dist/device/meter.js.map +1 -1
  31. package/dist/device/motion.d.ts +14 -14
  32. package/dist/device/motion.d.ts.map +1 -1
  33. package/dist/device/motion.js +13 -13
  34. package/dist/device/motion.js.map +1 -1
  35. package/dist/device/plug.d.ts +10 -7
  36. package/dist/device/plug.d.ts.map +1 -1
  37. package/dist/device/plug.js +19 -19
  38. package/dist/device/plug.js.map +1 -1
  39. package/dist/irdevice/airconditioner.d.ts +22 -22
  40. package/dist/irdevice/airconditioner.d.ts.map +1 -1
  41. package/dist/irdevice/airconditioner.js +44 -44
  42. package/dist/irdevice/airconditioner.js.map +1 -1
  43. package/dist/irdevice/airpurifier.d.ts +12 -9
  44. package/dist/irdevice/airpurifier.d.ts.map +1 -1
  45. package/dist/irdevice/airpurifier.js +20 -20
  46. package/dist/irdevice/airpurifier.js.map +1 -1
  47. package/dist/irdevice/camera.d.ts +10 -7
  48. package/dist/irdevice/camera.d.ts.map +1 -1
  49. package/dist/irdevice/camera.js +11 -11
  50. package/dist/irdevice/camera.js.map +1 -1
  51. package/dist/irdevice/fan.d.ts +12 -9
  52. package/dist/irdevice/fan.d.ts.map +1 -1
  53. package/dist/irdevice/fan.js +29 -29
  54. package/dist/irdevice/fan.js.map +1 -1
  55. package/dist/irdevice/light.d.ts +10 -7
  56. package/dist/irdevice/light.d.ts.map +1 -1
  57. package/dist/irdevice/light.js +13 -13
  58. package/dist/irdevice/light.js.map +1 -1
  59. package/dist/irdevice/other.d.ts +12 -9
  60. package/dist/irdevice/other.d.ts.map +1 -1
  61. package/dist/irdevice/other.js +17 -17
  62. package/dist/irdevice/other.js.map +1 -1
  63. package/dist/irdevice/tv.d.ts +13 -10
  64. package/dist/irdevice/tv.d.ts.map +1 -1
  65. package/dist/irdevice/tv.js +25 -25
  66. package/dist/irdevice/tv.js.map +1 -1
  67. package/dist/irdevice/vacuumcleaner.d.ts +10 -7
  68. package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
  69. package/dist/irdevice/vacuumcleaner.js +13 -13
  70. package/dist/irdevice/vacuumcleaner.js.map +1 -1
  71. package/dist/irdevice/waterheater.d.ts +10 -7
  72. package/dist/irdevice/waterheater.d.ts.map +1 -1
  73. package/dist/irdevice/waterheater.js +16 -16
  74. package/dist/irdevice/waterheater.js.map +1 -1
  75. package/dist/platform.d.ts.map +1 -1
  76. package/dist/settings.d.ts +4 -1
  77. package/dist/settings.d.ts.map +1 -1
  78. package/dist/settings.js.map +1 -1
  79. package/package.json +76 -76
  80. package/src/device/bot.ts +50 -50
  81. package/src/device/colorbulb.ts +206 -157
  82. package/src/device/contact.ts +31 -30
  83. package/src/device/curtain.ts +68 -57
  84. package/src/device/humidifier.ts +65 -53
  85. package/src/device/lock.ts +27 -27
  86. package/src/device/meter.ts +25 -25
  87. package/src/device/motion.ts +27 -27
  88. package/src/device/plug.ts +22 -22
  89. package/src/irdevice/airconditioner.ts +54 -54
  90. package/src/irdevice/airpurifier.ts +30 -30
  91. package/src/irdevice/camera.ts +19 -19
  92. package/src/irdevice/fan.ts +40 -40
  93. package/src/irdevice/light.ts +23 -23
  94. package/src/irdevice/other.ts +25 -25
  95. package/src/irdevice/tv.ts +42 -42
  96. package/src/irdevice/vacuumcleaner.ts +21 -21
  97. package/src/irdevice/waterheater.ts +24 -24
  98. package/src/platform.ts +4 -4
  99. package/src/settings.ts +5 -1
package/CHANGELOG.md CHANGED
@@ -2,10 +2,20 @@
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.10.2](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.10.1) (2022-01-28)
5
+ ## [Version 1.11.1](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.11.1) (2022-01-29)
6
6
 
7
7
  ## What's Changed
8
- * Add Support for SwitchBot Lock
8
+ * Fix: `This plugin generated a warning from the characteristic 'Brightness': characteristic value expected valid finite number and received "undefined" (undefined)`.
9
+ * Fix: `This plugin generated a warning from the characteristic 'Color Temperature': characteristic value expected valid finite number and received "undefined" (undefined)`.
10
+ * Fix: `This plugin generated a warning from the characteristic 'Hue': characteristic value expected valid finite number and received "undefined" (undefined)`.
11
+ * Fix: `This plugin generated a warning from the characteristic 'Saturation': characteristic value expected valid finite number and received "undefined" (undefined)`.
12
+
13
+ **Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v1.11.0...v1.11.1
14
+
15
+ ## [Version 1.11.0](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.11.0) (2022-01-29)
16
+
17
+ ## What's Changed
18
+ * Add Support for SwitchBot Smart Lock
9
19
  * Add Support for SwitchBot Strip Light
10
20
  * Add Support for SwitchBot Meter Plus (US)
11
21
  * Add Support for SwitchBot Meter Plus (JP)
@@ -14,7 +24,7 @@ All notable changes to this project will be documented in this file. This projec
14
24
  * 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
25
  * Housekeeping and updated dependencies.
16
26
 
17
- **Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v1.10.1...v1.10.2
27
+ **Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v1.10.1...v1.11.0
18
28
 
19
29
  ## [Version 1.10.1](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.10.1) (2022-01-26)
20
30
 
@@ -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
  ]
@@ -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
- private fanService?;
15
- private doorService?;
16
- private lockService?;
17
- private faucetService?;
18
- private windowService?;
19
- private switchService?;
20
- private outletService?;
21
- private batteryService?;
22
- private garageDoorService?;
23
- private windowCoveringService?;
24
- private statefulProgrammableSwitchService?;
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
- private BLEparseStatus;
52
- private openAPIparseStatus;
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
- private BLERefreshStatus;
58
- private openAPIRefreshStatus;
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
- private BLEpushChanges;
68
- private turnOnOff;
69
- private openAPIpushChanges;
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
- private statusCode;
76
- offlineOff(): void;
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
  */
@@ -1 +1 @@
1
- {"version":3,"file":"bot.d.ts","sourceRoot":"","sources":["../../src/device/bot.ts"],"names":[],"mappings":"AACA,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,YAA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CAAC;IAS9D,iBAAiB,CAAC,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAS9D,mBAAmB,CAAC,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAShE,gBAAgB,CAAC,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAS7D,mBAAmB,CAAC,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAShE,2BAA2B,CAAC,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IASxE,uCAAuC,CAAC,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IASpF,mBAAmB,CAAC,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"}
@@ -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) {