@switchbot/homebridge-switchbot 3.1.1-beta.6 → 3.1.1-beta.7

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 (63) hide show
  1. package/CHANGELOG.md +9 -9
  2. package/README.md +2 -2
  3. package/config.schema.json +1 -1
  4. package/dist/device/blindtilt.js +2 -2
  5. package/dist/device/blindtilt.js.map +1 -1
  6. package/dist/device/bot.js +14 -14
  7. package/dist/device/bot.js.map +1 -1
  8. package/dist/device/ceilinglight.js +1 -1
  9. package/dist/device/ceilinglight.js.map +1 -1
  10. package/dist/device/colorbulb.js +1 -1
  11. package/dist/device/colorbulb.js.map +1 -1
  12. package/dist/device/contact.d.ts +1 -1
  13. package/dist/device/contact.d.ts.map +1 -1
  14. package/dist/device/contact.js +6 -6
  15. package/dist/device/contact.js.map +1 -1
  16. package/dist/device/curtain.js +2 -2
  17. package/dist/device/curtain.js.map +1 -1
  18. package/dist/device/hub.js +1 -1
  19. package/dist/device/humidifier.js +1 -1
  20. package/dist/device/humidifier.js.map +1 -1
  21. package/dist/device/iosensor.js +2 -2
  22. package/dist/device/iosensor.js.map +1 -1
  23. package/dist/device/lightstrip.js +1 -1
  24. package/dist/device/lightstrip.js.map +1 -1
  25. package/dist/device/lock.js +1 -1
  26. package/dist/device/lock.js.map +1 -1
  27. package/dist/device/meter.js +2 -2
  28. package/dist/device/meter.js.map +1 -1
  29. package/dist/device/meterplus.js +2 -2
  30. package/dist/device/meterplus.js.map +1 -1
  31. package/dist/device/motion.js +1 -1
  32. package/dist/device/motion.js.map +1 -1
  33. package/dist/device/plug.js +1 -1
  34. package/dist/device/plug.js.map +1 -1
  35. package/dist/device/robotvacuumcleaner.js +1 -1
  36. package/dist/device/robotvacuumcleaner.js.map +1 -1
  37. package/dist/irdevice/fan.js +1 -1
  38. package/dist/irdevice/fan.js.map +1 -1
  39. package/dist/irdevice/other.js +12 -12
  40. package/dist/irdevice/other.js.map +1 -1
  41. package/dist/platform.d.ts +1 -1
  42. package/dist/platform.js +8 -8
  43. package/package.json +1 -1
  44. package/src/device/blindtilt.ts +2 -2
  45. package/src/device/bot.ts +14 -14
  46. package/src/device/ceilinglight.ts +1 -1
  47. package/src/device/colorbulb.ts +1 -1
  48. package/src/device/contact.ts +6 -6
  49. package/src/device/curtain.ts +2 -2
  50. package/src/device/hub.ts +1 -1
  51. package/src/device/humidifier.ts +1 -1
  52. package/src/device/iosensor.ts +2 -2
  53. package/src/device/lightstrip.ts +1 -1
  54. package/src/device/lock.ts +1 -1
  55. package/src/device/meter.ts +2 -2
  56. package/src/device/meterplus.ts +2 -2
  57. package/src/device/motion.ts +1 -1
  58. package/src/device/plug.ts +1 -1
  59. package/src/device/robotvacuumcleaner.ts +1 -1
  60. package/src/irdevice/fan.ts +1 -1
  61. package/src/irdevice/other.ts +12 -12
  62. package/src/platform.ts +8 -8
  63. package/src/settings.ts +1 -1
package/dist/platform.js CHANGED
@@ -142,7 +142,7 @@ export class SwitchBotPlatform {
142
142
  }
143
143
  }
