@switchbot/homebridge-switchbot 2.8.0-beta.0 → 2.8.0-beta.2

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 (118) hide show
  1. package/.prettierrc +1 -1
  2. package/.vscode/settings.json +1 -1
  3. package/CHANGELOG.md +10 -0
  4. package/config.schema.json +8 -0
  5. package/dist/device/blindtilt.d.ts.map +1 -1
  6. package/dist/device/blindtilt.js +49 -59
  7. package/dist/device/blindtilt.js.map +1 -1
  8. package/dist/device/bot.d.ts.map +1 -1
  9. package/dist/device/bot.js +44 -50
  10. package/dist/device/bot.js.map +1 -1
  11. package/dist/device/ceilinglight.d.ts.map +1 -1
  12. package/dist/device/ceilinglight.js +60 -63
  13. package/dist/device/ceilinglight.js.map +1 -1
  14. package/dist/device/colorbulb.d.ts.map +1 -1
  15. package/dist/device/colorbulb.js +68 -70
  16. package/dist/device/colorbulb.js.map +1 -1
  17. package/dist/device/contact.d.ts.map +1 -1
  18. package/dist/device/contact.js +22 -25
  19. package/dist/device/contact.js.map +1 -1
  20. package/dist/device/curtain.d.ts.map +1 -1
  21. package/dist/device/curtain.js +50 -58
  22. package/dist/device/curtain.js.map +1 -1
  23. package/dist/device/hub.d.ts +6 -0
  24. package/dist/device/hub.d.ts.map +1 -1
  25. package/dist/device/hub.js +168 -26
  26. package/dist/device/hub.js.map +1 -1
  27. package/dist/device/humidifier.d.ts.map +1 -1
  28. package/dist/device/humidifier.js +49 -56
  29. package/dist/device/humidifier.js.map +1 -1
  30. package/dist/device/iosensor.d.ts.map +1 -1
  31. package/dist/device/iosensor.js +18 -20
  32. package/dist/device/iosensor.js.map +1 -1
  33. package/dist/device/lightstrip.d.ts.map +1 -1
  34. package/dist/device/lightstrip.js +59 -61
  35. package/dist/device/lightstrip.js.map +1 -1
  36. package/dist/device/lock.d.ts.map +1 -1
  37. package/dist/device/lock.js +40 -41
  38. package/dist/device/lock.js.map +1 -1
  39. package/dist/device/meter.d.ts +3 -3
  40. package/dist/device/meter.d.ts.map +1 -1
  41. package/dist/device/meter.js +65 -68
  42. package/dist/device/meter.js.map +1 -1
  43. package/dist/device/meterplus.d.ts.map +1 -1
  44. package/dist/device/meterplus.js +18 -20
  45. package/dist/device/meterplus.js.map +1 -1
  46. package/dist/device/motion.d.ts.map +1 -1
  47. package/dist/device/motion.js +20 -23
  48. package/dist/device/motion.js.map +1 -1
  49. package/dist/device/plug.d.ts.map +1 -1
  50. package/dist/device/plug.js +30 -33
  51. package/dist/device/plug.js.map +1 -1
  52. package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
  53. package/dist/device/robotvacuumcleaner.js +48 -51
  54. package/dist/device/robotvacuumcleaner.js.map +1 -1
  55. package/dist/irdevice/airconditioner.d.ts.map +1 -1
  56. package/dist/irdevice/airconditioner.js +58 -62
  57. package/dist/irdevice/airconditioner.js.map +1 -1
  58. package/dist/irdevice/airpurifier.d.ts.map +1 -1
  59. package/dist/irdevice/airpurifier.js +29 -31
  60. package/dist/irdevice/airpurifier.js.map +1 -1
  61. package/dist/irdevice/camera.d.ts.map +1 -1
  62. package/dist/irdevice/camera.js +17 -20
  63. package/dist/irdevice/camera.js.map +1 -1
  64. package/dist/irdevice/fan.d.ts.map +1 -1
  65. package/dist/irdevice/fan.js +27 -29
  66. package/dist/irdevice/fan.js.map +1 -1
  67. package/dist/irdevice/light.d.ts.map +1 -1
  68. package/dist/irdevice/light.js +23 -26
  69. package/dist/irdevice/light.js.map +1 -1
  70. package/dist/irdevice/other.d.ts.map +1 -1
  71. package/dist/irdevice/other.js +19 -20
  72. package/dist/irdevice/other.js.map +1 -1
  73. package/dist/irdevice/tv.d.ts.map +1 -1
  74. package/dist/irdevice/tv.js +44 -47
  75. package/dist/irdevice/tv.js.map +1 -1
  76. package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
  77. package/dist/irdevice/vacuumcleaner.js +17 -20
  78. package/dist/irdevice/vacuumcleaner.js.map +1 -1
  79. package/dist/irdevice/waterheater.d.ts.map +1 -1
  80. package/dist/irdevice/waterheater.js +19 -20
  81. package/dist/irdevice/waterheater.js.map +1 -1
  82. package/dist/platform.d.ts.map +1 -1
  83. package/dist/platform.js +44 -43
  84. package/dist/platform.js.map +1 -1
  85. package/dist/settings.d.ts +1 -0
  86. package/dist/settings.d.ts.map +1 -1
  87. package/dist/settings.js.map +1 -1
  88. package/dist/utils.js +1 -1
  89. package/dist/utils.js.map +1 -1
  90. package/package.json +1 -1
  91. package/src/device/blindtilt.ts +106 -72
  92. package/src/device/bot.ts +94 -58
  93. package/src/device/ceilinglight.ts +102 -68
  94. package/src/device/colorbulb.ts +134 -82
  95. package/src/device/contact.ts +54 -33
  96. package/src/device/curtain.ts +130 -101
  97. package/src/device/hub.ts +198 -35
  98. package/src/device/humidifier.ts +128 -80
  99. package/src/device/iosensor.ts +43 -27
  100. package/src/device/lightstrip.ts +108 -67
  101. package/src/device/lock.ts +73 -45
  102. package/src/device/meter.ts +94 -75
  103. package/src/device/meterplus.ts +43 -27
  104. package/src/device/motion.ts +50 -32
  105. package/src/device/plug.ts +62 -39
  106. package/src/device/robotvacuumcleaner.ts +78 -54
  107. package/src/irdevice/airconditioner.ts +112 -84
  108. package/src/irdevice/airpurifier.ts +55 -34
  109. package/src/irdevice/camera.ts +35 -23
  110. package/src/irdevice/fan.ts +47 -33
  111. package/src/irdevice/light.ts +43 -29
  112. package/src/irdevice/other.ts +39 -23
  113. package/src/irdevice/tv.ts +65 -51
  114. package/src/irdevice/vacuumcleaner.ts +35 -23
  115. package/src/irdevice/waterheater.ts +43 -27
  116. package/src/platform.ts +85 -55
  117. package/src/settings.ts +41 -40
  118. package/src/utils.ts +1 -1
