@switchbot/homebridge-switchbot 4.1.1-beta.2 → 4.1.1-beta.4

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 (100) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/device/blindtilt.js +103 -103
  3. package/dist/device/blindtilt.js.map +1 -1
  4. package/dist/device/bot.js +84 -84
  5. package/dist/device/bot.js.map +1 -1
  6. package/dist/device/ceilinglight.js +97 -97
  7. package/dist/device/ceilinglight.js.map +1 -1
  8. package/dist/device/colorbulb.js +139 -139
  9. package/dist/device/colorbulb.js.map +1 -1
  10. package/dist/device/contact.js +47 -47
  11. package/dist/device/contact.js.map +1 -1
  12. package/dist/device/curtain.d.ts +1 -1
  13. package/dist/device/curtain.d.ts.map +1 -1
  14. package/dist/device/curtain.js +91 -89
  15. package/dist/device/curtain.js.map +1 -1
  16. package/dist/device/device.d.ts +12 -12
  17. package/dist/device/device.d.ts.map +1 -1
  18. package/dist/device/device.js +42 -42
  19. package/dist/device/device.js.map +1 -1
  20. package/dist/device/fan.js +95 -95
  21. package/dist/device/fan.js.map +1 -1
  22. package/dist/device/hub.js +46 -46
  23. package/dist/device/hub.js.map +1 -1
  24. package/dist/device/humidifier.js +84 -84
  25. package/dist/device/humidifier.js.map +1 -1
  26. package/dist/device/iosensor.js +44 -44
  27. package/dist/device/iosensor.js.map +1 -1
  28. package/dist/device/lightstrip.js +118 -118
  29. package/dist/device/lightstrip.js.map +1 -1
  30. package/dist/device/lock.js +74 -74
  31. package/dist/device/lock.js.map +1 -1
  32. package/dist/device/meter.js +44 -44
  33. package/dist/device/meter.js.map +1 -1
  34. package/dist/device/meterplus.js +42 -42
  35. package/dist/device/meterplus.js.map +1 -1
  36. package/dist/device/meterpro.js +42 -42
  37. package/dist/device/meterpro.js.map +1 -1
  38. package/dist/device/motion.js +44 -44
  39. package/dist/device/motion.js.map +1 -1
  40. package/dist/device/plug.d.ts.map +1 -1
  41. package/dist/device/plug.js +59 -59
  42. package/dist/device/plug.js.map +1 -1
  43. package/dist/device/robotvacuumcleaner.js +73 -73
  44. package/dist/device/robotvacuumcleaner.js.map +1 -1
  45. package/dist/device/waterdetector.js +44 -44
  46. package/dist/device/waterdetector.js.map +1 -1
  47. package/dist/irdevice/airconditioner.js +31 -31
  48. package/dist/irdevice/airconditioner.js.map +1 -1
  49. package/dist/irdevice/airpurifier.js +10 -10
  50. package/dist/irdevice/airpurifier.js.map +1 -1
  51. package/dist/irdevice/camera.js +9 -9
  52. package/dist/irdevice/camera.js.map +1 -1
  53. package/dist/irdevice/fan.js +11 -11
  54. package/dist/irdevice/fan.js.map +1 -1
  55. package/dist/irdevice/irdevice.js +11 -11
  56. package/dist/irdevice/irdevice.js.map +1 -1
  57. package/dist/irdevice/light.js +9 -9
  58. package/dist/irdevice/light.js.map +1 -1
  59. package/dist/irdevice/other.js +55 -55
  60. package/dist/irdevice/other.js.map +1 -1
  61. package/dist/irdevice/tv.js +33 -33
  62. package/dist/irdevice/tv.js.map +1 -1
  63. package/dist/irdevice/vacuumcleaner.js +9 -9
  64. package/dist/irdevice/vacuumcleaner.js.map +1 -1
  65. package/dist/irdevice/waterheater.js +9 -9
  66. package/dist/irdevice/waterheater.js.map +1 -1
  67. package/dist/platform.js +228 -228
  68. package/dist/platform.js.map +1 -1
  69. package/package.json +9 -9
  70. package/src/device/blindtilt.ts +103 -103
  71. package/src/device/bot.ts +84 -84
  72. package/src/device/ceilinglight.ts +97 -97
  73. package/src/device/colorbulb.ts +139 -139
  74. package/src/device/contact.ts +47 -47
  75. package/src/device/curtain.ts +91 -89
  76. package/src/device/device.ts +42 -42
  77. package/src/device/fan.ts +95 -95
  78. package/src/device/hub.ts +46 -46
  79. package/src/device/humidifier.ts +84 -84
  80. package/src/device/iosensor.ts +44 -44
  81. package/src/device/lightstrip.ts +118 -118
  82. package/src/device/lock.ts +74 -74
  83. package/src/device/meter.ts +44 -44
  84. package/src/device/meterplus.ts +42 -42
  85. package/src/device/meterpro.ts +42 -42
  86. package/src/device/motion.ts +44 -44
  87. package/src/device/plug.ts +61 -61
  88. package/src/device/robotvacuumcleaner.ts +73 -73
  89. package/src/device/waterdetector.ts +44 -44
  90. package/src/irdevice/airconditioner.ts +31 -31
  91. package/src/irdevice/airpurifier.ts +10 -10
  92. package/src/irdevice/camera.ts +9 -9
  93. package/src/irdevice/fan.ts +11 -11
  94. package/src/irdevice/irdevice.ts +11 -11
  95. package/src/irdevice/light.ts +9 -9
  96. package/src/irdevice/other.ts +55 -55
  97. package/src/irdevice/tv.ts +33 -33
  98. package/src/irdevice/vacuumcleaner.ts +9 -9
  99. package/src/irdevice/waterheater.ts +9 -9
  100. package/src/platform.ts +228 -228