144
144
  async setupwebhook() {
145
- //webhook configutation
145
+ //webhook configuration
146
146
  if (this.config.options?.webhookURL) {
147
147
  const url = this.config.options?.webhookURL;
148
148
  try {
@@ -2422,36 +2422,36 @@ export class SwitchBotPlatform {
2422
2422
  * Otherwise send debug logs to log.debug
2423
2423
  */
2424
2424
  infoLog(...log) {
2425
- if (this.enablingPlatfromLogging()) {
2425
+ if (this.enablingPlatformLogging()) {
2426
2426
  this.log.info(String(...log));
2427
2427
  }
2428
2428
  }
2429
2429
  warnLog(...log) {
2430
- if (this.enablingPlatfromLogging()) {
2430
+ if (this.enablingPlatformLogging()) {
2431
2431
  this.log.warn(String(...log));
2432
2432
  }
2433
2433
  }
2434
2434
  debugWarnLog(...log) {
2435
- if (this.enablingPlatfromLogging()) {
2435
+ if (this.enablingPlatformLogging()) {
2436
2436
  if (this.platformLogging?.includes('debug')) {
2437
2437
  this.log.warn('[DEBUG]', String(...log));
2438
2438
  }
2439
2439
  }
2440
2440
  }
2441
2441
  errorLog(...log) {
2442
- if (this.enablingPlatfromLogging()) {
2442
+ if (this.enablingPlatformLogging()) {
2443
2443
  this.log.error(String(...log));
2444
2444
  }
2445
2445
  }
2446
2446
  debugErrorLog(...log) {
2447
- if (this.enablingPlatfromLogging()) {
2447
+ if (this.enablingPlatformLogging()) {
2448
2448
  if (this.platformLogging?.includes('debug')) {
2449
2449
  this.log.error('[DEBUG]', String(...log));
2450
2450
  }
2451
2451
  }
2452
2452
  }
2453
2453
  debugLog(...log) {
2454
- if (this.enablingPlatfromLogging()) {
2454
+ if (this.enablingPlatformLogging()) {
2455
2455
  if (this.platformLogging === 'debugMode') {
2456
2456
  this.log.debug(String(...log));
2457
2457
  }
@@ -2460,7 +2460,7 @@ export class SwitchBotPlatform {
2460
2460
  }
2461
2461
  }
2462
2462
  }
2463
- enablingPlatfromLogging() {
2463
+ enablingPlatformLogging() {
2464
2464
  return this.platformLogging?.includes('debug') || this.platformLogging === 'standard';
2465
2465
  }
2466
2466
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "SwitchBot",
3
3
  "name": "@switchbot/homebridge-switchbot",
4
- "version": "3.1.1-beta.6",
4
+ "version": "3.1.1-beta.7",
5
5
  "description": "The SwitchBot plugin allows you to access your SwitchBot device(s) from HomeKit.",
6
6
  "author": {
7
7
  "name": "SwitchBot",
@@ -515,7 +515,7 @@ export class BlindTilt {
515
515
  id: this.device.bleMac,
516
516
  })
517
517
  .then(async () => {
518
- // Set an event hander
518
+ // Set an event handler
519
519
  switchbot.onadvertisement = async (ad: ad) => {
520
520
  this.debugLog(
521
521
  `${this.device.deviceType}: ${this.accessory.displayName} Config BLE Address: ${this.device.bleMac},` +
@@ -933,7 +933,7 @@ export class BlindTilt {
933
933
  }
934
934
 
935
935
  /*
936
- * Setup MQTT hadler if URL is specifed.
936
+ * Setup MQTT hadler if URL is specified.
937
937
  */
938
938
  async setupMqtt(device: device & devicesConfig): Promise<void> {
939
939
  if (device.mqttURL) {
package/src/device/bot.ts CHANGED
@@ -549,7 +549,7 @@ export class Bot {
549
549
  id: this.device.bleMac,
550
550
  })
551
551
  .then(async () => {
552
- // Set an event hander
552
+ // Set an event handler
553
553
  switchbot.onadvertisement = async (ad: ad) => {
554
554
  this.debugLog(
555
555
  `${this.device.deviceType}: ${this.accessory.displayName} Config BLE Address: ${this.device.bleMac},` +
@@ -753,7 +753,7 @@ export class Bot {
753
753
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Press Mode`);
754
754
  this.On = false;
755
755
  } else {
756
- throw new Error(`${this.device.deviceType}: ${this.accessory.displayName} Device Paramters not set for this Bot.`);
756
+ throw new Error(`${this.device.deviceType}: ${this.accessory.displayName} Device Parameters not set for this Bot.`);
757
757
  }
758
758
  const bodyChange = JSON.stringify({
759
759
  command: `${command}`,
@@ -1069,7 +1069,7 @@ export class Bot {
1069
1069
  }
1070
1070
 
1071
1071
  async removeOutletService(accessory: PlatformAccessory): Promise<void> {
1072
- // If outletService still pressent, then remove first
1072
+ // If outletService still present, then remove first
1073
1073
  this.outletService = this.accessory.getService(this.hap.Service.Outlet);
1074
1074
  if (this.outletService) {
1075
1075
  this.warnLog(`${this.device.deviceType}: ${accessory.displayName} Removing Leftover Outlet Service`);
@@ -1078,7 +1078,7 @@ export class Bot {
1078
1078
  }
1079
1079
 
1080
1080
  async removeGarageDoorService(accessory: PlatformAccessory): Promise<void> {
1081
- // If garageDoorService still pressent, then remove first
1081
+ // If garageDoorService still present, then remove first
1082
1082
  this.garageDoorService = this.accessory.getService(this.hap.Service.GarageDoorOpener);
1083
1083
  if (this.garageDoorService) {
1084
1084
  this.warnLog(`${this.device.deviceType}: ${accessory.displayName} Removing Leftover Garage Door Service`);
@@ -1087,7 +1087,7 @@ export class Bot {
1087
1087
  }
1088
1088
 
1089
1089
  async removeDoorService(accessory: PlatformAccessory): Promise<void> {
1090
- // If doorService still pressent, then remove first
1090
+ // If doorService still present, then remove first
1091
1091
  this.doorService = this.accessory.getService(this.hap.Service.Door);
1092
1092
  if (this.doorService) {
1093
1093
  this.warnLog(`${this.device.deviceType}: ${accessory.displayName} Removing Leftover Door Service`);
@@ -1096,7 +1096,7 @@ export class Bot {
1096
1096
  }
1097
1097
 
1098
1098
  async removeLockService(accessory: PlatformAccessory): Promise<void> {
1099
- // If lockService still pressent, then remove first
1099
+ // If lockService still present, then remove first
1100
1100
  this.lockService = this.accessory.getService(this.hap.Service.LockMechanism);
1101
1101
  if (this.lockService) {
1102
1102
  this.warnLog(`${this.device.deviceType}: ${accessory.displayName} Removing Leftover Lock Service`);
@@ -1105,7 +1105,7 @@ export class Bot {
1105
1105
  }
1106
1106
 
1107
1107
  async removeFaucetService(accessory: PlatformAccessory): Promise<void> {
1108
- // If faucetService still pressent, then remove first
1108
+ // If faucetService still present, then remove first
1109
1109
  this.faucetService = this.accessory.getService(this.hap.Service.Faucet);
1110
1110
  if (this.faucetService) {
1111
1111
  this.warnLog(`${this.device.deviceType}: ${accessory.displayName} Removing Leftover Faucet Service`);
@@ -1114,7 +1114,7 @@ export class Bot {
1114
1114
  }
1115
1115
 
1116
1116
  async removeFanService(accessory: PlatformAccessory): Promise<void> {
1117
- // If fanService still pressent, then remove first
1117
+ // If fanService still present, then remove first
1118
1118
  this.fanService = this.accessory.getService(this.hap.Service.Fan);
1119
1119
  if (this.fanService) {
1120
1120
  this.warnLog(`${this.device.deviceType}: ${accessory.displayName} Removing Leftover Fan Service`);
@@ -1123,7 +1123,7 @@ export class Bot {
1123
1123
  }
1124
1124
 
1125
1125
  async removeWindowService(accessory: PlatformAccessory): Promise<void> {
1126
- // If windowService still pressent, then remove first
1126
+ // If windowService still present, then remove first
1127
1127
  this.windowService = this.accessory.getService(this.hap.Service.Window);
1128
1128
  if (this.windowService) {
1129
1129
  this.warnLog(`${this.device.deviceType}: ${accessory.displayName} Removing Leftover Window Service`);
@@ -1132,7 +1132,7 @@ export class Bot {
1132
1132
  }
1133
1133
 
1134
1134
  async removeWindowCoveringService(accessory: PlatformAccessory): Promise<void> {
1135
- // If windowCoveringService still pressent, then remove first
1135
+ // If windowCoveringService still present, then remove first
1136
1136
  this.windowCoveringService = this.accessory.getService(this.hap.Service.WindowCovering);
1137
1137
  if (this.windowCoveringService) {
1138
1138
  this.warnLog(`${this.device.deviceType}: ${accessory.displayName} Removing Leftover Window Covering Service`);
@@ -1141,7 +1141,7 @@ export class Bot {
1141
1141
  }
1142
1142
 
1143
1143
  async removeStatefulProgrammableSwitchService(accessory: PlatformAccessory): Promise<void> {
1144
- // If statefulProgrammableSwitchService still pressent, then remove first
1144
+ // If statefulProgrammableSwitchService still present, then remove first
1145
1145
  this.statefulProgrammableSwitchService = this.accessory.getService(this.hap.Service.StatefulProgrammableSwitch);
1146
1146
  if (this.statefulProgrammableSwitchService) {
1147
1147
  this.warnLog(`${this.device.deviceType}: ${accessory.displayName} Removing Leftover Stateful Programmable Switch Service`);
@@ -1150,7 +1150,7 @@ export class Bot {
1150
1150
  }
1151
1151
 
1152
1152
  async removeSwitchService(accessory: PlatformAccessory): Promise<void> {
1153
- // If switchService still pressent, then remove first
1153
+ // If switchService still present, then remove first
1154
1154
  this.switchService = this.accessory.getService(this.hap.Service.Switch);
1155
1155
  if (this.switchService) {
1156
1156
  this.warnLog(`${this.device.deviceType}: ${accessory.displayName} Removing Leftover Switch Service`);
@@ -1360,10 +1360,10 @@ export class Bot {
1360
1360
  async deviceType(device: device & devicesConfig): Promise<void> {
1361
1361
  if (!device.bot?.deviceType && this.accessory.context.deviceType) {
1362
1362
  this.botDeviceType = this.accessory.context.deviceType;
1363
- this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} Using Device Type: ${this.botDeviceType}, from Accesory Cache.`);
1363
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} Using Device Type: ${this.botDeviceType}, from Accessory Cache.`);
1364
1364
  } else if (device.bot?.deviceType) {
1365
1365
  this.accessory.context.deviceType = device.bot.deviceType;
1366
- this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} Accesory Cache: ${this.accessory.context.deviceType}`);
1366
+ this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} Accessory Cache: ${this.accessory.context.deviceType}`);
1367
1367
  this.botDeviceType = this.accessory.context.deviceType;
1368
1368
  this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} Using Device Type: ${this.botDeviceType}`);
1369
1369
  } else {
@@ -378,7 +378,7 @@ export class CeilingLight {
378
378
  id: this.device.bleMac,
379
379
  })
380
380
  .then(async () => {
381
- // Set an event hander
381
+ // Set an event handler
382
382
  switchbot.onadvertisement = async (ad: ad) => {
383
383
  this.debugLog(
384
384
  `${this.device.deviceType}: ${this.accessory.displayName} Config BLE Address: ${this.device.bleMac},` +
@@ -424,7 +424,7 @@ export class ColorBulb {
424
424
  id: this.device.bleMac,
425
425
  })
426
426
  .then(async () => {
427
- // Set an event hander
427
+ // Set an event handler
428
428
  switchbot.onadvertisement = async (ad: ad) => {
429
429
  this.debugLog(
430
430
  `${this.device.deviceType}: ${this.accessory.displayName} Config BLE Address: ${this.device.bleMac},` +
@@ -38,7 +38,7 @@ export class Contact {
38
38
  OpenAPI_CurrentAmbientLightLevel: deviceStatus['brightness'];
39
39
 
40
40
  // BLE Status
41
- BLE_BateryLevel!: serviceData['battery'];
41
+ BLE_BatteryLevel!: serviceData['battery'];
42
42
  BLE_MotionDetected!: serviceData['movement'];
43
43
  BLE_ContactSensorState!: serviceData['doorState'];
44
44
  BLE_CurrentAmbientLightLevel: serviceData['lightLevel'];
@@ -257,10 +257,10 @@ export class Contact {
257
257
  }
258
258
  }
259
259
  // Battery
260
- if (this.BLE_BateryLevel === undefined) {
261
- this.BLE_BateryLevel === 100;
260
+ if (this.BLE_BatteryLevel === undefined) {
261
+ this.BLE_BatteryLevel === 100;
262
262
  }
263
- this.BatteryLevel = Number(this.BLE_BateryLevel);
263
+ this.BatteryLevel = Number(this.BLE_BatteryLevel);
264
264
  if (this.BatteryLevel < 10) {
265
265
  this.StatusLowBattery = this.hap.Characteristic.StatusLowBattery.BATTERY_LEVEL_LOW;
266
266
  } else {
@@ -360,7 +360,7 @@ export class Contact {
360
360
  id: this.device.bleMac,
361
361
  })
362
362
  .then(async () => {
363
- // Set an event hander
363
+ // Set an event handler
364
364
  this.scanning = true;
365
365
  switchbot.onadvertisement = async (ad: ad) => {
366
366
  this.debugLog(
@@ -368,7 +368,7 @@ export class Contact {
368
368
  ` BLE Address Found: ${ad.address}`,
369
369
  );
370
370
  this.BLE_MotionDetected = ad.serviceData.movement;
371
- this.BLE_BateryLevel = ad.serviceData.battery;
371
+ this.BLE_BatteryLevel = ad.serviceData.battery;
372
372
  this.BLE_ContactSensorState = ad.serviceData.doorState;
373
373
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} serviceData: ${JSON.stringify(ad.serviceData)}`);
374
374
  this.debugLog(
@@ -559,7 +559,7 @@ export class Curtain {
559
559
  id: this.device.bleMac,
560
560
  })
561
561
  .then(async () => {
562
- // Set an event hander
562
+ // Set an event handler
563
563
  switchbot.onadvertisement = async (ad: ad) => {
564
564
  this.debugLog(
565
565
  `${this.device.deviceType}: ${this.accessory.displayName} Config BLE Address: ${this.device.bleMac},` +
@@ -962,7 +962,7 @@ export class Curtain {
962
962
  }
963
963
 
964
964
  /*
965
- * Setup MQTT hadler if URL is specifed.
965
+ * Setup MQTT hadler if URL is specified.
966
966
  */
967
967
  async setupMqtt(device: device & devicesConfig): Promise<void> {
968
968
  if (device.mqttURL) {
package/src/device/hub.ts CHANGED
@@ -547,7 +547,7 @@ export class Hub {
547
547
  }
548
548
 
549
549
  /*
550
- * Setup MQTT hadler if URL is specifed.
550
+ * Setup MQTT hadler if URL is specified.
551
551
  */
552
552
  async setupMqtt(device: device & devicesConfig): Promise<void> {
553
553
  if (device.mqttURL) {
@@ -355,7 +355,7 @@ export class Humidifier {
355
355
  id: this.device.bleMac,
356
356
  })
357
357
  .then(async () => {
358
- // Set an event hander
358
+ // Set an event handler
359
359
  switchbot.onadvertisement = async (ad: ad) => {
360
360
  this.debugLog(
361
361
  `${this.device.deviceType}: ${this.accessory.displayName} Config BLE Address: ${this.device.bleMac},` +
@@ -328,7 +328,7 @@ export class IOSensor {
328
328
  id: this.device.bleMac,
329
329
  })
330
330
  .then(async () => {
331
- // Set an event hander
331
+ // Set an event handler
332
332
  switchbot.onadvertisement = async (ad: ad) => {
333
333
  this.debugLog(
334
334
  `${this.device.deviceType}: ${this.accessory.displayName} Config BLE Address: ${this.device.bleMac},` +
@@ -495,7 +495,7 @@ export class IOSensor {
495
495
  }
496
496
 
497
497
  /*
498
- * Setup MQTT hadler if URL is specifed.
498
+ * Setup MQTT hadler if URL is specified.
499
499
  */
500
500
  async setupMqtt(device: device & devicesConfig): Promise<void> {
501
501
  if (device.mqttURL) {
@@ -371,7 +371,7 @@ export class StripLight {
371
371
  id: this.device.bleMac,
372
372
  })
373
373
  .then(async () => {
374
- // Set an event hander
374
+ // Set an event handler
375
375
  switchbot.onadvertisement = async (ad: ad) => {
376
376
  this.debugLog(
377
377
  `${this.device.deviceType}: ${this.accessory.displayName} Config BLE Address: ${this.device.bleMac},` +
@@ -391,7 +391,7 @@ export class Lock {
391
391
  id: this.device.bleMac,
392
392
  })
393
393
  .then(async () => {
394
- // Set an event hander
394
+ // Set an event handler
395
395
  switchbot.onadvertisement = async (ad: ad) => {
396
396
  this.debugLog(
397
397
  `${this.device.deviceType}: ${this.accessory.displayName} Config BLE Address: ${this.device.bleMac},` +
@@ -317,7 +317,7 @@ export class Meter {
317
317
  id: this.device.bleMac,
318
318
  })
319
319
  .then(async () => {
320
- // Set an event hander
320
+ // Set an event handler
321
321
  switchbot.onadvertisement = async (ad: ad) => {
322
322
  this.debugLog(
323
323
  `${this.device.deviceType}: ${this.accessory.displayName} Config BLE Address: ${this.device.bleMac},` +
@@ -488,7 +488,7 @@ export class Meter {
488
488
  }
489
489
 
490
490
  /*
491
- * Setup MQTT hadler if URL is specifed.
491
+ * Setup MQTT hadler if URL is specified.
492
492
  */
493
493
  async setupMqtt(device: device & devicesConfig): Promise<void> {
494
494
  if (device.mqttURL) {
@@ -319,7 +319,7 @@ export class MeterPlus {
319
319
  id: this.device.bleMac,
320
320
  })
321
321
  .then(async () => {
322
- // Set an event hander
322
+ // Set an event handler
323
323
  switchbot.onadvertisement = async (ad: ad) => {
324
324
  this.debugLog(
325
325
  `${this.device.deviceType}: ${this.accessory.displayName} Config BLE Address: ${this.device.bleMac},` +
@@ -493,7 +493,7 @@ export class MeterPlus {
493
493
  }
494
494
 
495
495
  /*
496
- * Setup MQTT hadler if URL is specifed.
496
+ * Setup MQTT hadler if URL is specified.
497
497
  */
498
498
  async setupMqtt(device: device & devicesConfig): Promise<void> {
499
499
  if (device.mqttURL) {
@@ -306,7 +306,7 @@ export class Motion {
306
306
  return await this.retry({
307
307
  max: this.maxRetry(),
308
308
  fn: async () => {
309
- // Set an event hander
309
+ // Set an event handler
310
310
  this.scanning = true;
311
311
  switchbot.onadvertisement = async (ad: ad) => {
312
312
  this.debugLog(
@@ -227,7 +227,7 @@ export class Plug {
227
227
  id: this.device.bleMac,
228
228
  })
229
229
  .then(async () => {
230
- // Set an event hander
230
+ // Set an event handler
231
231
  switchbot.onadvertisement = async (ad: ad) => {
232
232
  this.debugLog(
233
233
  `${this.device.deviceType}: ${this.accessory.displayName} Config BLE Address: ${this.device.bleMac},` +
@@ -274,7 +274,7 @@ export class RobotVacuumCleaner {
274
274
  id: this.device.bleMac,
275
275
  })
276
276
  .then(async () => {
277
- // Set an event hander
277
+ // Set an event handler
278
278
  switchbot.onadvertisement = async (ad: ad) => {
279
279
  this.debugLog(
280
280
  `${this.device.deviceType}: ${this.accessory.displayName} Config BLE Address: ${this.device.bleMac},` +
@@ -86,7 +86,7 @@ export class Fan {
86
86
  } else {
87
87
  this.maxValue = 100;
88
88
  }
89
- // handle Roation Speed events using the RotationSpeed characteristic
89
+ // handle Rotation Speed events using the RotationSpeed characteristic
90
90
  this.fanService
91
91
  .getCharacteristic(this.hap.Characteristic.RotationSpeed)
92
92
  .setProps({
@@ -770,7 +770,7 @@ export class Others {
770
770
  }
771
771
 
772
772
  async removeOutletService(accessory: PlatformAccessory): Promise<void> {
773
- // If outletService still pressent, then remove first
773
+ // If outletService still present, then remove first
774
774
  this.outletService = this.accessory.getService(this.hap.Service.Outlet);
775
775
  if (this.outletService) {
776
776
  this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Outlet Service`);
@@ -779,7 +779,7 @@ export class Others {
779
779
  }
780
780
 
781
781
  async removeGarageDoorService(accessory: PlatformAccessory): Promise<void> {
782
- // If garageDoorService still pressent, then remove first
782
+ // If garageDoorService still present, then remove first
783
783
  this.garageDoorService = this.accessory.getService(this.hap.Service.GarageDoorOpener);
784
784
  if (this.garageDoorService) {
785
785
  this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Garage Door Service`);
@@ -788,7 +788,7 @@ export class Others {
788
788
  }
789
789
 
790
790
  async removeDoorService(accessory: PlatformAccessory): Promise<void> {
791
- // If doorService still pressent, then remove first
791
+ // If doorService still present, then remove first
792
792
  this.doorService = this.accessory.getService(this.hap.Service.Door);
793
793
  if (this.doorService) {
794
794
  this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Door Service`);
@@ -797,7 +797,7 @@ export class Others {
797
797
  }
798
798
 
799
799
  async removeLockService(accessory: PlatformAccessory): Promise<void> {
800
- // If lockService still pressent, then remove first
800
+ // If lockService still present, then remove first
801
801
  this.lockService = this.accessory.getService(this.hap.Service.LockMechanism);
802
802
  if (this.lockService) {
803
803
  this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Lock Service`);
@@ -806,7 +806,7 @@ export class Others {
806
806
  }
807
807
 
808
808
  async removeFaucetService(accessory: PlatformAccessory): Promise<void> {
809
- // If faucetService still pressent, then remove first
809
+ // If faucetService still present, then remove first
810
810
  this.faucetService = this.accessory.getService(this.hap.Service.Faucet);
811
811
  if (this.faucetService) {
812
812
  this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Faucet Service`);
@@ -815,7 +815,7 @@ export class Others {
815
815
  }
816
816
 
817
817
  async removeFanService(accessory: PlatformAccessory): Promise<void> {
818
- // If fanService still pressent, then remove first
818
+ // If fanService still present, then remove first
819
819
  this.fanService = this.accessory.getService(this.hap.Service.Fan);
820
820
  if (this.fanService) {
821
821
  this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Fan Service`);
@@ -824,7 +824,7 @@ export class Others {
824
824
  }
825
825
 
826
826
  async removeWindowService(accessory: PlatformAccessory): Promise<void> {
827
- // If windowService still pressent, then remove first
827
+ // If windowService still present, then remove first
828
828
  this.windowService = this.accessory.getService(this.hap.Service.Window);
829
829
  if (this.windowService) {
830
830
  this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Window Service`);
@@ -833,7 +833,7 @@ export class Others {
833
833
  }
834
834
 
835
835
  async removeWindowCoveringService(accessory: PlatformAccessory): Promise<void> {
836
- // If windowCoveringService still pressent, then remove first
836
+ // If windowCoveringService still present, then remove first
837
837
  this.windowCoveringService = this.accessory.getService(this.hap.Service.WindowCovering);
838
838
  if (this.windowCoveringService) {
839
839
  this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Window Covering Service`);
@@ -842,7 +842,7 @@ export class Others {
842
842
  }
843
843
 
844
844
  async removeStatefulProgrammableSwitchService(accessory: PlatformAccessory): Promise<void> {
845
- // If statefulProgrammableSwitchService still pressent, then remove first
845
+ // If statefulProgrammableSwitchService still present, then remove first
846
846
  this.statefulProgrammableSwitchService = this.accessory.getService(this.hap.Service.StatefulProgrammableSwitch);
847
847
  if (this.statefulProgrammableSwitchService) {
848
848
  this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Stateful Programmable Switch Service`);
@@ -851,7 +851,7 @@ export class Others {
851
851
  }
852
852
 
853
853
  async removeSwitchService(accessory: PlatformAccessory): Promise<void> {
854
- // If switchService still pressent, then remove first
854
+ // If switchService still present, then remove first
855
855
  this.switchService = this.accessory.getService(this.hap.Service.Switch);
856
856
  if (this.switchService) {
857
857
  this.warnLog(`${this.device.remoteType}: ${accessory.displayName} Removing Leftover Switch Service`);
@@ -862,10 +862,10 @@ export class Others {
862
862
  async deviceType(device: irdevice & irDevicesConfig): Promise<void> {
863
863
  if (!device.other?.deviceType && this.accessory.context.deviceType) {
864
864
  this.otherDeviceType = this.accessory.context.deviceType;
865
- this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Device Type: ${this.otherDeviceType}, from Accesory Cache.`);
865
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Device Type: ${this.otherDeviceType}, from Accessory Cache.`);
866
866
  } else if (device.other?.deviceType) {
867
867
  this.accessory.context.deviceType = device.other.deviceType;
868
- this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} Accesory Cache: ${this.accessory.context.deviceType}`);
868
+ this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} Accessory Cache: ${this.accessory.context.deviceType}`);
869
869
  this.otherDeviceType = this.accessory.context.deviceType;
870
870
  this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} Using Device Type: ${this.otherDeviceType}`);
871
871
  } else {
package/src/platform.ts CHANGED
@@ -158,7 +158,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
158
158
  }
159
159
 
160
160
  async setupwebhook() {
161
- //webhook configutation
161
+ //webhook configuration
162
162
  if (this.config.options?.webhookURL) {
163
163
  const url = this.config.options?.webhookURL;
164
164
 
@@ -2551,19 +2551,19 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
2551
2551
  * Otherwise send debug logs to log.debug
2552
2552
  */
2553
2553
  infoLog(...log: any[]): void {
2554
- if (this.enablingPlatfromLogging()) {
2554
+ if (this.enablingPlatformLogging()) {
2555
2555
  this.log.info(String(...log));
2556
2556
  }
2557
2557
  }
2558
2558
 
2559
2559
  warnLog(...log: any[]): void {
2560
- if (this.enablingPlatfromLogging()) {
2560
+ if (this.enablingPlatformLogging()) {
2561
2561
  this.log.warn(String(...log));
2562
2562
  }
2563
2563
  }
2564
2564
 
2565
2565
  debugWarnLog(...log: any[]): void {
2566
- if (this.enablingPlatfromLogging()) {
2566
+ if (this.enablingPlatformLogging()) {
2567
2567
  if (this.platformLogging?.includes('debug')) {
2568
2568
  this.log.warn('[DEBUG]', String(...log));
2569
2569
  }
@@ -2571,13 +2571,13 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
2571
2571
  }
2572
2572
 
2573
2573
  errorLog(...log: any[]): void {
2574
- if (this.enablingPlatfromLogging()) {
2574
+ if (this.enablingPlatformLogging()) {
2575
2575
  this.log.error(String(...log));
2576
2576
  }
2577
2577
  }
2578
2578
 
2579
2579
  debugErrorLog(...log: any[]): void {
2580
- if (this.enablingPlatfromLogging()) {
2580
+ if (this.enablingPlatformLogging()) {
2581
2581
  if (this.platformLogging?.includes('debug')) {
2582
2582
  this.log.error('[DEBUG]', String(...log));
2583
2583
  }
@@ -2585,7 +2585,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
2585
2585
  }
2586
2586
 
2587
2587
  debugLog(...log: any[]): void {
2588
- if (this.enablingPlatfromLogging()) {
2588
+ if (this.enablingPlatformLogging()) {
2589
2589
  if (this.platformLogging === 'debugMode') {
2590
2590
  this.log.debug(String(...log));
2591
2591
  } else if (this.platformLogging === 'debug') {
@@ -2594,7 +2594,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
2594
2594
  }
2595
2595
  }
2596
2596
 
2597
- enablingPlatfromLogging(): boolean {
2597
+ enablingPlatformLogging(): boolean {
2598
2598
  return this.platformLogging?.includes('debug') || this.platformLogging === 'standard';
2599
2599
  }
2600
2600
  }
package/src/settings.ts CHANGED
@@ -303,7 +303,7 @@ export type deviceStatus = {
303
303
  mode?: number; //available for devices. the fan mode. (Used by the following deviceTypes: Smart Fan)
304
304
  speed?: number; //the fan speed. (Used by the following deviceTypes: Smart Fan)
305
305
  shaking?: boolean; //determines if the fan is swinging or not. (Used by the following deviceTypes: Smart Fan)
306
- shakeCenter?: string; //the fan's swing direciton. (Used by the following deviceTypes: Smart Fan)
306
+ shakeCenter?: string; //the fan's swing direction. (Used by the following deviceTypes: Smart Fan)
307
307
  shakeRange?: string; //the fan's swing range, 0~120°. (Used by the following deviceTypes: Smart Fan)
308
308
  };
309
309