@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
@@ -3,7 +3,7 @@
3
3
  * plug.ts: @switchbot/homebridge-switchbot.
4
4
  */
5
5
  import type { CharacteristicValue, PlatformAccessory, Service } from 'homebridge'
6
- import type { bodyChange, device, plugMiniJPServiceData, plugMiniJPWebhookContext, plugMiniStatus, plugMiniUSServiceData, plugMiniUSWebhookContext, plugStatus, plugWebhookContext, SwitchbotDevice, WoPlugMini } from 'node-switchbot'
6
+ import type { bodyChange, device, plugMiniJPServiceData, plugMiniJPWebhookContext, plugMiniStatus, plugMiniUSServiceData, plugMiniUSWebhookContext, plugStatus, plugWebhookContext, SwitchbotDevice, WoPlugMiniUS } from 'node-switchbot'
7
7
 
8
8
  import type { SwitchBotPlatform } from '../platform.js'
9
9
  import type { devicesConfig } from '../settings.js'
@@ -111,33 +111,33 @@ export class Plug extends deviceBase {
111
111
  await this.pushChanges()
112
112
  } catch (e: any) {
113
113
  await this.apiError(e)
114
- await this.errorLog(`failed pushChanges with ${device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`)
114
+ this.errorLog(`failed pushChanges with ${device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`)
115
115
  }
116
116
  this.plugUpdateInProgress = false
117
117
  })
118
118
  }
119
119
 
120
120
  async BLEparseStatus(): Promise<void> {
121
- await this.debugLog('BLEparseStatus')
122
- await this.debugLog(`(powerState) = BLE: (${this.serviceData.state}), current:(${this.Outlet.On})`)
121
+ this.debugLog('BLEparseStatus')
122
+ this.debugLog(`(powerState) = BLE: (${this.serviceData.state}), current:(${this.Outlet.On})`)
123
123
 
124
124
  // On
125
125
  this.Outlet.On = this.serviceData.state === 'on'
126
- await this.debugLog(`On: ${this.Outlet.On}`)
126
+ this.debugLog(`On: ${this.Outlet.On}`)
127
127
  }
128
128
 