@@ -114,54 +114,54 @@ export class Motion extends deviceBase {
114
114
  });
115
115
  }
116
116
  async BLEparseStatus() {
117
- await this.debugLog('BLEparseStatus');
118
- await this.debugLog(`(moveDetected) = BLE: (${this.serviceData.movement}), current: (${this.MotionSensor.MotionDetected})`);
117
+ this.debugLog('BLEparseStatus');
118
+ this.debugLog(`(moveDetected) = BLE: (${this.serviceData.movement}), current: (${this.MotionSensor.MotionDetected})`);
119
119
  // Movement
120
120
  this.MotionSensor.MotionDetected = this.serviceData.movement;
121
- await this.debugLog(`MotionDetected: ${this.MotionSensor.MotionDetected}`);
121
+ this.debugLog(`MotionDetected: ${this.MotionSensor.MotionDetected}`);
122
122
  // CurrentAmbientLightLevel
123
123
  if (!this.device.hide_lightsensor && this.LightSensor?.Service) {
124
124
  const set_minLux = this.device.set_minLux ?? 1;
125
125
  const set_maxLux = this.device.set_maxLux ?? 6001;
126
126
  const lightLevel = this.serviceData.lightLevel === 'bright' ? set_maxLux : set_minLux;
127
- this.LightSensor.CurrentAmbientLightLevel = await this.getLightLevel(lightLevel, set_minLux, set_maxLux, 2);
128
- await this.debugLog(`LightLevel: ${this.serviceData.lightLevel}, CurrentAmbientLightLevel: ${this.LightSensor.CurrentAmbientLightLevel}`);
127
+ this.LightSensor.CurrentAmbientLightLevel = this.getLightLevel(lightLevel, set_minLux, set_maxLux, 2);
128
+ this.debugLog(`LightLevel: ${this.serviceData.lightLevel}, CurrentAmbientLightLevel: ${this.LightSensor.CurrentAmbientLightLevel}`);
129
129
  }
130
130
  // BatteryLevel
131
131
  this.Battery.BatteryLevel = this.serviceData.battery;
132
- await this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`);
132
+ this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`);
133
133
  // StatusLowBattery
134
134
  this.Battery.StatusLowBattery = this.Battery.BatteryLevel < 10
135
135
  ? this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_LOW
136
136
  : this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL;
137
- await this.debugLog(`StatusLowBattery: ${this.Battery.StatusLowBattery}`);
137
+ this.debugLog(`StatusLowBattery: ${this.Battery.StatusLowBattery}`);
138
138
  }
