@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
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@switchbot/homebridge-switchbot",
3
3
  "displayName": "SwitchBot",
4
4
  "type": "module",
5
- "version": "4.1.1-beta.2",
5
+ "version": "4.1.1-beta.4",
6
6
  "description": "The SwitchBot plugin allows you to access your SwitchBot device(s) from HomeKit.",
7
7
  "author": "SwitchBot <support@wondertechlabs.com> (https://github.com/SwitchBot)",
8
8
  "contributors": [
@@ -55,14 +55,14 @@
55
55
  "icon": "https://raw.githubusercontent.com/OpenWonderLabs/homebridge-switchbot/latest/branding/icon.png",
56
56
  "engineStrict": true,
57
57
  "engines": {
58
- "homebridge": "^1.8.4 || ^2.0.0 || ^2.0.0-beta.22 || ^2.0.0-alpha.37",
58
+ "homebridge": "^1.8.5 || ^2.0.0 || ^2.0.0-beta.22 || ^2.0.0-alpha.37",
59
59
  "node": "^20 || ^22"
60
60
  },
61
61
  "scripts": {
62
62
  "check": "npm install && npm outdated",
63
63
  "update": "ncu -u && npm update && npm install",
64
64
  "lint": "eslint src/**/*.ts",
65
- "fix": "eslint src/**/*.ts --fix",
65
+ "lint:fix": "eslint src/**/*.ts --fix",
66
66
  "watch": "npm run build && npm run plugin-ui && npm link && nodemon",
67
67
  "plugin-ui": "rsync ./src/homebridge-ui/public/index.html ./dist/homebridge-ui/public/",
68
68
  "build": "npm run clean && tsc && npm run plugin-ui",
@@ -81,7 +81,7 @@
81
81
  "async-mqtt": "^2.6.3",
82
82
  "fakegato-history": "^0.6.5",
83
83
  "homebridge-lib": "^7.0.9",
84
- "node-switchbot": "^3.2.2-beta.0",
84
+ "node-switchbot": "^3.2.2-beta.7",
85
85
  "rxjs": "^7.8.1"
86
86
  },
87
87
  "devDependencies": {
@@ -90,21 +90,21 @@
90
90
  "@types/debug": "^4.1.12",
91
91
  "@types/fs-extra": "^11.0.4",
92
92
  "@types/mdast": "^4.0.4",
93
- "@types/node": "^22.7.8",
93
+ "@types/node": "^22.8.4",
94
94
  "@types/semver": "^7.5.8",
95
95
  "@types/source-map-support": "^0.5.10",
96
- "@vitest/coverage-v8": "^2.1.3",
96
+ "@vitest/coverage-v8": "^2.1.4",
97
97
  "eslint": "^9.13.0",
98
98
  "eslint-plugin-format": "^0.1.2",
99
- "homebridge": "^1.8.4",
99
+ "homebridge": "^1.8.5",
100
100
  "homebridge-config-ui-x": "4.62.0",
101
101
  "nodemon": "^3.1.7",
102
- "npm-check-updates": "^17.1.4",
102
+ "npm-check-updates": "^17.1.9",
103
103
  "shx": "^0.3.4",
104
104
  "ts-node": "^10.9.2",
105
105
  "typedoc": "^0.26.10",
106
106
  "typescript": "^5.6.3",
107
- "vitest": "^2.1.3"
107
+ "vitest": "^2.1.4"
108
108
  },
109
109
  "directories": {
110
110
  "doc": "docs"
@@ -293,7 +293,7 @@ export class BlindTilt extends deviceBase {
293
293
  await this.pushChanges()
294
294
  } catch (e: any) {
295
295
  await this.apiError(e)
296
- await this.errorLog(`failed pushChanges with ${device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`)
296
+ this.errorLog(`failed pushChanges with ${device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`)
297
297
  }
298
298
  this.blindTiltUpdateInProgress = false
299
299
  })