129
129
  async openAPIparseStatus() {
130
- await this.debugLog('openAPIparseStatus')
131
- await this.debugLog(`(powerState) = OpenAPI: (${this.deviceStatus.power}), current:(${this.Outlet.On})`)
130
+ this.debugLog('openAPIparseStatus')
131
+ this.debugLog(`(powerState) = OpenAPI: (${this.deviceStatus.power}), current:(${this.Outlet.On})`)
132
132
 
133
133
  // On
134
134
  this.Outlet.On = this.deviceStatus.power === 'on'
135
- await this.debugLog(`On: ${this.Outlet.On}`)
135
+ this.debugLog(`On: ${this.Outlet.On}`)
136
136
 
137
137
  // Firmware Version
138
138
  if (this.deviceStatus.version) {
139
139
  const version = this.deviceStatus.version.toString()
140
- await this.debugLog(`Firmware Version: ${version.replace(/^V|-.*$/g, '')}`)
140
+ this.debugLog(`Firmware Version: ${version.replace(/^V|-.*$/g, '')}`)
141
141
  const deviceVersion = version.replace(/^V|-.*$/g, '') ?? '0.0.0'
142
142
  this.accessory
143
143
  .getService(this.hap.Service.AccessoryInformation)!
@@ -146,17 +146,17 @@ export class Plug extends deviceBase {
146
146
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
147
147
  .updateValue(deviceVersion)
148
148
  this.accessory.context.version = deviceVersion
149
- await this.debugSuccessLog(`version: ${this.accessory.context.version}`)
149
+ this.debugSuccessLog(`version: ${this.accessory.context.version}`)
150
150
  }
151
151
  }
152
152
 
153
153
  async parseStatusWebhook(): Promise<void> {
154
- await this.debugLog('parseStatusWebhook')
155
- await this.debugLog(`(powerState) = Webhook: (${this.webhookContext.powerState}), current:(${this.Outlet.On})`)
154
+ this.debugLog('parseStatusWebhook')
155
+ this.debugLog(`(powerState) = Webhook: (${this.webhookContext.powerState}), current:(${this.Outlet.On})`)
156
156
 
157
157
  // On
158
158
  this.Outlet.On = this.webhookContext.powerState === 'ON'
159
- await this.debugLog(`On: ${this.Outlet.On}`)
159
+ this.debugLog(`On: ${this.Outlet.On}`)
160
160
  }
161
161
 
162
162
  /**
@@ -164,19 +164,19 @@ export class Plug extends deviceBase {
164
164
  */
165
165
  async refreshStatus(): Promise<void> {
166
166
  if (!this.device.enableCloudService && this.OpenAPI) {
167
- await this.errorLog(`refreshStatus enableCloudService: ${this.device.enableCloudService}`)
167
+ this.errorLog(`refreshStatus enableCloudService: ${this.device.enableCloudService}`)
168
168
  } else if (this.BLE) {
169
169
  await this.BLERefreshStatus()
170
170
  } else if (this.OpenAPI && this.platform.config.credentials?.token) {
171
171
  await this.openAPIRefreshStatus()
172
172
  } else {
173
173
  await this.offlineOff()
174
- await this.debugWarnLog(`Connection Type: ${this.device.connectionType}, refreshStatus will not happen.`)
174
+ this.debugWarnLog(`Connection Type: ${this.device.connectionType}, refreshStatus will not happen.`)
175
175
  }
176
176
  }
177
177
 
178
178
  async BLERefreshStatus(): Promise<void> {
179
- await this.debugLog('BLERefreshStatus')
179
+ this.debugLog('BLERefreshStatus')
180
180
  const switchBotBLE = await this.switchbotBLE()
181
181
  if (switchBotBLE === undefined) {
182
182
  await this.BLERefreshConnection(switchBotBLE)
@@ -192,7 +192,7 @@ export class Plug extends deviceBase {
192
192
  await this.BLEparseStatus()
193
193
  await this.updateHomeKitCharacteristics()
194
194
  } else {
195
- await this.errorLog(`failed to get serviceData, serviceData: ${JSON.stringify(serviceData)}`)
195
+ this.errorLog(`failed to get serviceData, serviceData: ${JSON.stringify(serviceData)}`)
196
196
  await this.BLERefreshConnection(switchBotBLE)
197
197
  }
198
198
  })()
@@ -200,67 +200,67 @@ export class Plug extends deviceBase {
200
200
  }
201
201
 
202
202
  async registerPlatformBLE(): Promise<void> {
203
- await this.debugLog('registerPlatformBLE')
203
+ this.debugLog('registerPlatformBLE')
204
204
  if (this.config.options?.BLE) {
205
- await this.debugLog('is listening to Platform BLE.')
205
+ this.debugLog('is listening to Platform BLE.')
206
206
  try {
207
207
  const formattedDeviceId = formatDeviceIdAsMac(this.device.deviceId)
208
208
  this.device.bleMac = formattedDeviceId
209
- await this.debugLog(`bleMac: ${this.device.bleMac}`)
209
+ this.debugLog(`bleMac: ${this.device.bleMac}`)
210
210
  this.platform.bleEventHandler[this.device.bleMac] = async (context: plugMiniUSServiceData | plugMiniJPServiceData) => {
211
211
  try {
212
- await this.debugLog(`received BLE: ${JSON.stringify(context)}`)
212
+ this.debugLog(`received BLE: ${JSON.stringify(context)}`)
213
213
  this.serviceData = context
214
214
  await this.BLEparseStatus()
215
215
  await this.updateHomeKitCharacteristics()
216
216
  } catch (e: any) {
217
- await this.errorLog(`failed to handle BLE. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
217
+ this.errorLog(`failed to handle BLE. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
218
218
  }
219
219
  }
220
220
  } catch (error) {
221
- await this.errorLog(`failed to format device ID as MAC, Error: ${error}`)
221
+ this.errorLog(`failed to format device ID as MAC, Error: ${error}`)
222
222
  }
223
223
  } else {
224
- await this.debugLog('is not listening to Platform BLE')
224
+ this.debugLog('is not listening to Platform BLE')
225
225
  }
226
226
  }
227
227
 
228
228
  async openAPIRefreshStatus(): Promise<void> {
229
- await this.debugLog('openAPIRefreshStatus')
229
+ this.debugLog('openAPIRefreshStatus')
230
230
  try {
231
- const { body } = await this.deviceRefreshStatus()
232
- const deviceStatus: any = await body
233
- await this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
231
+ const response = await this.deviceRefreshStatus()
232
+ const deviceStatus: any = response.body
233
+ this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
234
234
  if (await this.successfulStatusCodes(deviceStatus)) {
235
- await this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
235
+ this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
236
236
  this.deviceStatus = deviceStatus.body
237
237
  await this.openAPIparseStatus()
238
238
  await this.updateHomeKitCharacteristics()
239
239
  } else {
240
- await this.debugWarnLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
241
- await this.debugWarnLog(deviceStatus)
240
+ this.debugWarnLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
241
+ this.debugWarnLog(deviceStatus)
242
242
  }
243
243
  } catch (e: any) {
244
244
  await this.apiError(e)
245
- await this.errorLog(`failed openAPIRefreshStatus with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`)
245
+ this.errorLog(`failed openAPIRefreshStatus with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`)
246
246
  }
247
247
  }
248
248
 
249
249
  async registerWebhook() {
250
250
  if (this.device.webhook) {
251
- await this.debugLog('is listening webhook.')
251
+ this.debugLog('is listening webhook.')
252
252
  this.platform.webhookEventHandler[this.device.deviceId] = async (context: plugWebhookContext | plugMiniUSWebhookContext | plugMiniJPWebhookContext) => {
253
253
  try {
254
- await this.debugLog(`received Webhook: ${JSON.stringify(context)}`)
254
+ this.debugLog(`received Webhook: ${JSON.stringify(context)}`)
255
255
  this.webhookContext = context
256
256
  await this.parseStatusWebhook()
257
257
  await this.updateHomeKitCharacteristics()
258
258
  } catch (e: any) {
259
- await this.errorLog(`failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
259
+ this.errorLog(`failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
260
260
  }
261
261
  }
262
262
  } else {
263
- await this.debugLog('is not listening webhook.')
263
+ this.debugLog('is not listening webhook.')
264
264
  }
265
265
  }
266
266
 
@@ -276,14 +276,14 @@ export class Plug extends deviceBase {
276
276
 
277
277
  async pushChanges(): Promise<void> {
278
278
  if (!this.device.enableCloudService && this.OpenAPI) {
279
- await this.errorLog(`pushChanges enableCloudService: ${this.device.enableCloudService}`)
279
+ this.errorLog(`pushChanges enableCloudService: ${this.device.enableCloudService}`)
280
280
  } else if (this.BLE) {
281
281
  await this.BLEpushChanges()
282
282
  } else if (this.OpenAPI && this.platform.config.credentials?.token) {
283
283
  await this.openAPIpushChanges()
284
284
  } else {
285
285
  await this.offlineOff()
286
- await this.debugWarnLog(`Connection Type: ${this.device.connectionType}, pushChanges will not happen.`)
286
+ this.debugWarnLog(`Connection Type: ${this.device.connectionType}, pushChanges will not happen.`)
287
287
  }
288
288
  // Refresh the status from the API
289
289
  interval(15000)
@@ -295,20 +295,20 @@ export class Plug extends deviceBase {
295
295
  }
296
296
 
297
297
  async BLEpushChanges(): Promise<void> {
298
- await this.debugLog('BLEpushChanges')
298
+ this.debugLog('BLEpushChanges')
299
299
  if (this.Outlet.On !== this.accessory.context.On) {
300
- await this.debugLog(`BLEpushChanges On: ${this.Outlet.On}, OnCached: ${this.accessory.context.On}`)
300
+ this.debugLog(`BLEpushChanges On: ${this.Outlet.On}, OnCached: ${this.accessory.context.On}`)
301
301
  const switchBotBLE = await this.platform.connectBLE(this.accessory, this.device)
302
302
  try {
303
303
  const formattedDeviceId = formatDeviceIdAsMac(this.device.deviceId)
304
304
  this.device.bleMac = formattedDeviceId
305
- await this.debugLog(`bleMac: ${this.device.bleMac}`)
305
+ this.debugLog(`bleMac: ${this.device.bleMac}`)
306
306
  if (switchBotBLE !== false) {
307
307
  switchBotBLE
308
308
  .discover({ model: this.device.bleModel, id: this.device.bleMac })
309
309
  .then(async (device_list: SwitchbotDevice[]) => {
310
- const deviceList = device_list as unknown as WoPlugMini[]
311
- await this.infoLog(`On: ${this.Outlet.On}`)
310
+ const deviceList = device_list as unknown as WoPlugMiniUS[]
311
+ this.infoLog(`On: ${this.Outlet.On}`)
312
312
  return await this.retryBLE({
313
313
  max: await this.maxRetryBLE(),
314
314
  fn: async () => {
@@ -321,28 +321,28 @@ export class Plug extends deviceBase {
321
321
  })
322
322
  })
323
323
  .then(async () => {
324
- await this.successLog(`On: ${this.Outlet.On} sent over SwitchBot BLE, sent successfully`)
324
+ this.successLog(`On: ${this.Outlet.On} sent over SwitchBot BLE, sent successfully`)
325
325
  await this.updateHomeKitCharacteristics()
326
326
  })
327
327
  .catch(async (e: any) => {
328
328
  await this.apiError(e)
329
- await this.errorLog(`failed BLEpushChanges with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`)
329
+ this.errorLog(`failed BLEpushChanges with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`)
330
330
  await this.BLEPushConnection()
331
331
  })
332
332
  } else {
333
- await this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${JSON.stringify(switchBotBLE)}`)
333
+ this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${JSON.stringify(switchBotBLE)}`)
334
334
  await this.BLEPushConnection()
335
335
  }
336
336
  } catch (error) {
337
- await this.errorLog(`failed to format device ID as MAC, Error: ${error}`)
337
+ this.errorLog(`failed to format device ID as MAC, Error: ${error}`)
338
338
  }
339
339
  } else {
340
- await this.debugLog(`No changes (BLEpushChanges), On: ${this.Outlet.On}, OnCached: ${this.accessory.context.On}`)
340
+ this.debugLog(`No changes (BLEpushChanges), On: ${this.Outlet.On}, OnCached: ${this.accessory.context.On}`)
341
341
  }
342
342
  }
343
343
 
344
344
  async openAPIpushChanges() {
345
- await this.debugLog('openAPIpushChanges')
345
+ this.debugLog('openAPIpushChanges')
346
346
  if (this.Outlet.On !== this.accessory.context.On) {
347
347
  const command = this.Outlet.On ? 'turnOn' : 'turnOff'
348
348
  const bodyChange: bodyChange = {
@@ -350,23 +350,23 @@ export class Plug extends deviceBase {
350
350
  parameter: 'default',
351
351
  commandType: 'command',
352
352
  }
353
- await this.debugLog(`SwitchBot OpenAPI bodyChange: ${JSON.stringify(bodyChange)}`)
353
+ this.debugLog(`SwitchBot OpenAPI bodyChange: ${JSON.stringify(bodyChange)}`)
354
354
  try {
355
- const { body } = await this.pushChangeRequest(bodyChange)
356
- const deviceStatus: any = await body
357
- await this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
355
+ const response = await this.pushChangeRequest(bodyChange)
356
+ const deviceStatus: any = response.body
357
+ this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
358
358
  if (await this.successfulStatusCodes(deviceStatus)) {
359
- await this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
359
+ this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
360
360
  await this.updateHomeKitCharacteristics()
361
361
  } else {
362
362
  await this.statusCode(deviceStatus.statusCode)
363
363
  }
364
364
  } catch (e: any) {
365
365
  await this.apiError(e)
366
- await this.errorLog(`failed openAPIpushChanges with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`)
366
+ this.errorLog(`failed openAPIpushChanges with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`)
367
367
  }
368
368
  } else {
369
- await this.debugLog(`No changes (openAPIpushChanges), On: ${this.Outlet.On}, OnCached: ${this.accessory.context.On}`)
369
+ this.debugLog(`No changes (openAPIpushChanges), On: ${this.Outlet.On}, OnCached: ${this.accessory.context.On}`)
370
370
  }
371
371
  }
372
372
 
@@ -375,9 +375,9 @@ export class Plug extends deviceBase {
375
375
  */
376
376
  async OnSet(value: CharacteristicValue): Promise<void> {
377
377
  if (this.Outlet.On !== this.accessory.context.On) {
378
- await this.infoLog(`Set On: ${value}`)
378
+ this.infoLog(`Set On: ${value}`)
379
379
  } else {
380
- await this.debugLog(`No Changes, On: ${value}`)
380
+ this.debugLog(`No Changes, On: ${value}`)
381
381
  }
382
382
 
383
383
  this.Outlet.On = value
@@ -391,15 +391,15 @@ export class Plug extends deviceBase {
391
391
 
392
392
  async BLEPushConnection() {
393
393
  if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
394
- await this.warnLog('Using OpenAPI Connection to Push Changes')
394
+ this.warnLog('Using OpenAPI Connection to Push Changes')
395
395
  await this.openAPIpushChanges()
396
396
  }
397
397
  }
398
398
 
399
399
  async BLERefreshConnection(switchbot: any): Promise<void> {
400
- await this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${switchbot}`)
400
+ this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${switchbot}`)
401
401
  if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
402
- await this.warnLog('Using OpenAPI Connection to Refresh Status')
402
+ this.warnLog('Using OpenAPI Connection to Refresh Status')
403
403
  await this.openAPIRefreshStatus()
404
404
  }
405
405
  }