139
139
  async openAPIparseStatus() {
140
- await this.debugLog('openAPIparseStatus');
141
- await this.debugLog(`(moveDetected) = OpenAPI: (${this.deviceStatus.moveDetected}), current: (${this.MotionSensor.MotionDetected})`);
140
+ this.debugLog('openAPIparseStatus');
141
+ this.debugLog(`(moveDetected) = OpenAPI: (${this.deviceStatus.moveDetected}), current: (${this.MotionSensor.MotionDetected})`);
142
142
  // Motion State
143
143
  this.MotionSensor.MotionDetected = this.deviceStatus.moveDetected;
144
- await this.debugLog(`MotionDetected: ${this.MotionSensor.MotionDetected}`);
144
+ this.debugLog(`MotionDetected: ${this.MotionSensor.MotionDetected}`);
145
145
  // CurrentAmbientLightLevel
146
146
  if (!this.device.hide_lightsensor && this.LightSensor?.Service) {
147
147
  const set_minLux = this.device.set_minLux ?? 1;
148
148
  const set_maxLux = this.device.set_maxLux ?? 6001;
149
149
  const lightLevel = this.deviceStatus.brightness === 'bright' ? set_maxLux : set_minLux;
150
- this.LightSensor.CurrentAmbientLightLevel = await this.getLightLevel(lightLevel, set_minLux, set_maxLux, 2);
151
- await this.debugLog(`LightLevel: ${this.deviceStatus.brightness}, CurrentAmbientLightLevel: ${this.LightSensor.CurrentAmbientLightLevel}`);
150
+ this.LightSensor.CurrentAmbientLightLevel = this.getLightLevel(lightLevel, set_minLux, set_maxLux, 2);
151
+ this.debugLog(`LightLevel: ${this.deviceStatus.brightness}, CurrentAmbientLightLevel: ${this.LightSensor.CurrentAmbientLightLevel}`);
152
152
  }
153
153
  // BatteryLevel
154
154
  this.Battery.BatteryLevel = this.deviceStatus.battery;
155
- await this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`);
155
+ this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`);
156
156
  // StatusLowBattery
157
157
  this.Battery.StatusLowBattery = this.Battery.BatteryLevel < 10
158
158
  ? this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_LOW
159
159
  : this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL;
160
- await this.debugLog(`StatusLowBattery: ${this.Battery.StatusLowBattery}`);
160
+ this.debugLog(`StatusLowBattery: ${this.Battery.StatusLowBattery}`);
161
161
  // FirmwareVersion
162
162
  if (this.deviceStatus.version) {
163
163
  const version = this.deviceStatus.version.toString();
164
- await this.debugLog(`Firmware Version: ${version.replace(/^V|-.*$/g, '')}`);
164
+ this.debugLog(`Firmware Version: ${version.replace(/^V|-.*$/g, '')}`);
165
165
  const deviceVersion = version.replace(/^V|-.*$/g, '') ?? '0.0.0';
166
166
  this.accessory
167
167
  .getService(this.hap.Service.AccessoryInformation)
@@ -170,22 +170,22 @@ export class Motion extends deviceBase {
170
170
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
171
171
  .updateValue(deviceVersion);
172
172
  this.accessory.context.version = deviceVersion;
173
- await this.debugLog(`version: ${this.accessory.context.version}`);
173
+ this.debugLog(`version: ${this.accessory.context.version}`);
174
174
  }
175
175
  }
176
176
  async parseStatusWebhook() {
177
- await this.debugLog('parseStatusWebhook');
178
- await this.debugLog(`(detectionState) = Webhook: (${this.webhookContext.detectionState}), current: (${this.MotionSensor.MotionDetected})`);
177
+ this.debugLog('parseStatusWebhook');
178
+ this.debugLog(`(detectionState) = Webhook: (${this.webhookContext.detectionState}), current: (${this.MotionSensor.MotionDetected})`);
179
179
  // MotionDetected
180
180
  this.MotionSensor.MotionDetected = this.webhookContext.detectionState === 'DETECTED';
181
- await this.debugLog(`MotionDetected: ${this.MotionSensor.MotionDetected}`);
181
+ this.debugLog(`MotionDetected: ${this.MotionSensor.MotionDetected}`);
182
182
  }
183
183
  /**
184
184
  * Asks the SwitchBot API for the latest device information
185
185
  */
186
186
  async refreshStatus() {
187
187
  if (!this.device.enableCloudService && this.OpenAPI) {
188
- await this.errorLog(`refreshStatus enableCloudService: ${this.device.enableCloudService}`);
188
+ this.errorLog(`refreshStatus enableCloudService: ${this.device.enableCloudService}`);
189
189
  }
190
190
  else if (this.BLE) {
191
191
  await this.BLERefreshStatus();
@@ -195,11 +195,11 @@ export class Motion extends deviceBase {
195
195
  }
196
196
  else {
197
197
  await this.offlineOff();
198
- await this.debugWarnLog(`Connection Type: ${this.device.connectionType}, refreshStatus will not happen.`);
198
+ this.debugWarnLog(`Connection Type: ${this.device.connectionType}, refreshStatus will not happen.`);
199
199
  }
200
200
  }
201
201
  async BLERefreshStatus() {
202
- await this.debugLog('BLERefreshStatus');
202
+ this.debugLog('BLERefreshStatus');
203
203
  const switchBotBLE = await this.switchbotBLE();
204
204
  if (switchBotBLE === undefined) {
205
205
  await this.BLERefreshConnection(switchBotBLE);
@@ -216,79 +216,79 @@ export class Motion extends deviceBase {
216
216
  await this.updateHomeKitCharacteristics();
217
217
  }
218
218
  else {
219
- await this.errorLog(`failed to get serviceData, serviceData: ${JSON.stringify(serviceData)}`);
219
+ this.errorLog(`failed to get serviceData, serviceData: ${JSON.stringify(serviceData)}`);
220
220
  await this.BLERefreshConnection(switchBotBLE);
221
221
  }
222
222
  })();
223
223
  }