@@ -303,43 +303,43 @@ export class BlindTilt extends deviceBase {
303
303
  * Parse the device status from the SwitchBotBLE API
304
304
  */
305
305
  async BLEparseStatus(): Promise<void> {
306
- await this.debugLog('BLEparseStatus')
307
- await this.debugLog(`(direction, slidePosition, battery, version) = BLE:(${this.serviceData.tilt}, ${this.serviceData.tilt}, ${this.serviceData.battery}, ${this.accessory.context.version}), current:(${this.WindowCovering.CurrentHorizontalTiltAngle}, ${this.WindowCovering.CurrentPosition}, ${this.Battery.BatteryLevel}, ${this.accessory.context.version})`)
306
+ this.debugLog('BLEparseStatus')
307
+ this.debugLog(`(direction, slidePosition, battery, version) = BLE:(${this.serviceData.tilt}, ${this.serviceData.tilt}, ${this.serviceData.battery}, ${this.accessory.context.version}), current:(${this.WindowCovering.CurrentHorizontalTiltAngle}, ${this.WindowCovering.CurrentPosition}, ${this.Battery.BatteryLevel}, ${this.accessory.context.version})`)
308
308
 
309
309
  // CurrentPosition
310
310
  this.WindowCovering.CurrentPosition = 100 - Number(this.serviceData.tilt)
311
311
  await this.setMinMax()
312
- await this.debugLog(`CurrentPosition ${this.WindowCovering.CurrentPosition}`)
312
+ this.debugLog(`CurrentPosition ${this.WindowCovering.CurrentPosition}`)
313
313
  if (this.setNewTarget) {
314
- await this.infoLog('Checking Status ...')
314
+ this.infoLog('Checking Status ...')
315
315
  }
316
316
  if (this.setNewTarget && this.serviceData.inMotion) {
317
317
  this.blindTiltMoving = true
318
318
  await this.setMinMax()
319
319
  if (Number(this.WindowCovering.TargetPosition) > this.WindowCovering.CurrentPosition) {
320
- await this.debugLog(`Closing, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
320
+ this.debugLog(`Closing, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
321
321
  this.WindowCovering.PositionState = this.hap.Characteristic.PositionState.INCREASING
322
322
  this.WindowCovering.Service.getCharacteristic(this.hap.Characteristic.PositionState).updateValue(this.WindowCovering.PositionState)
323
- await this.debugLog(`Increasing, PositionState: ${this.WindowCovering.PositionState}`)
323
+ this.debugLog(`Increasing, PositionState: ${this.WindowCovering.PositionState}`)
324
324
  } else if (Number(this.WindowCovering.TargetPosition) < this.WindowCovering.CurrentPosition) {
325
- await this.debugLog(`Opening, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
325
+ this.debugLog(`Opening, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
326
326
  this.WindowCovering.PositionState = this.hap.Characteristic.PositionState.DECREASING
327
327
  this.WindowCovering.Service.getCharacteristic(this.hap.Characteristic.PositionState).updateValue(this.WindowCovering.PositionState)
328
- await this.debugLog(`Decreasing, PositionState: ${this.WindowCovering.PositionState}`)
328
+ this.debugLog(`Decreasing, PositionState: ${this.WindowCovering.PositionState}`)
329
329
  } else {
330
- await this.debugLog(`Standby, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
330
+ this.debugLog(`Standby, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
331
331
  this.WindowCovering.PositionState = this.hap.Characteristic.PositionState.STOPPED
332
332
  this.WindowCovering.Service.getCharacteristic(this.hap.Characteristic.PositionState).updateValue(this.WindowCovering.PositionState)
333
- await this.debugLog('Stopped, PositionState', this.WindowCovering.PositionState)
333
+ this.debugLog('Stopped, PositionState', this.WindowCovering.PositionState)
334
334
  }
335
335
  } else {
336
336
  this.blindTiltMoving = false
337
- await this.debugLog(`Standby, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
337
+ this.debugLog(`Standby, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
338
338
  this.WindowCovering.TargetPosition = this.WindowCovering.CurrentPosition
339
339
  this.WindowCovering.PositionState = this.hap.Characteristic.PositionState.STOPPED
340
- await this.debugLog(`Stopped, PositionState: ${this.WindowCovering.PositionState}`)
340
+ this.debugLog(`Stopped, PositionState: ${this.WindowCovering.PositionState}`)
341
341
  }
342
- await this.debugLog(`CurrentPosition: ${this.WindowCovering.CurrentPosition}, TargetPosition: ${this.WindowCovering.TargetPosition}, PositionState: ${this.WindowCovering.PositionState}`)
342
+ this.debugLog(`CurrentPosition: ${this.WindowCovering.CurrentPosition}, TargetPosition: ${this.WindowCovering.TargetPosition}, PositionState: ${this.WindowCovering.PositionState}`)
343
343
 
344
344
  // CurrentAmbientLightLevel
345
345
  if (!(this.device as blindTiltConfig).hide_lightsensor && this.LightSensor?.Service) {
@@ -347,20 +347,20 @@ export class BlindTilt extends deviceBase {
347
347
  const set_maxLux = (this.device as blindTiltConfig).set_maxLux ?? 6001
348
348
  const spaceBetweenLevels = 9
349
349
 
350
- await this.getLightLevel(this.serviceData.lightLevel, set_minLux, set_maxLux, spaceBetweenLevels)
351
- await this.debugLog(`LightLevel: ${this.serviceData.lightLevel}, CurrentAmbientLightLevel: ${this.LightSensor!.CurrentAmbientLightLevel}`)
350
+ this.getLightLevel(this.serviceData.lightLevel, set_minLux, set_maxLux, spaceBetweenLevels)
351
+ this.debugLog(`LightLevel: ${this.serviceData.lightLevel}, CurrentAmbientLightLevel: ${this.LightSensor!.CurrentAmbientLightLevel}`)
352
352
  }
353
353
 
354
354
  // BatteryLevel
355
355
  if (this.serviceData?.battery) {
356
356
  this.Battery.BatteryLevel = this.serviceData.battery
357
- await this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`)
357
+ this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`)
358
358
 
359
359
  // StatusLowBattery
360
360
  this.Battery.StatusLowBattery = this.Battery.BatteryLevel < 10
361
361
  ? this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_LOW
362
362
  : this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL
363
- await this.debugLog(`StatusLowBattery: ${this.Battery.StatusLowBattery}`)
363
+ this.debugLog(`StatusLowBattery: ${this.Battery.StatusLowBattery}`)
364
364
  }
365
365
  };
366
366
 
@@ -368,8 +368,8 @@ export class BlindTilt extends deviceBase {
368
368
  * Parse the device status from the SwitchBot OpenAPI
369
369
  */
370
370
  async openAPIparseStatus(): Promise<void> {
371
- await this.debugLog('openAPIparseStatus')
372
- await this.debugLog(`(direction, slidePosition, battery, version) = OpenAPI:(${this.deviceStatus.direction}, ${this.deviceStatus.slidePosition}, ${this.deviceStatus.battery}, ${this.deviceStatus.version}), current:(${this.WindowCovering.CurrentHorizontalTiltAngle}, ${this.WindowCovering.CurrentPosition}, ${this.Battery.BatteryLevel}, ${this.accessory.context.version})`)
371
+ this.debugLog('openAPIparseStatus')
372
+ this.debugLog(`(direction, slidePosition, battery, version) = OpenAPI:(${this.deviceStatus.direction}, ${this.deviceStatus.slidePosition}, ${this.deviceStatus.battery}, ${this.deviceStatus.version}), current:(${this.WindowCovering.CurrentHorizontalTiltAngle}, ${this.WindowCovering.CurrentPosition}, ${this.Battery.BatteryLevel}, ${this.accessory.context.version})`)
373
373
 
374
374
  // CurrentPosition
375
375
  await this.getCurrentPosttionDirection(this.deviceStatus.direction, this.deviceStatus.slidePosition)
@@ -378,23 +378,23 @@ export class BlindTilt extends deviceBase {
378
378
  const set_minLux = (this.device as blindTiltConfig).set_minLux ?? 1
379
379
  const set_maxLux = (this.device as blindTiltConfig).set_maxLux ?? 6001
380
380
  const lightLevel = this.deviceStatus.lightLevel === 'bright' ? set_maxLux : set_minLux
381
- this.LightSensor.CurrentAmbientLightLevel = await this.getLightLevel(lightLevel, set_minLux, set_maxLux, 2)
382
- await this.debugLog(`LightLevel: ${this.deviceStatus.lightLevel}, CurrentAmbientLightLevel: ${this.LightSensor.CurrentAmbientLightLevel}`)
381
+ this.LightSensor.CurrentAmbientLightLevel = this.getLightLevel(lightLevel, set_minLux, set_maxLux, 2)
382
+ this.debugLog(`LightLevel: ${this.deviceStatus.lightLevel}, CurrentAmbientLightLevel: ${this.LightSensor.CurrentAmbientLightLevel}`)
383
383
  }
384
384
 
385
385
  // BatteryLevel
386
386
  this.Battery.BatteryLevel = this.deviceStatus.battery
387
- await this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`)
387
+ this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`)
388
388
 
389
389
  // StatusLowBattery
390
390
  this.Battery.StatusLowBattery = this.Battery.BatteryLevel < 10
391
391
  ? this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_LOW
392
392
  : this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL
393
- await this.debugLog(`StatusLowBattery: ${this.Battery.StatusLowBattery}`)
393
+ this.debugLog(`StatusLowBattery: ${this.Battery.StatusLowBattery}`)
394
394
 
395
395
  // Firmware Version
396
396
  const version = this.deviceStatus.version.toString()
397
- await this.debugLog(`Firmware Version: ${version.replace(/^V|-.*$/g, '')}`)
397
+ this.debugLog(`Firmware Version: ${version.replace(/^V|-.*$/g, '')}`)
398
398
  let deviceVersion: string
399
399
  if (version?.includes('.') === false) {
400
400
  const replace = version?.replace(/^V|-.*$/g, '')
@@ -411,22 +411,22 @@ export class BlindTilt extends deviceBase {
411
411
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
412
412
  .updateValue(deviceVersion)
413
413
  this.accessory.context.version = deviceVersion
414
- await this.debugLog(`version: ${this.accessory.context.version}`)
414
+ this.debugLog(`version: ${this.accessory.context.version}`)
415
415
  }
416
416
 
417
417
  async parseStatusWebhook(): Promise<void> {
418
- await this.debugLog('parseStatusWebhook')
419
- await this.debugLog(`(slidePosition, battery, version) = Webhook:(${this.webhookContext.direction}, ${this.webhookContext.slidePosition}, ${this.webhookContext.battery}, ${this.webhookContext.version}, current:(${this.WindowCovering.CurrentHorizontalTiltAngle}, ${this.WindowCovering.CurrentPosition}, ${this.Battery.BatteryLevel}, ${this.accessory.context.version})`)
418
+ this.debugLog('parseStatusWebhook')
419
+ this.debugLog(`(slidePosition, battery, version) = Webhook:(${this.webhookContext.direction}, ${this.webhookContext.slidePosition}, ${this.webhookContext.battery}, ${this.webhookContext.version}, current:(${this.WindowCovering.CurrentHorizontalTiltAngle}, ${this.WindowCovering.CurrentPosition}, ${this.Battery.BatteryLevel}, ${this.accessory.context.version})`)
420
420
  // CurrentPosition and CurrentHorizontalTiltAngle
421
421
  await this.getCurrentPosttionDirection(this.webhookContext.direction, this.webhookContext.slidePosition)
422
422
  // BatteryLevel
423
423
  this.Battery.BatteryLevel = this.webhookContext.battery
424
- await this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`)
424
+ this.debugLog(`BatteryLevel: ${this.Battery.BatteryLevel}`)
425
425
  // StatusLowBattery
426
426
  this.Battery.StatusLowBattery = this.Battery.BatteryLevel < 10
427
427
  ? this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_LOW
428
428
  : this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL
429
- await this.debugLog(`StatusLowBattery: ${this.Battery.StatusLowBattery}`)
429
+ this.debugLog(`StatusLowBattery: ${this.Battery.StatusLowBattery}`)
430
430
  // Firmware Version
431
431
  const deviceVersion = this.webhookContext.version.replace(/^V|-.*$/g, '') ?? '0.0.0'
432
432
  this.accessory
@@ -436,7 +436,7 @@ export class BlindTilt extends deviceBase {
436
436
  .getCharacteristic(this.hap.Characteristic.FirmwareRevision)
437
437
  .updateValue(deviceVersion)
438
438
  this.accessory.context.version = deviceVersion
439
- await this.debugSuccessLog(`version: ${this.accessory.context.version}`)
439
+ this.debugSuccessLog(`version: ${this.accessory.context.version}`)
440
440
  }
441
441
 
442
442
  /**
@@ -444,19 +444,19 @@ export class BlindTilt extends deviceBase {
444
444
  */
445
445
  async refreshStatus(): Promise<void> {
446
446
  if (!this.device.enableCloudService && this.OpenAPI) {
447
- await this.errorLog(`refreshStatus enableCloudService: ${this.device.enableCloudService}`)
447
+ this.errorLog(`refreshStatus enableCloudService: ${this.device.enableCloudService}`)
448
448
  } else if (this.BLE) {
449
449
  await this.BLERefreshStatus()
450
450
  } else if (this.OpenAPI && this.platform.config.credentials?.token) {
451
451
  await this.openAPIRefreshStatus()
452
452
  } else {
453
453
  await this.offlineOff()
454
- await this.debugWarnLog(`Connection Type: ${this.device.connectionType}, refreshStatus will not happen.`)
454
+ this.debugWarnLog(`Connection Type: ${this.device.connectionType}, refreshStatus will not happen.`)
455
455
  }
456
456
  }
457
457
 
458
458
  async BLERefreshStatus(): Promise<void> {
459
- await this.debugLog('BLERefreshStatus')
459
+ this.debugLog('BLERefreshStatus')
460
460
  const switchBotBLE = await this.switchbotBLE()
461
461
  if (switchBotBLE === undefined) {
462
462
  await this.BLERefreshConnection(switchBotBLE)
@@ -471,7 +471,7 @@ export class BlindTilt extends deviceBase {
471
471
  await this.BLEparseStatus()
472
472
  await this.updateHomeKitCharacteristics()
473
473
  } else {
474
- await this.errorLog(`failed to get serviceData, serviceData: ${JSON.stringify(serviceData)}`)
474
+ this.errorLog(`failed to get serviceData, serviceData: ${JSON.stringify(serviceData)}`)
475
475
  await this.BLERefreshConnection(switchBotBLE)
476
476
  }
477
477
  })()
@@ -479,80 +479,80 @@ export class BlindTilt extends deviceBase {
479
479
  }
480
480
 
481
481
  async registerPlatformBLE(): Promise<void> {
482
- await this.debugLog('registerPlatformBLE')
482
+ this.debugLog('registerPlatformBLE')
483
483
  if (this.config.options?.BLE) {
484
- await this.debugLog('is listening to Platform BLE.')
484
+ this.debugLog('is listening to Platform BLE.')
485
485
  try {
486
486
  const formattedDeviceId = formatDeviceIdAsMac(this.device.deviceId)
487
487
  this.device.bleMac = formattedDeviceId
488
- await this.debugLog(`bleMac: ${this.device.bleMac}`)
488
+ this.debugLog(`bleMac: ${this.device.bleMac}`)
489
489
  this.platform.bleEventHandler[this.device.bleMac] = async (context: blindTiltServiceData) => {
490
490
  try {
491
- await this.debugLog(`received BLE: ${JSON.stringify(context)}`)
491
+ this.debugLog(`received BLE: ${JSON.stringify(context)}`)
492
492
  this.serviceData = context
493
493
  await this.BLEparseStatus()
494
494
  await this.updateHomeKitCharacteristics()
495
495
  } catch (e: any) {
496
- await this.errorLog(`failed to handle BLE. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
496
+ this.errorLog(`failed to handle BLE. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
497
497
  }
498
498
  }
499
499
  } catch (error) {
500
- await this.errorLog(`failed to format device ID as MAC, Error: ${error}`)
500
+ this.errorLog(`failed to format device ID as MAC, Error: ${error}`)
501
501
  }
502
502
  } else {
503
- await this.debugLog('is not listening to Platform BLE')
503
+ this.debugLog('is not listening to Platform BLE')
504
504
  }
505
505
  }
506
506
 
507
507
  async openAPIRefreshStatus(): Promise<void> {
508
- await this.debugLog('openAPIRefreshStatus')
508
+ this.debugLog('openAPIRefreshStatus')
509
509
  try {
510
- const { body } = await this.deviceRefreshStatus()
511
- const deviceStatus: any = await body
512
- await this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
510
+ const response = await this.deviceRefreshStatus()
511
+ const deviceStatus: any = response.body
512
+ this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
513
513
  if (await this.successfulStatusCodes(deviceStatus)) {
514
- await this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
514
+ this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
515
515
  this.deviceStatus = deviceStatus.body
516
516
  await this.openAPIparseStatus()
517
517
  await this.updateHomeKitCharacteristics()
518
518
  } else {
519
- await this.debugWarnLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
520
- await this.debugWarnLog(deviceStatus)
519
+ this.debugWarnLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
520
+ this.debugWarnLog(deviceStatus)
521
521
  }
522
522
  } catch (e: any) {
523
523
  await this.apiError(e)
524
- await this.errorLog(`failed openAPIRefreshStatus with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`)
524
+ this.errorLog(`failed openAPIRefreshStatus with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`)
525
525
  }
526
526
  }
527
527
 
528
528
  async registerWebhook(): Promise<void> {
529
529
  if (this.device.webhook) {
530
- await this.debugLog('is listening webhook.')
530
+ this.debugLog('is listening webhook.')
531
531
  this.platform.webhookEventHandler[this.device.deviceId] = async (context: blindTiltWebhookContext) => {
532
532
  try {
533
- await this.debugLog(`received Webhook: ${JSON.stringify(context)}`)
533
+ this.debugLog(`received Webhook: ${JSON.stringify(context)}`)
534
534
  this.webhookContext = context
535
535
  await this.parseStatusWebhook()
536
536
  await this.updateHomeKitCharacteristics()
537
537
  } catch (e: any) {
538
- await this.errorLog(`failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
538
+ this.errorLog(`failed to handle webhook. Received: ${JSON.stringify(context)} Error: ${e.message ?? e}`)
539
539
  }
540
540
  }
541
541
  } else {
542
- await this.debugLog('is not listening webhook.')
542
+ this.debugLog('is not listening webhook.')
543
543
  }
544
544
  }
545
545
 
546
546
  async pushChanges(): Promise<void> {
547
547
  if (!this.device.enableCloudService && this.OpenAPI) {
548
- await this.errorLog(`pushChanges enableCloudService: ${this.device.enableCloudService}`)
548
+ this.errorLog(`pushChanges enableCloudService: ${this.device.enableCloudService}`)
549
549
  } else if (this.BLE) {
550
550
  await this.BLEpushChanges()
551
551
  } else if (this.OpenAPI && this.platform.config.credentials?.token) {
552
552
  await this.openAPIpushChanges()
553
553
  } else {
554
554
  await this.offlineOff()
555
- await this.debugWarnLog(`Connection Type: ${this.device.connectionType}, pushChanges will not happen.`)
555
+ this.debugWarnLog(`Connection Type: ${this.device.connectionType}, pushChanges will not happen.`)
556
556
  }
557
557
  // Refresh the status from the API
558
558
  interval(15000)
@@ -564,16 +564,16 @@ export class BlindTilt extends deviceBase {
564
564
  }
565
565
 
566
566
  async BLEpushChanges(): Promise<void> {
567
- await this.debugLog('BLEpushChanges')
567
+ this.debugLog('BLEpushChanges')
568
568
  if (this.WindowCovering.TargetPosition !== this.WindowCovering.CurrentPosition) {
569
- await this.debugLog(`BLEpushChanges On: ${this.WindowCovering.TargetPosition} OnCached: ${this.WindowCovering.CurrentPosition}`)
569
+ this.debugLog(`BLEpushChanges On: ${this.WindowCovering.TargetPosition} OnCached: ${this.WindowCovering.CurrentPosition}`)
570
570
  const switchBotBLE = await this.platform.connectBLE(this.accessory, this.device)
571
571
  try {
572
572
  const formattedDeviceId = formatDeviceIdAsMac(this.device.deviceId)
573
573
  this.device.bleMac = formattedDeviceId
574
- await this.debugLog(`bleMac: ${this.device.bleMac}`)
574
+ this.debugLog(`bleMac: ${this.device.bleMac}`)
575
575
  const { setPositionMode, Mode }: { setPositionMode: number, Mode: string } = await this.setPerformance()
576
- await this.debugLog(`Mode: ${Mode}, setPositionMode: ${setPositionMode}`)
576
+ this.debugLog(`Mode: ${Mode}, setPositionMode: ${setPositionMode}`)
577
577
  if (switchBotBLE !== false) {
578
578
  switchBotBLE
579
579
  .discover({ model: this.device.bleModel, quick: true, id: this.device.bleMac })
@@ -587,28 +587,28 @@ export class BlindTilt extends deviceBase {
587
587
  })
588
588
  })
589
589
  .then(async () => {
590
- await this.successLog(`TargetPostion: ${this.WindowCovering.TargetPosition} sent over SwitchBot BLE, sent successfully`)
590
+ this.successLog(`TargetPostion: ${this.WindowCovering.TargetPosition} sent over SwitchBot BLE, sent successfully`)
591
591
  await this.updateHomeKitCharacteristics()
592
592
  })
593
593
  .catch(async (e: any) => {
594
594
  await this.apiError(e)
595
- await this.errorLog(`failed BLEpushChanges with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`)
595
+ this.errorLog(`failed BLEpushChanges with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`)
596
596
  await this.BLEPushConnection()
597
597
  })
598
598
  } else {
599
- await this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${JSON.stringify(switchBotBLE)}`)
599
+ this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${JSON.stringify(switchBotBLE)}`)
600
600
  await this.BLEPushConnection()
601
601
  }
602
602
  } catch (error) {
603
- await this.errorLog(`failed to format device ID as MAC, Error: ${error}`)
603
+ this.errorLog(`failed to format device ID as MAC, Error: ${error}`)
604
604
  }
605
605
  } else {
606
- await this.debugLog(`No changes (BLEpushChanges), TargetPosition: ${this.WindowCovering.TargetPosition}, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
606
+ this.debugLog(`No changes (BLEpushChanges), TargetPosition: ${this.WindowCovering.TargetPosition}, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
607
607
  }
608
608
  }
609
609
 
610
610
  async openAPIpushChanges(): Promise<void> {
611
- await this.debugLog('openAPIpushChanges')
611
+ this.debugLog('openAPIpushChanges')
612
612
  const hasDifferentAndRelevantHorizontalTiltAngle
613
613
  = this.mappingMode === BlindTiltMappingMode.UseTiltForDirection
614
614
  && this.WindowCovering.TargetHorizontalTiltAngle !== this.WindowCovering.CurrentHorizontalTiltAngle
@@ -616,8 +616,8 @@ export class BlindTilt extends deviceBase {
616
616
  || hasDifferentAndRelevantHorizontalTiltAngle || this.device.disableCaching) {
617
617
  const [direction, position] = this.mapHomekitValuesToDeviceValues(Number(this.WindowCovering.TargetPosition), Number(this.WindowCovering.TargetHorizontalTiltAngle))
618
618
  const { Mode, setPositionMode }: { setPositionMode: number, Mode: string } = await this.setPerformance()
619
- await this.debugLog(`Pushing ${this.WindowCovering.TargetPosition} (device = ${direction};${position})`)
620
- await this.debugLog(`Mode: ${Mode}, setPositionMode: ${setPositionMode}`)
619
+ this.debugLog(`Pushing ${this.WindowCovering.TargetPosition} (device = ${direction};${position})`)
620
+ this.debugLog(`Mode: ${Mode}, setPositionMode: ${setPositionMode}`)
621
621
  let bodyChange: bodyChange
622
622
  if (position === 100) {
623
623
  bodyChange = {
@@ -638,24 +638,24 @@ export class BlindTilt extends deviceBase {
638
638
  commandType: 'command',
639
639
  }
640
640
  }
641
- await this.debugLog(`SwitchBot OpenAPI bodyChange: ${JSON.stringify(bodyChange)}`)
641
+ this.debugLog(`SwitchBot OpenAPI bodyChange: ${JSON.stringify(bodyChange)}`)
642
642
  try {
643
- const { body } = await this.pushChangeRequest(bodyChange)
644
- const deviceStatus: any = await body
645
- await this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
643
+ const response = await this.pushChangeRequest(bodyChange)
644
+ const deviceStatus: any = response.body
645
+ this.debugLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
646
646
  if (await this.successfulStatusCodes(deviceStatus)) {
647
- await this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
647
+ this.debugSuccessLog(`statusCode: ${deviceStatus.statusCode}, deviceStatus: ${JSON.stringify(deviceStatus)}`)
648
648
  await this.updateHomeKitCharacteristics()
649
649
  } else {
650
650
  await this.statusCode(deviceStatus.statusCode)
651
651
  }
652
652
  } catch (e: any) {
653
653
  await this.apiError(e)
654
- await this.errorLog(`failed openAPIpushChanges with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`)
654
+ this.errorLog(`failed openAPIpushChanges with ${this.device.connectionType} Connection, Error Message: ${JSON.stringify(e.message)}`)
655
655
  }
656
656
  } else {
657
- await this.debugLog(`No changes (openAPIpushChanges), TargetPosition: ${this.WindowCovering.TargetPosition}, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
658
- await this.debugLog(`No changes (openAPIpushChanges), TargetHorizontalTiltAngle: ${this.WindowCovering.TargetHorizontalTiltAngle}, CurrentHorizontalTiltAngle: ${this.WindowCovering.CurrentHorizontalTiltAngle}`)
657
+ this.debugLog(`No changes (openAPIpushChanges), TargetPosition: ${this.WindowCovering.TargetPosition}, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
658
+ this.debugLog(`No changes (openAPIpushChanges), TargetHorizontalTiltAngle: ${this.WindowCovering.TargetHorizontalTiltAngle}, CurrentHorizontalTiltAngle: ${this.WindowCovering.CurrentHorizontalTiltAngle}`)
659
659
  }
660
660
  }
661
661
 
@@ -664,9 +664,9 @@ export class BlindTilt extends deviceBase {
664
664
  */
665
665
  async TargetHorizontalTiltAngleSet(value: CharacteristicValue): Promise<void> {
666
666
  if (this.WindowCovering.TargetHorizontalTiltAngle !== this.accessory.context.TargetHorizontalTiltAngle) {
667
- await this.debugLog(`Set TargetHorizontalTiltAngle: ${value}`)
667
+ this.debugLog(`Set TargetHorizontalTiltAngle: ${value}`)
668
668
  } else {
669
- await this.debugLog(`No changes, TargetHorizontalTiltAngle: ${value}`)
669
+ this.debugLog(`No changes, TargetHorizontalTiltAngle: ${value}`)
670
670
  }
671
671
 
672
672
  // value = value < 0 ? -90 : 90;
@@ -680,9 +680,9 @@ export class BlindTilt extends deviceBase {
680
680
  */
681
681
  async TargetPositionSet(value: CharacteristicValue): Promise<void> {
682
682
  if (this.WindowCovering.TargetPosition !== this.accessory.context.TargetPosition) {
683
- await this.debugLog(`Set TargetPosition: ${value}`)
683
+ this.debugLog(`Set TargetPosition: ${value}`)
684
684
  } else {
685
- await this.debugLog(`No changes, TargetPosition: ${value}`)
685
+ this.debugLog(`No changes, TargetPosition: ${value}`)
686
686
  }
687
687
 
688
688
  this.WindowCovering.TargetPosition = value
@@ -692,20 +692,20 @@ export class BlindTilt extends deviceBase {
692
692
 
693
693
  async startUpdatingBlindTiltIfNeeded(): Promise<void> {
694
694
  await this.setMinMax()
695
- await this.debugLog('setMinMax')
695
+ this.debugLog('setMinMax')
696
696
  if (this.WindowCovering.TargetPosition > this.WindowCovering.CurrentPosition
697
697
  || this.WindowCovering.TargetHorizontalTiltAngle !== this.WindowCovering.CurrentHorizontalTiltAngle) {
698
698
  this.WindowCovering.PositionState = this.hap.Characteristic.PositionState.INCREASING
699
699
  this.setNewTarget = true
700
- await this.debugLog(`value: ${this.WindowCovering.CurrentPosition}, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
700
+ this.debugLog(`value: ${this.WindowCovering.CurrentPosition}, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
701
701
  } else if (this.WindowCovering.TargetPosition < this.WindowCovering.CurrentPosition) {
702
702
  this.WindowCovering.PositionState = this.hap.Characteristic.PositionState.DECREASING
703
703
  this.setNewTarget = true
704
- await this.debugLog(`value: ${this.WindowCovering.CurrentPosition}, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
704
+ this.debugLog(`value: ${this.WindowCovering.CurrentPosition}, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
705
705
  } else {
706
706
  this.WindowCovering.PositionState = this.hap.Characteristic.PositionState.STOPPED
707
707
  this.setNewTarget = false
708
- await this.debugLog(`value: ${this.WindowCovering.CurrentPosition}, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
708
+ this.debugLog(`value: ${this.WindowCovering.CurrentPosition}, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
709
709
  }
710
710
  this.WindowCovering.Service.setCharacteristic(this.hap.Characteristic.PositionState, this.WindowCovering.PositionState)
711
711
  this.WindowCovering.Service.getCharacteristic(this.hap.Characteristic.PositionState).updateValue(this.WindowCovering.PositionState)
@@ -715,10 +715,10 @@ export class BlindTilt extends deviceBase {
715
715
  * The minimum time depends on the network control latency.
716
716
  */
717
717
  clearTimeout(this.setNewTargetTimer)
718
- await this.debugLog(`deviceUpdateRate: ${this.deviceUpdateRate}`)
718
+ this.debugLog(`deviceUpdateRate: ${this.deviceUpdateRate}`)
719
719
  if (this.setNewTarget) {
720
720
  this.setNewTargetTimer = setTimeout(async () => {
721
- await this.debugLog(`setNewTarget ${this.setNewTarget} timeout`)
721
+ this.debugLog(`setNewTarget ${this.setNewTarget} timeout`)
722
722
  this.setNewTarget = false
723
723
  }, this.deviceUpdateRate * 1000)
724
724
  }
@@ -776,15 +776,15 @@ export class BlindTilt extends deviceBase {
776
776
 
777
777
  async BLEPushConnection() {
778
778
  if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
779
- await this.warnLog('Using OpenAPI Connection to Push Changes')
779
+ this.warnLog('Using OpenAPI Connection to Push Changes')
780
780
  await this.openAPIpushChanges()
781
781
  }
782
782
  }
783
783
 
784
784
  async BLERefreshConnection(switchbot: any): Promise<void> {
785
- await this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${switchbot}`)
785
+ this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${switchbot}`)
786
786
  if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
787
- await this.warnLog('Using OpenAPI Connection to Refresh Status')
787
+ this.warnLog('Using OpenAPI Connection to Refresh Status')
788
788
  await this.openAPIRefreshStatus()
789
789
  }
790
790
  }
@@ -870,50 +870,50 @@ export class BlindTilt extends deviceBase {
870
870
  slidePosition: blindTiltStatus['slidePosition'] | blindTiltWebhookContext['slidePosition'],
871
871
  ) {
872
872
  const [homekitPosition, homekitTiltAngle] = this.mapDeviceValuesToHomekitValues(Number(slidePosition), String(direction))
873
- await this.debugLog(`Slide Position: ${slidePosition}`)
874
- await this.debugLog(`Homekit Position: ${homekitPosition}`)
873
+ this.debugLog(`Slide Position: ${slidePosition}`)
874
+ this.debugLog(`Homekit Position: ${homekitPosition}`)
875
875
 
876
876
  this.WindowCovering.CurrentPosition = homekitPosition
877
877
  await this.setMinMax()
878
- await this.debugLog(`CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
878
+ this.debugLog(`CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
879
879
 
880
880
  if (homekitTiltAngle) {
881
881
  this.WindowCovering.CurrentHorizontalTiltAngle = homekitTiltAngle!
882
- await this.debugLog(`CurrentHorizontalTiltAngle: ${this.WindowCovering.CurrentHorizontalTiltAngle}`)
882
+ this.debugLog(`CurrentHorizontalTiltAngle: ${this.WindowCovering.CurrentHorizontalTiltAngle}`)
883
883
  }
884
884
 
885
885
  if (this.setNewTarget) {
886
886
  this.blindTiltMoving = true
887
- await this.infoLog('Checking Status ...')
887
+ this.infoLog('Checking Status ...')
888
888
  await this.setMinMax()
889
889
  if (this.WindowCovering.TargetPosition > this.WindowCovering.CurrentPosition
890
890
  || (homekitTiltAngle && this.WindowCovering.TargetHorizontalTiltAngle !== this.WindowCovering.CurrentHorizontalTiltAngle)) {
891
- await this.debugLog(`Closing, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
891
+ this.debugLog(`Closing, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
892
892
  this.WindowCovering.PositionState = this.hap.Characteristic.PositionState.INCREASING
893
893
  this.WindowCovering.Service.getCharacteristic(this.hap.Characteristic.PositionState).updateValue(this.WindowCovering.PositionState)
894
- await this.debugLog(`Increasing, PositionState: ${this.WindowCovering.PositionState}`)
894
+ this.debugLog(`Increasing, PositionState: ${this.WindowCovering.PositionState}`)
895
895
  } else if (this.WindowCovering.TargetPosition < this.WindowCovering.CurrentPosition) {
896
- await this.debugLog(`Opening, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
896
+ this.debugLog(`Opening, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
897
897
  this.WindowCovering.PositionState = this.hap.Characteristic.PositionState.DECREASING
898
898
  this.WindowCovering.Service.getCharacteristic(this.hap.Characteristic.PositionState).updateValue(this.WindowCovering.PositionState)
899
- await this.debugLog(`Decreasing, PositionState: ${this.WindowCovering.PositionState}`)
899
+ this.debugLog(`Decreasing, PositionState: ${this.WindowCovering.PositionState}`)
900
900
  } else {
901
- await this.debugLog(`Standby because reached position, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
901
+ this.debugLog(`Standby because reached position, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
902
902
  this.WindowCovering.PositionState = this.hap.Characteristic.PositionState.STOPPED
903
903
  this.WindowCovering.Service.getCharacteristic(this.hap.Characteristic.PositionState).updateValue(this.WindowCovering.PositionState)
904
- await this.debugLog(`Stopped, PositionState: ${this.WindowCovering.PositionState}`)
904
+ this.debugLog(`Stopped, PositionState: ${this.WindowCovering.PositionState}`)
905
905
  }
906
906
  } else {
907
907
  this.blindTiltMoving = false
908
- await this.debugLog(`Standby because device not moving, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
908
+ this.debugLog(`Standby because device not moving, CurrentPosition: ${this.WindowCovering.CurrentPosition}`)
909
909
  this.WindowCovering.TargetPosition = this.WindowCovering.CurrentPosition
910
910
  if (homekitTiltAngle) {
911
911
  this.WindowCovering.TargetHorizontalTiltAngle = this.WindowCovering.CurrentHorizontalTiltAngle
912
912
  }
913
913
  this.WindowCovering.PositionState = this.hap.Characteristic.PositionState.STOPPED
914
- await this.debugLog(`Stopped, PositionState: ${this.WindowCovering.PositionState}`)
914
+ this.debugLog(`Stopped, PositionState: ${this.WindowCovering.PositionState}`)
915
915
  }
916
- await this.debugLog(`CurrentPosition: ${this.WindowCovering.CurrentPosition}, TargetPosition: ${this.WindowCovering.TargetPosition}, PositionState: ${this.WindowCovering.PositionState}`)
916
+ this.debugLog(`CurrentPosition: ${this.WindowCovering.CurrentPosition}, TargetPosition: ${this.WindowCovering.TargetPosition}, PositionState: ${this.WindowCovering.PositionState}`)
917
917
  }
918
918
 
919
919
  /**