@@ -59,10 +59,14 @@ export class CeilingLight {
59
59
  doCeilingLightUpdate!: Subject<void>;
60
60
 
61
61
  // Connection
62
- private readonly BLE = (this.device.connectionType === 'BLE' || this.device.connectionType === 'BLE/OpenAPI');
63
- private readonly OpenAPI = (this.device.connectionType === 'OpenAPI' || this.device.connectionType === 'BLE/OpenAPI');
64
-
65
- constructor(private readonly platform: SwitchBotPlatform, private accessory: PlatformAccessory, public device: device & devicesConfig) {
62
+ private readonly BLE = this.device.connectionType === 'BLE' || this.device.connectionType === 'BLE/OpenAPI';
63
+ private readonly OpenAPI = this.device.connectionType === 'OpenAPI' || this.device.connectionType === 'BLE/OpenAPI';
64
+
65
+ constructor(
66
+ private readonly platform: SwitchBotPlatform,
67
+ private accessory: PlatformAccessory,
68
+ public device: device & devicesConfig,
69
+ ) {
66
70
  // default placeholders
67
71
  this.logs(device);
68
72
  this.scan(device);
@@ -202,8 +206,10 @@ export class CeilingLight {
202
206
  await this.pushChanges();
203
207
  } catch (e: any) {
204
208
  this.apiError(e);
205
- this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} failed pushChanges with ${this.device.connectionType} Connection,`
206
- + ` Error Message: ${JSON.stringify(e.message)}`);
209
+ this.errorLog(
210
+ `${this.device.deviceType}: ${this.accessory.displayName} failed pushChanges with ${this.device.connectionType} Connection,` +
211
+ ` Error Message: ${JSON.stringify(e.message)}`,
212
+ );
207
213
  }
208
214
  this.ceilingLightUpdateInProgress = false;
209
215
  });
@@ -227,14 +233,15 @@ export class CeilingLight {
227
233
  async parseStatus(): Promise<void> {
228
234
  if (!this.device.enableCloudService && this.OpenAPI) {
229
235
  this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} parseStatus enableCloudService: ${this.device.enableCloudService}`);
230
- } else /*if (this.BLE) {
236
+ } /*if (this.BLE) {
231
237
  await this.BLEparseStatus();
232
- } else*/ if (this.OpenAPI && this.platform.config.credentials?.token) {
238
+ } else*/ else if (this.OpenAPI && this.platform.config.credentials?.token) {
233
239
  await this.openAPIparseStatus();
234
240
  } else {
235
241
  await this.offlineOff();
236
- this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} Connection Type:`
237
- + ` ${this.device.connectionType}, parseStatus will not happen.`);
242
+ this.debugWarnLog(
243
+ `${this.device.deviceType}: ${this.accessory.displayName} Connection Type:` + ` ${this.device.connectionType}, parseStatus will not happen.`,
244
+ );
238
245
  }
239
246
  }
240
247
 
@@ -275,8 +282,9 @@ export class CeilingLight {
275
282
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} blue: ${JSON.stringify(blue)}`);
276
283
 