224
224
  }
225
225
  async registerPlatformBLE() {
226
- await this.debugLog('registerPlatformBLE');
226
+ this.debugLog('registerPlatformBLE');
227
227
  if (this.config.options?.BLE) {
228
- await this.debugLog('is listening to Platform BLE.');
228
+ this.debugLog('is listening to Platform BLE.');
229
229
  try {
230
230
  const formattedDeviceId = formatDeviceIdAsMac(this.device.deviceId);
231
231
  this.device.bleMac = formattedDeviceId;
232
- await this.debugLog(`bleMac: ${this.device.bleMac}`);
232
+ this.debugLog(`bleMac: ${this.device.bleMac}`);
233
233
  this.platform.bleEventHandler[this.device.bleMac] = async (context) => {
234
234
  try {
235
- await this.debugLog(`received BLE: ${JSON.stringify(context)}`);
235
+ this.debugLog(`received BLE: ${JSON.stringify(context)}`);
236
236
  this.serviceData = context;
237
237
  await this.BLEparseStatus();
238
238
  await this.updateHomeKitCharacteristics();
239
239
  }
240
240
  catch (e) {
241
- await this.errorLog(`failed to handle BLE. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`);
241
+ this.errorLog(`failed to handle BLE. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`);
242
242
  }
243
243
  };
244
244
  }
245
245
  catch (error) {
246
- await this.errorLog(`failed to format device ID as MAC, Error: ${error}`);
246
+ this.errorLog(`failed to format device ID as MAC, Error: ${error}`);
247
247
  }
248
248
  }
249
249
  else {
250
- await this.debugLog('is not listening to Platform BLE');
250
+ this.debugLog('is not listening to Platform BLE');
251
251
  }
252
252
  }
253
253
  async openAPIRefreshStatus() {
254
- await this.debugLog('openAPIRefreshStatus');
254
+ this.debugLog('openAPIRefreshStatus');
255
255
  try {
256
- const { body } = await this.deviceRefreshStatus();
257
- const deviceStatus = await body;
258
- await this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
256
+ const response = await this.deviceRefreshStatus();
257
+ const deviceStatus = response.body;
258
+ this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
259
259
  if (await this.successfulStatusCodes(deviceStatus)) {
260
- await this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
260
+ this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
261
261
  this.deviceStatus = deviceStatus.body;
262
262
  await this.openAPIparseStatus();
263
263
  await this.updateHomeKitCharacteristics();
264
264
  }
265
265
  else {
266
- await this.debugWarnLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
267
- await this.debugWarnLog(deviceStatus);
266
+ this.debugWarnLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
267
+ this.debugWarnLog(deviceStatus);
268
268
  }
269
269
  }
270
270
  catch (e) {
271
271
  await this.apiError(e);
272
- await this.errorLog(`failed openAPIRefreshStatus with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`);
272
+ this.errorLog(`failed openAPIRefreshStatus with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`);
273
273
  }
274
274
  }
275
275
  async registerWebhook() {
276
276
  if (this.device.webhook) {
277
- await this.debugLog('is listening webhook.');
277
+ this.debugLog('is listening webhook.');
278
278
  this.platform.webhookEventHandler[this.device.deviceId] = async (context) => {
279
279
  try {
280
- await this.debugLog(`received Webhook: ${JSON.stringify(context)}`);
280
+ this.debugLog(`received Webhook: ${JSON.stringify(context)}`);
281
281
  this.webhookContext = context;
282
282
  await this.parseStatusWebhook();
283
283
  await this.updateHomeKitCharacteristics();
284
284
  }
285
285
  catch (e) {
286
- await this.errorLog(`failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`);
286
+ this.errorLog(`failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`);
287
287
  }
288
288
  };
289
289
  }
290
290
  else {
291
- await this.debugLog('is not listening webhook.');
291
+ this.debugLog('is not listening webhook.');
292
292
  }
293
293
  }