277
284
  const [hue, saturation] = rgb2hs(Number(red), Number(green), Number(blue));
278
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName}`
279
- + ` hs: ${JSON.stringify(rgb2hs(Number(red), Number(green), Number(blue)))}`);
285
+ this.debugLog(
286
+ `${this.device.deviceType}: ${this.accessory.displayName}` + ` hs: ${JSON.stringify(rgb2hs(Number(red), Number(green), Number(blue)))}`,
287
+ );
280
288
 
281
289
  // Hue
282
290
  this.Hue = hue;
@@ -305,14 +313,16 @@ export class CeilingLight {
305
313
  async refreshStatus(): Promise<void> {
306
314
  if (!this.device.enableCloudService && this.OpenAPI) {
307
315
  this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} refreshStatus enableCloudService: ${this.device.enableCloudService}`);
308
- } else/*if (this.BLE) {
316
+ } /*if (this.BLE) {
309
317
  await this.BLERefreshStatus();
310
- } else*/ if (this.OpenAPI && this.platform.config.credentials?.token) {
318
+ } else*/ else if (this.OpenAPI && this.platform.config.credentials?.token) {
311
319
  await this.openAPIRefreshStatus();
312
320
  } else {
313
321
  await this.offlineOff();
314
- this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} Connection Type:`
315
- + ` ${this.device.connectionType}, refreshStatus will not happen.`);
322
+ this.debugWarnLog(
323
+ `${this.device.deviceType}: ${this.accessory.displayName} Connection Type:` +
324
+ ` ${this.device.connectionType}, refreshStatus will not happen.`,
325
+ );
316
326
  }
317
327
  }
318
328
 
@@ -337,8 +347,10 @@ export class CeilingLight {
337
347
  // Set an event hander
338
348
  switchbot.onadvertisement = async (ad: any) => {
339
349
  this.address = ad.address;
340
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Config BLE Address: ${this.device.bleMac},`
341
- + ` BLE Address Found: ${this.address}`);
350
+ this.debugLog(
351
+ `${this.device.deviceType}: ${this.accessory.displayName} Config BLE Address: ${this.device.bleMac},` +
352
+ ` BLE Address Found: ${this.address}`,
353
+ );
342
354
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} serviceData: ${JSON.stringify(ad.serviceData)}`);
343
355
  this.serviceData = ad.serviceData;
344
356
  //this.state = ad.serviceData.state;
@@ -373,8 +385,10 @@ export class CeilingLight {
373
385
  })
374
386
  .catch(async (e: any) => {
375
387
  this.apiError(e);
376
- this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} failed BLERefreshStatus with ${this.device.connectionType}`
377
- + ` Connection, Error Message: ${JSON.stringify(e.message)}`);
388
+ this.errorLog(
389
+ `${this.device.deviceType}: ${this.accessory.displayName} failed BLERefreshStatus with ${this.device.connectionType}` +
390
+ ` Connection, Error Message: ${JSON.stringify(e.message)}`,
391
+ );
378
392
  await this.BLERefreshConnection(switchbot);