294
294
  /**
@@ -307,9 +307,9 @@ export class Motion extends deviceBase {
307
307
  }
308
308
  }
309
309
  async BLERefreshConnection(switchbot) {
310
- await this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${switchbot}`);
310
+ this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${switchbot}`);
311
311
  if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
312
- await this.warnLog('Using OpenAPI Connection to Refresh Status');
312
+ this.warnLog('Using OpenAPI Connection to Refresh Status');
313
313
  await this.openAPIRefreshStatus();
314
314
  }
315
315
  }
@@ -1 +1 @@
1
- {"version":3,"file":"motion.js","sourceRoot":"","sources":["../../src/device/motion.ts"],"names":[],"mappings":"AAUA;;;EAGE;AACF,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AACzE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,UAAU;IAmCzB;IAlCX,WAAW;IACH,OAAO,CAKd;IAEO,YAAY,CAInB;IAEO,WAAW,CAIlB;IAED,UAAU;IACV,YAAY,CAAqB;IAEjC,UAAU;IACV,cAAc,CAA6B;IAE3C,MAAM;IACN,WAAW,CAA0B;IAErC,UAAU;IACV,uBAAuB,CAAU;IACjC,cAAc,CAAgB;IAE9B,YACW,QAA2B,EACpC,SAA4B,EAC5B,MAA8B;QAE9B,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;QAJzB,aAAQ,GAAR,QAAQ,CAAmB;QAKpC,eAAe;QACf,SAAS,CAAC,QAAQ,sCAA6B,CAAA;QAE/C,oFAAoF;QACpF,IAAI,CAAC,cAAc,GAAG,IAAI,OAAO,EAAE,CAAA;QACnC,IAAI,CAAC,uBAAuB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zC;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAa9B,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAwBjC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IA0BpC,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAqBrC,eAAe;IAkBrB;;;;;;;;OAQG;IAEG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAoB5B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IA+C/B,kBAAkB;IA6BxB;;OAEG;IACG,KAAK,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAWhD,4BAA4B,IAAI,OAAO,CAAC,IAAI,CAAC;IAK7C,iBAAiB;IAOjB,oBAAoB,CAAC,SAAS,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAQnD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAM3B,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtC"}
@@ -81,28 +81,28 @@ export class Plug extends deviceBase {
81
81
  }
82
82
  catch (e) {
83
83
  await this.apiError(e);
84
- await this.errorLog(`failed pushChanges with ${device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`);
84
+ this.errorLog(`failed pushChanges with ${device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`);
85
85
  }
86
86
  this.plugUpdateInProgress = false;
87
87
  });
88
88
  }
89
89
  async BLEparseStatus() {
90
- await this.debugLog('BLEparseStatus');
91
- await this.debugLog(`(powerState) = BLE: (${this.serviceData.state}), current:(${this.Outlet.On})`);
90
+ this.debugLog('BLEparseStatus');
91
+ this.debugLog(`(powerState) = BLE: (${this.serviceData.state}), current:(${this.Outlet.On})`);
92
92
  // On
93
93
  this.Outlet.On = this.serviceData.state === 'on';
94
- await this.debugLog(`On: ${this.Outlet.On}`);
94
+ this.debugLog(`On: ${this.Outlet.On}`);
95
95
  }
96
96
  async openAPIparseStatus() {
97
- await this.debugLog('openAPIparseStatus');
98
- await this.debugLog(`(powerState) = OpenAPI: (${this.deviceStatus.power}), current:(${this.Outlet.On})`);
97
+ this.debugLog('openAPIparseStatus');
98
+ this.debugLog(`(powerState) = OpenAPI: (${this.deviceStatus.power}), current:(${this.Outlet.On})`);
99
99
  // On
100
100
  this.Outlet.On = this.deviceStatus.power === 'on';
101
- await this.debugLog(`On: ${this.Outlet.On}`);
101
+ this.debugLog(`On: ${this.Outlet.On}`);
102
102
  // Firmware Version
103
103
  if (this.deviceStatus.version) {
104
104
  const version = this.deviceStatus.version.toString();
105
- await this.debugLog(`Firmware Version: ${version.replace(/^V|-.*$/g, '')}`);
105
+ this.debugLog(`Firmware Version: ${version.replace(/^V|-.*$/g, '')}`);
106
106
  const deviceVersion = version.replace(/^V|-.*$/g, '') ?? '0.0.0';
107
107
  this.accessory
108
108
  .getService(this.hap.Service.AccessoryInformation)
@@ -111,22 +111,22 @@ export class Plug extends deviceBase {
111
111
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
112
112
  .updateValue(deviceVersion);
113
113
  this.accessory.context.version = deviceVersion;
114
- await this.debugSuccessLog(`version: ${this.accessory.context.version}`);
114
+ this.debugSuccessLog(`version: ${this.accessory.context.version}`);
115
115
  }
116
116
  }
117
117
  async parseStatusWebhook() {
118
- await this.debugLog('parseStatusWebhook');
119
- await this.debugLog(`(powerState) = Webhook: (${this.webhookContext.powerState}), current:(${this.Outlet.On})`);
118
+ this.debugLog('parseStatusWebhook');
119
+ this.debugLog(`(powerState) = Webhook: (${this.webhookContext.powerState}), current:(${this.Outlet.On})`);
120
120
  // On
121
121
  this.Outlet.On = this.webhookContext.powerState === 'ON';
122
- await this.debugLog(`On: ${this.Outlet.On}`);
122
+ this.debugLog(`On: ${this.Outlet.On}`);
123
123
  }
124
124
  /**
125
125
  * Asks the SwitchBot API for the latest device information
126
126
  */
127
127
  async refreshStatus() {
128
128
  if (!this.device.enableCloudService && this.OpenAPI) {
129
- await this.errorLog(`refreshStatus enableCloudService: ${this.device.enableCloudService}`);
129
+ this.errorLog(`refreshStatus enableCloudService: ${this.device.enableCloudService}`);
130
130
  }
131
131
  else if (this.BLE) {
132
132
  await this.BLERefreshStatus();
@@ -136,11 +136,11 @@ export class Plug extends deviceBase {
136
136
  }
137
137
  else {
138
138
  await this.offlineOff();
139
- await this.debugWarnLog(`Connection Type: ${this.device.connectionType}, refreshStatus will not happen.`);
139
+ this.debugWarnLog(`Connection Type: ${this.device.connectionType}, refreshStatus will not happen.`);
140
140
  }
141
141
  }
142
142
  async BLERefreshStatus() {
143
- await this.debugLog('BLERefreshStatus');
143
+ this.debugLog('BLERefreshStatus');
144
144
  const switchBotBLE = await this.switchbotBLE();
145
145
  if (switchBotBLE === undefined) {
146
146
  await this.BLERefreshConnection(switchBotBLE);
@@ -158,79 +158,79 @@ export class Plug extends deviceBase {
158
158
  await this.updateHomeKitCharacteristics();
159
159
  }
160
160
  else {
161
- await this.errorLog(`failed to get serviceData, serviceData: ${JSON.stringify(serviceData)}`);
161
+ this.errorLog(`failed to get serviceData, serviceData: ${JSON.stringify(serviceData)}`);
162
162
  await this.BLERefreshConnection(switchBotBLE);
163
163
  }
164
164
  })();
165
165
  }
166
166
  }
167
167
  async registerPlatformBLE() {
168
- await this.debugLog('registerPlatformBLE');
168
+ this.debugLog('registerPlatformBLE');
169
169
  if (this.config.options?.BLE) {
170
- await this.debugLog('is listening to Platform BLE.');
170
+ this.debugLog('is listening to Platform BLE.');
171
171
  try {
172
172
  const formattedDeviceId = formatDeviceIdAsMac(this.device.deviceId);
173
173
  this.device.bleMac = formattedDeviceId;
174
- await this.debugLog(`bleMac: ${this.device.bleMac}`);
174
+ this.debugLog(`bleMac: ${this.device.bleMac}`);
175
175
  this.platform.bleEventHandler[this.device.bleMac] = async (context) => {
176
176
  try {
177
- await this.debugLog(`received BLE: ${JSON.stringify(context)}`);
177
+ this.debugLog(`received BLE: ${JSON.stringify(context)}`);
178
178
  this.serviceData = context;
179
179
  await this.BLEparseStatus();
180
180
  await this.updateHomeKitCharacteristics();
181
181
  }
182
182
  catch (e) {
183
- await this.errorLog(`failed to handle BLE. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`);
183
+ this.errorLog(`failed to handle BLE. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`);
184
184
  }
185
185
  };
186
186
  }
187
187
  catch (error) {
188
- await this.errorLog(`failed to format device ID as MAC, Error: ${error}`);
188
+ this.errorLog(`failed to format device ID as MAC, Error: ${error}`);
189
189
  }
190
190
  }
191
191
  else {
192
- await this.debugLog('is not listening to Platform BLE');
192
+ this.debugLog('is not listening to Platform BLE');
193
193
  }
194
194
  }