379
393
  });
380
394
  } else {
@@ -392,10 +406,7 @@ export class CeilingLight {
392
406
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Devices: ${JSON.stringify(deviceStatus.body)}`);
393
407
  this.statusCode(statusCode);
394
408
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
395
- this.debugLog(
396
- `${this.device.deviceType}: ${this.accessory.displayName
397
- } refreshStatus: ${JSON.stringify(deviceStatus)}`,
398
- );
409
+ this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} refreshStatus: ${JSON.stringify(deviceStatus)}`);
399
410
  this.power = deviceStatus.body.power;
400
411
  this.color = deviceStatus.body.color;
401
412
  this.brightness = deviceStatus.body.brightness;
@@ -404,8 +415,10 @@ export class CeilingLight {
404
415
  this.updateHomeKitCharacteristics();
405
416
  } catch (e: any) {
406
417
  this.apiError(e);
407
- this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} failed openAPIRefreshStatus with ${this.device.connectionType}`
408
- + ` Connection, Error Message: ${JSON.stringify(e.message)}`);
418
+ this.errorLog(
419
+ `${this.device.deviceType}: ${this.accessory.displayName} failed openAPIRefreshStatus with ${this.device.connectionType}` +
420
+ ` Connection, Error Message: ${JSON.stringify(e.message)}`,
421
+ );
409
422
  }
410
423
  }
411
424
 
@@ -423,14 +436,15 @@ export class CeilingLight {
423
436
  async pushChanges(): Promise<void> {
424
437
  if (!this.device.enableCloudService && this.OpenAPI) {
425
438
  this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} pushChanges enableCloudService: ${this.device.enableCloudService}`);
426
- } else /*if (this.BLE) {
439
+ } /*if (this.BLE) {
427
440
  await this.BLEpushChanges();
428
- } else*/ if (this.OpenAPI && this.platform.config.credentials?.token) {
441
+ } else*/ else if (this.OpenAPI && this.platform.config.credentials?.token) {
429
442
  await this.openAPIpushChanges();
430
443
  } else {
431
444
  await this.offlineOff();
432
- this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} Connection Type:`
433
- + ` ${this.device.connectionType}, pushChanges will not happen.`);
445
+ this.debugWarnLog(
446
+ `${this.device.deviceType}: ${this.accessory.displayName} Connection Type:` + ` ${this.device.connectionType}, pushChanges will not happen.`,
447
+ );
434
448
  }
435
449
  // Refresh the status from the API
436
450
  interval(15000)
@@ -476,14 +490,15 @@ export class CeilingLight {
476
490
  })
477
491
  .catch(async (e: any) => {
478
492
  this.apiError(e);
479
- this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} failed BLEpushChanges with ${this.device.connectionType}`
480
- + ` Connection, Error Message: ${JSON.stringify(e.message)}`);
493
+ this.errorLog(
494
+ `${this.device.deviceType}: ${this.accessory.displayName} failed BLEpushChanges with ${this.device.connectionType}` +
495
+ ` Connection, Error Message: ${JSON.stringify(e.message)}`,
496
+ );
481
497
  await this.BLEPushConnection();
482
498
  });
483
499
  } else {
484
500
  this.debugLog(
485
- `${this.device.deviceType}: ${this.accessory.displayName} No BLEpushChanges.` + `On: ${this.On}, `
486
- + `OnCached: ${this.accessory.context.On}`,
501
+ `${this.device.deviceType}: ${this.accessory.displayName} No BLEpushChanges.` + `On: ${this.On}, ` + `OnCached: ${this.accessory.context.On}`,
487
502
  );
488
503
  }
489
504
  }
@@ -498,9 +513,9 @@ export class CeilingLight {
498
513
  command = 'turnOff';
499
514
  }
500
515
  const bodyChange = JSON.stringify({
501
- 'command': `${command}`,
502
- 'parameter': 'default',
503
- 'commandType': 'command',
516
+ command: `${command}`,
517
+ parameter: 'default',
518
+ commandType: 'command',
504
519
  });