195
195
  async openAPIRefreshStatus() {
196
- await this.debugLog('openAPIRefreshStatus');
196
+ this.debugLog('openAPIRefreshStatus');
197
197
  try {
198
- const { body } = await this.deviceRefreshStatus();
199
- const deviceStatus = await body;
200
- await this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
198
+ const response = await this.deviceRefreshStatus();
199
+ const deviceStatus = response.body;
200
+ this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
201
201
  if (await this.successfulStatusCodes(deviceStatus)) {
202
- await this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
202
+ this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
203
203
  this.deviceStatus = deviceStatus.body;
204
204
  await this.openAPIparseStatus();
205
205
  await this.updateHomeKitCharacteristics();
206
206
  }
207
207
  else {
208
- await this.debugWarnLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
209
- await this.debugWarnLog(deviceStatus);
208
+ this.debugWarnLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
209
+ this.debugWarnLog(deviceStatus);
210
210
  }
211
211
  }
212
212
  catch (e) {
213
213
  await this.apiError(e);
214
- await this.errorLog(`failed openAPIRefreshStatus with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`);
214
+ this.errorLog(`failed openAPIRefreshStatus with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`);
215
215
  }
216
216
  }
217
217
  async registerWebhook() {
218
218
  if (this.device.webhook) {
219
- await this.debugLog('is listening webhook.');
219
+ this.debugLog('is listening webhook.');
220
220
  this.platform.webhookEventHandler[this.device.deviceId] = async (context) => {
221
221
  try {
222
- await this.debugLog(`received Webhook: ${JSON.stringify(context)}`);
222
+ this.debugLog(`received Webhook: ${JSON.stringify(context)}`);
223
223
  this.webhookContext = context;
224
224
  await this.parseStatusWebhook();
225
225
  await this.updateHomeKitCharacteristics();
226
226
  }
227
227
  catch (e) {
228
- await this.errorLog(`failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`);
228
+ this.errorLog(`failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`);
229
229
  }
230
230
  };
231
231
  }
232
232
  else {
233
- await this.debugLog('is not listening webhook.');
233
+ this.debugLog('is not listening webhook.');
234
234
  }
235
235
  }
236
236
  /**
@@ -244,7 +244,7 @@ export class Plug extends deviceBase {
244
244
  */
245
245
  async pushChanges() {
246
246
  if (!this.device.enableCloudService && this.OpenAPI) {
247
- await this.errorLog(`pushChanges enableCloudService: ${this.device.enableCloudService}`);
247
+ this.errorLog(`pushChanges enableCloudService: ${this.device.enableCloudService}`);
248
248
  }
249
249
  else if (this.BLE) {
250
250
  await this.BLEpushChanges();
@@ -254,7 +254,7 @@ export class Plug extends deviceBase {
254
254
  }
255
255
  else {
256
256
  await this.offlineOff();
257
- await this.debugWarnLog(`Connection Type: ${this.device.connectionType}, pushChanges will not happen.`);
257
+ this.debugWarnLog(`Connection Type: ${this.device.connectionType}, pushChanges will not happen.`);
258
258
  }
259
259
  // Refresh the status from the API
260
260
  interval(15000)
@@ -265,20 +265,20 @@ export class Plug extends deviceBase {
265
265
  });
266
266
  }
267
267
  async BLEpushChanges() {
268
- await this.debugLog('BLEpushChanges');
268
+ this.debugLog('BLEpushChanges');
269
269
  if (this.Outlet.On !== this.accessory.context.On) {
270
- await this.debugLog(`BLEpushChanges On: ${this.Outlet.On}, OnCached: ${this.accessory.context.On}`);
270
+ this.debugLog(`BLEpushChanges On: ${this.Outlet.On}, OnCached: ${this.accessory.context.On}`);
271
271
  const switchBotBLE = await this.platform.connectBLE(this.accessory, this.device);
272
272
  try {
273
273
  const formattedDeviceId = formatDeviceIdAsMac(this.device.deviceId);
274
274
  this.device.bleMac = formattedDeviceId;
275
- await this.debugLog(`bleMac: ${this.device.bleMac}`);
275
+ this.debugLog(`bleMac: ${this.device.bleMac}`);
276
276
  if (switchBotBLE !== false) {
277
277
  switchBotBLE
278
278
  .discover({ model: this.device.bleModel, id: this.device.bleMac })
279
279
  .then(async (device_list) => {
280
280
  const deviceList = device_list;
281
- await this.infoLog(`On: ${this.Outlet.On}`);
281
+ this.infoLog(`On: ${this.Outlet.On}`);
282
282
  return await this.retryBLE({
283
283
  max: await this.maxRetryBLE(),
284
284
  fn: async () => {
@@ -292,30 +292,30 @@ export class Plug extends deviceBase {
292
292
  });
293
293
  })
294
294
  .then(async () => {
295
- await this.successLog(`On: ${this.Outlet.On} sent over SwitchBot BLE, sent successfully`);
295
+ this.successLog(`On: ${this.Outlet.On} sent over SwitchBot BLE, sent successfully`);
296
296
  await this.updateHomeKitCharacteristics();
297
297
  })
298
298
  .catch(async (e) => {
299
299
  await this.apiError(e);
300
- await this.errorLog(`failed BLEpushChanges with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`);
300
+ this.errorLog(`failed BLEpushChanges with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`);
301
301
  await this.BLEPushConnection();
302
302
  });
303
303
  }
304
304
  else {
305
- await this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${JSON.stringify(switchBotBLE)}`);
305
+ this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${JSON.stringify(switchBotBLE)}`);
306
306
  await this.BLEPushConnection();
307
307
  }
308
308
  }
309
309
  catch (error) {
310
- await this.errorLog(`failed to format device ID as MAC, Error: ${error}`);
310
+ this.errorLog(`failed to format device ID as MAC, Error: ${error}`);
311
311
  }
312
312
  }
313
313
  else {
314
- await this.debugLog(`No changes (BLEpushChanges), On: ${this.Outlet.On}, OnCached: ${this.accessory.context.On}`);
314
+ this.debugLog(`No changes (BLEpushChanges), On: ${this.Outlet.On}, OnCached: ${this.accessory.context.On}`);
315
315
  }
316
316
  }
317
317
  async openAPIpushChanges() {
318
- await this.debugLog('openAPIpushChanges');
318
+ this.debugLog('openAPIpushChanges');
319
319
  if (this.Outlet.On !== this.accessory.context.On) {
320
320
  const command = this.Outlet.On ? 'turnOn' : 'turnOff';
321
321
  const bodyChange = {
@@ -323,13 +323,13 @@ export class Plug extends deviceBase {
323
323
  parameter: 'default',
324
324
  commandType: 'command',
325
325
  };
326
- await this.debugLog(`SwitchBot OpenAPI bodyChange: ${JSON.stringify(bodyChange)}`);
326
+ this.debugLog(`SwitchBot OpenAPI bodyChange: ${JSON.stringify(bodyChange)}`);
327
327
  try {
328
- const { body } = await this.pushChangeRequest(bodyChange);
329
- const deviceStatus = await body;
330
- await this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
328
+ const response = await this.pushChangeRequest(bodyChange);
329
+ const deviceStatus = response.body;
330
+ this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
331
331
  if (await this.successfulStatusCodes(deviceStatus)) {
332
- await this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
332
+ this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`);
333
333
  await this.updateHomeKitCharacteristics();
334
334
  }
335
335
  else {
@@ -338,11 +338,11 @@ export class Plug extends deviceBase {
338
338
  }
339
339
  catch (e) {
340
340
  await this.apiError(e);
341
- await this.errorLog(`failed openAPIpushChanges with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`);
341
+ this.errorLog(`failed openAPIpushChanges with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`);
342
342
  }
343
343
  }
344
344
  else {
345
- await this.debugLog(`No changes (openAPIpushChanges), On: ${this.Outlet.On}, OnCached: ${this.accessory.context.On}`);
345
+ this.debugLog(`No changes (openAPIpushChanges), On: ${this.Outlet.On}, OnCached: ${this.accessory.context.On}`);
346
346
  }
347
347
  }
348
348
  /**
@@ -350,10 +350,10 @@ export class Plug extends deviceBase {
350
350
  */
351
351
  async OnSet(value) {
352
352
  if (this.Outlet.On !== this.accessory.context.On) {
353
- await this.infoLog(`Set On: ${value}`);
353
+ this.infoLog(`Set On: ${value}`);
354
354
  }
355
355
  else {
356
- await this.debugLog(`No Changes, On: ${value}`);
356
+ this.debugLog(`No Changes, On: ${value}`);
357
357
  }
358
358
  this.Outlet.On = value;
359
359
  this.doPlugUpdate.next();
@@ -364,14 +364,14 @@ export class Plug extends deviceBase {
364
364
  }
365
365
  async BLEPushConnection() {
366
366
  if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
367
- await this.warnLog('Using OpenAPI Connection to Push Changes');
367
+ this.warnLog('Using OpenAPI Connection to Push Changes');
368
368
  await this.openAPIpushChanges();
369
369
  }
370
370
  }
371
371
  async BLERefreshConnection(switchbot) {
372
- await this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${switchbot}`);
372
+ this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${switchbot}`);
373
373
  if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
374
- await this.warnLog('Using OpenAPI Connection to Refresh Status');
374
+ this.warnLog('Using OpenAPI Connection to Refresh Status');
375
375
  await this.openAPIRefreshStatus();
376
376
  }
377
377
  }