505
520
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
506
521
  try {
@@ -515,13 +530,17 @@ export class CeilingLight {
515
530
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Headers: ${JSON.stringify(headers)}`);
516
531
  } catch (e: any) {
517
532
  this.apiError(e);
518
- this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} failed openAPIpushChanges with ${this.device.connectionType}`
519
- + ` Connection, Error Message: ${JSON.stringify(e.message)}`,
533
+ this.errorLog(
534
+ `${this.device.deviceType}: ${this.accessory.displayName} failed openAPIpushChanges with ${this.device.connectionType}` +
535
+ ` Connection, Error Message: ${JSON.stringify(e.message)}`,
520
536
  );
521
537
  }
522
538
  } else {
523
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} No openAPIpushChanges.` + `On: ${this.On}, `
524
- + `OnCached: ${this.accessory.context.On}`);
539
+ this.debugLog(
540
+ `${this.device.deviceType}: ${this.accessory.displayName} No openAPIpushChanges.` +
541
+ `On: ${this.On}, ` +
542
+ `OnCached: ${this.accessory.context.On}`,
543
+ );
525
544
  }
526
545
  // Push Hue & Saturation Update
527
546
  if (this.On) {
@@ -545,9 +564,9 @@ export class CeilingLight {
545
564
  const [red, green, blue] = hs2rgb(Number(this.Hue), Number(this.Saturation));
546
565
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} rgb: ${JSON.stringify([red, green, blue])}`);
547
566
  const bodyChange = JSON.stringify({
548
- 'command': 'setColor',
549
- 'parameter': `${red}:${green}:${blue}`,
550
- 'commandType': 'command',
567
+ command: 'setColor',
568
+ parameter: `${red}:${green}:${blue}`,
569
+ commandType: 'command',
551
570
  });
552
571
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
553
572
  try {
@@ -562,13 +581,16 @@ export class CeilingLight {
562
581
  this.debugLog(`Headers: ${JSON.stringify(headers)}`);
563
582
  } catch (e: any) {
564
583
  this.apiError(e);
565
- this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} failed pushHueSaturationChanges with ${this.device.connectionType}`
566
- + ` Connection, Error Message: ${JSON.stringify(e.message)}`,
584
+ this.errorLog(
585
+ `${this.device.deviceType}: ${this.accessory.displayName} failed pushHueSaturationChanges with ${this.device.connectionType}` +
586
+ ` Connection, Error Message: ${JSON.stringify(e.message)}`,
567
587
  );
568
588
  }
569
589
  } else {
570
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} No pushHueSaturationChanges. Hue: ${this.Hue}, `
571
- + `HueCached: ${this.accessory.context.Hue}, Saturation: ${this.Saturation}, SaturationCached: ${this.accessory.context.Saturation}`);
590
+ this.debugLog(
591
+ `${this.device.deviceType}: ${this.accessory.displayName} No pushHueSaturationChanges. Hue: ${this.Hue}, ` +
592
+ `HueCached: ${this.accessory.context.Hue}, Saturation: ${this.Saturation}, SaturationCached: ${this.accessory.context.Saturation}`,
593
+ );
572
594
  }
573
595
  }
574
596
 
@@ -578,9 +600,9 @@ export class CeilingLight {
578
600
  const kelvin = Math.round(1000000 / Number(this.ColorTemperature));
579
601
  this.cacheKelvin = kelvin;
580
602
  const bodyChange = JSON.stringify({
581
- 'command': 'setColorTemperature',
582
- 'parameter': `${kelvin}`,
583
- 'commandType': 'command',
603
+ command: 'setColorTemperature',
604
+ parameter: `${kelvin}`,
605
+ commandType: 'command',
584
606
  });
585
607
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
586
608
  try {
@@ -595,13 +617,16 @@ export class CeilingLight {
595
617
  this.debugLog(`Headers: ${JSON.stringify(headers)}`);
596
618
  } catch (e: any) {
597
619
  this.apiError(e);
598
- this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} failed pushColorTemperatureChanges with ${this.device.connectionType}`
599
- + ` Connection, Error Message: ${JSON.stringify(e.message)}`,
620
+ this.errorLog(
621
+ `${this.device.deviceType}: ${this.accessory.displayName} failed pushColorTemperatureChanges with ${this.device.connectionType}` +
622
+ ` Connection, Error Message: ${JSON.stringify(e.message)}`,
600
623
  );
601
624
  }
602
625
  } else {
603
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} No pushColorTemperatureChanges.` +
604
- `ColorTemperature: ${this.ColorTemperature}, ColorTemperatureCached: ${this.accessory.context.ColorTemperature}`);
626
+ this.debugLog(
627
+ `${this.device.deviceType}: ${this.accessory.displayName} No pushColorTemperatureChanges.` +
628
+ `ColorTemperature: ${this.ColorTemperature}, ColorTemperatureCached: ${this.accessory.context.ColorTemperature}`,
629
+ );
605
630
  }
606
631
  }
607
632
 
@@ -609,9 +634,9 @@ export class CeilingLight {
609
634
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} pushBrightnessChanges`);
610
635
  if (this.Brightness !== this.accessory.context.Brightness) {
611
636
  const bodyChange = JSON.stringify({
612
- 'command': 'setBrightness',
613
- 'parameter': `${this.Brightness}`,
614
- 'commandType': 'command',
637
+ command: 'setBrightness',
638
+ parameter: `${this.Brightness}`,
639
+ commandType: 'command',
615
640
  });
616
641
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
617
642
  try {
@@ -626,13 +651,17 @@ export class CeilingLight {
626
651
  this.debugLog(`Headers: ${JSON.stringify(headers)}`);
627
652
  } catch (e: any) {
628
653
  this.apiError(e);
629
- this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} failed pushBrightnessChanges with ${this.device.connectionType}`
630
- + ` Connection, Error Message: ${JSON.stringify(e.message)}`,
654
+ this.errorLog(
655
+ `${this.device.deviceType}: ${this.accessory.displayName} failed pushBrightnessChanges with ${this.device.connectionType}` +
656
+ ` Connection, Error Message: ${JSON.stringify(e.message)}`,
631
657
  );
632
658
  }
633
659
  } else {
634
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} No pushBrightnessChanges.` + `Brightness: ${this.Brightness}, `
635
- + `BrightnessCached: ${this.accessory.context.Brightness}`);
660
+ this.debugLog(
661
+ `${this.device.deviceType}: ${this.accessory.displayName} No pushBrightnessChanges.` +
662
+ `Brightness: ${this.Brightness}, ` +
663
+ `BrightnessCached: ${this.accessory.context.Brightness}`,
664
+ );
636
665
  }
637
666
  }
638
667
 
@@ -884,8 +913,10 @@ export class CeilingLight {
884
913
  this.offlineOff();
885
914
  break;
886
915
  case 171:
887
- this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} Hub Device is offline, statusCode: ${statusCode}. `
888
- + `Hub: ${this.device.hubDeviceId}`);
916
+ this.errorLog(
917
+ `${this.device.deviceType}: ${this.accessory.displayName} Hub Device is offline, statusCode: ${statusCode}. ` +
918
+ `Hub: ${this.device.hubDeviceId}`,
919
+ );
889
920
  this.offlineOff();
890
921
  break;
891
922
  case 190:
@@ -901,8 +932,10 @@ export class CeilingLight {
901
932
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Request successful, statusCode: ${statusCode}`);
902
933
  break;
903
934
  default:
904
- this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} Unknown statusCode: `
905
- + `${statusCode}, Submit Bugs Here: ' + 'https://tinyurl.com/SwitchBotBug`);
935
+ this.infoLog(
936
+ `${this.device.deviceType}: ${this.accessory.displayName} Unknown statusCode: ` +
937
+ `${statusCode}, Submit Bugs Here: ' + 'https://tinyurl.com/SwitchBotBug`,
938
+ );
906
939
  }
907
940
  }
908
941
 
@@ -923,8 +956,9 @@ export class CeilingLight {
923
956
 
924
957
  FirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig): CharacteristicValue {
925
958
  let FirmwareRevision: string;
926
- this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName}`
927
- + ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`);
959
+ this.debugLog(
960
+ `${this.device.deviceType}: ${this.accessory.displayName}` + ` accessory.context.FirmwareRevision: ${accessory.context.FirmwareRevision}`,
961
+ );
928
962
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} device.firmware: ${device.firmware}`);
929
963
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} this.platform.version: ${this.platform.version}`);
930
964
  if (accessory.context.FirmwareRevision) {