@switchbot/homebridge-switchbot 2.0.0-beta.33 → 2.0.0-beta.35

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 (85) hide show
  1. package/config.schema.json +33 -0
  2. package/dist/device/bot.d.ts.map +1 -1
  3. package/dist/device/bot.js +3 -0
  4. package/dist/device/bot.js.map +1 -1
  5. package/dist/device/colorbulb.d.ts.map +1 -1
  6. package/dist/device/colorbulb.js +3 -0
  7. package/dist/device/colorbulb.js.map +1 -1
  8. package/dist/device/contact.d.ts.map +1 -1
  9. package/dist/device/contact.js +3 -0
  10. package/dist/device/contact.js.map +1 -1
  11. package/dist/device/curtain.d.ts.map +1 -1
  12. package/dist/device/curtain.js +24 -7
  13. package/dist/device/curtain.js.map +1 -1
  14. package/dist/device/humidifier.d.ts.map +1 -1
  15. package/dist/device/humidifier.js +3 -0
  16. package/dist/device/humidifier.js.map +1 -1
  17. package/dist/device/lock.d.ts.map +1 -1
  18. package/dist/device/lock.js +3 -0
  19. package/dist/device/lock.js.map +1 -1
  20. package/dist/device/meter.d.ts.map +1 -1
  21. package/dist/device/meter.js +23 -8
  22. package/dist/device/meter.js.map +1 -1
  23. package/dist/device/meterplus.d.ts.map +1 -1
  24. package/dist/device/meterplus.js +23 -8
  25. package/dist/device/meterplus.js.map +1 -1
  26. package/dist/device/motion.d.ts.map +1 -1
  27. package/dist/device/motion.js +3 -0
  28. package/dist/device/motion.js.map +1 -1
  29. package/dist/device/plug.d.ts.map +1 -1
  30. package/dist/device/plug.js +3 -0
  31. package/dist/device/plug.js.map +1 -1
  32. package/dist/device/striplight.d.ts.map +1 -1
  33. package/dist/device/striplight.js +3 -0
  34. package/dist/device/striplight.js.map +1 -1
  35. package/dist/irdevice/airconditioner.d.ts.map +1 -1
  36. package/dist/irdevice/airconditioner.js +3 -0
  37. package/dist/irdevice/airconditioner.js.map +1 -1
  38. package/dist/irdevice/airpurifier.d.ts.map +1 -1
  39. package/dist/irdevice/airpurifier.js +3 -0
  40. package/dist/irdevice/airpurifier.js.map +1 -1
  41. package/dist/irdevice/camera.d.ts.map +1 -1
  42. package/dist/irdevice/camera.js +3 -0
  43. package/dist/irdevice/camera.js.map +1 -1
  44. package/dist/irdevice/fan.d.ts.map +1 -1
  45. package/dist/irdevice/fan.js +3 -0
  46. package/dist/irdevice/fan.js.map +1 -1
  47. package/dist/irdevice/light.d.ts.map +1 -1
  48. package/dist/irdevice/light.js +3 -0
  49. package/dist/irdevice/light.js.map +1 -1
  50. package/dist/irdevice/other.d.ts.map +1 -1
  51. package/dist/irdevice/other.js +3 -0
  52. package/dist/irdevice/other.js.map +1 -1
  53. package/dist/irdevice/tv.d.ts.map +1 -1
  54. package/dist/irdevice/tv.js +3 -0
  55. package/dist/irdevice/tv.js.map +1 -1
  56. package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
  57. package/dist/irdevice/vacuumcleaner.js +3 -0
  58. package/dist/irdevice/vacuumcleaner.js.map +1 -1
  59. package/dist/irdevice/waterheater.d.ts.map +1 -1
  60. package/dist/irdevice/waterheater.js +3 -0
  61. package/dist/irdevice/waterheater.js.map +1 -1
  62. package/dist/platform.js +2 -2
  63. package/dist/platform.js.map +1 -1
  64. package/package.json +1 -1
  65. package/src/device/bot.ts +3 -0
  66. package/src/device/colorbulb.ts +3 -0
  67. package/src/device/contact.ts +3 -0
  68. package/src/device/curtain.ts +24 -7
  69. package/src/device/humidifier.ts +3 -0
  70. package/src/device/lock.ts +3 -0
  71. package/src/device/meter.ts +23 -8
  72. package/src/device/meterplus.ts +23 -8
  73. package/src/device/motion.ts +3 -0
  74. package/src/device/plug.ts +3 -0
  75. package/src/device/striplight.ts +3 -0
  76. package/src/irdevice/airconditioner.ts +4 -1
  77. package/src/irdevice/airpurifier.ts +3 -0
  78. package/src/irdevice/camera.ts +3 -0
  79. package/src/irdevice/fan.ts +3 -0
  80. package/src/irdevice/light.ts +3 -0
  81. package/src/irdevice/other.ts +3 -0
  82. package/src/irdevice/tv.ts +3 -0
  83. package/src/irdevice/vacuumcleaner.ts +3 -0
  84. package/src/irdevice/waterheater.ts +3 -0
  85. package/src/platform.ts +2 -2
@@ -661,7 +661,9 @@ export class Curtain {
661
661
  }
662
662
 
663
663
  this.TargetPosition = value;
664
- this.mqttPublish('TargetPosition', this.TargetPosition);
664
+ if (this.device.mqttURL) {
665
+ this.mqttPublish('TargetPosition', this.TargetPosition);
666
+ }
665
667
 
666
668
  await this.setMinMax();
667
669
  if (value > this.CurrentPosition) {
@@ -700,54 +702,66 @@ export class Curtain {
700
702
  if (this.CurrentPosition === undefined || Number.isNaN(this.CurrentPosition)) {
701
703
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} CurrentPosition: ${this.CurrentPosition}`);
702
704
  } else {
705
+ if (this.device.mqttURL) {
706
+ this.mqttPublish('CurrentPosition', this.CurrentPosition);
707
+ }
703
708
  this.accessory.context.CurrentPosition = this.CurrentPosition;
704
709
  this.windowCoveringService.updateCharacteristic(this.platform.Characteristic.CurrentPosition, Number(this.CurrentPosition));
705
710
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic CurrentPosition: ${this.CurrentPosition}`);
706
- this.mqttPublish('CurrentPosition', this.CurrentPosition);
707
711
  }
708
712
  if (this.PositionState === undefined) {
709
713
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} PositionState: ${this.PositionState}`);
710
714
  } else {
715
+ if (this.device.mqttURL) {
716
+ this.mqttPublish('PositionState', this.PositionState);
717
+ }
711
718
  this.accessory.context.PositionState = this.PositionState;
712
719
  this.windowCoveringService.updateCharacteristic(this.platform.Characteristic.PositionState, Number(this.PositionState));
713
720
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic PositionState: ${this.PositionState}`);
714
- this.mqttPublish('PositionState', this.PositionState);
715
721
  }
716
722
  if (this.TargetPosition === undefined || Number.isNaN(this.TargetPosition)) {
717
723
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} TargetPosition: ${this.TargetPosition}`);
718
724
  } else {
725
+ if (this.device.mqttURL) {
726
+ this.mqttPublish('TargetPosition', this.TargetPosition);
727
+ }
719
728
  this.accessory.context.TargetPosition = this.TargetPosition;
720
729
  this.windowCoveringService.updateCharacteristic(this.platform.Characteristic.TargetPosition, Number(this.TargetPosition));
721
730
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic TargetPosition: ${this.TargetPosition}`);
722
- this.mqttPublish('TargetPosition', this.TargetPosition);
723
731
  }
724
732
  if (!this.device.curtain?.hide_lightsensor) {
725
733
  if (this.CurrentAmbientLightLevel === undefined || Number.isNaN(this.CurrentAmbientLightLevel)) {
726
734
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} CurrentAmbientLightLevel: ${this.CurrentAmbientLightLevel}`);
727
735
  } else {
736
+ if (this.device.mqttURL) {
737
+ this.mqttPublish('CurrentAmbientLightLevel', this.CurrentAmbientLightLevel);
738
+ }
728
739
  this.accessory.context.CurrentAmbientLightLevel = this.CurrentAmbientLightLevel;
729
740
  this.lightSensorService?.updateCharacteristic(this.platform.Characteristic.CurrentAmbientLightLevel, this.CurrentAmbientLightLevel);
730
741
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName}`
731
742
  + ` updateCharacteristic CurrentAmbientLightLevel: ${this.CurrentAmbientLightLevel}`);
732
- this.mqttPublish('CurrentAmbientLightLevel', this.CurrentAmbientLightLevel);
733
743
  }
734
744
  }
735
745
  if (this.BLE) {
736
746
  if (this.BatteryLevel === undefined) {
737
747
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} BatteryLevel: ${this.BatteryLevel}`);
738
748
  } else {
749
+ if (this.device.mqttURL) {
750
+ this.mqttPublish('BatteryLevel', this.BatteryLevel);
751
+ }
739
752
  this.accessory.context.BatteryLevel = this.BatteryLevel;
740
753
  this.batteryService?.updateCharacteristic(this.platform.Characteristic.BatteryLevel, this.BatteryLevel);
741
754
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic BatteryLevel: ${this.BatteryLevel}`);
742
- this.mqttPublish('BatteryLevel', this.BatteryLevel);
743
755
  }
744
756
  if (this.StatusLowBattery === undefined) {
745
757
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} StatusLowBattery: ${this.StatusLowBattery}`);
746
758
  } else {
759
+ if (this.device.mqttURL) {
760
+ this.mqttPublish('StatusLowBattery', this.StatusLowBattery);
761
+ }
747
762
  this.accessory.context.StatusLowBattery = this.StatusLowBattery;
748
763
  this.batteryService?.updateCharacteristic(this.platform.Characteristic.StatusLowBattery, this.StatusLowBattery);
749
764
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic StatusLowBattery: ${this.StatusLowBattery}`);
750
- this.mqttPublish('StatusLowBattery', this.StatusLowBattery);
751
765
  }
752
766
  }
753
767
  }
@@ -1021,6 +1035,9 @@ export class Curtain {
1021
1035
  if (device.connectionType !== undefined) {
1022
1036
  config['connectionType'] = device.connectionType;
1023
1037
  }
1038
+ if (device.external !== undefined) {
1039
+ config['external'] = device.external;
1040
+ }
1024
1041
  if (device.logging !== undefined) {
1025
1042
  config['logging'] = device.logging;
1026
1043
  }
@@ -945,6 +945,9 @@ export class Humidifier {
945
945
  if (device.connectionType !== undefined) {
946
946
  config['connectionType'] = device.connectionType;
947
947
  }
948
+ if (device.external !== undefined) {
949
+ config['external'] = device.external;
950
+ }
948
951
  if (device.logging !== undefined) {
949
952
  config['logging'] = device.logging;
950
953
  }
@@ -536,6 +536,9 @@ export class Lock {
536
536
  if (device.connectionType !== undefined) {
537
537
  config['connectionType'] = device.connectionType;
538
538
  }
539
+ if (device.external !== undefined) {
540
+ config['external'] = device.external;
541
+ }
539
542
  if (device.logging !== undefined) {
540
543
  config['logging'] = device.logging;
541
544
  }
@@ -377,16 +377,20 @@ export class Meter {
377
377
  this.humidityservice?.updateCharacteristic(this.platform.Characteristic.CurrentRelativeHumidity, this.CurrentRelativeHumidity);
378
378
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic`
379
379
  + ` CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`);
380
- mqttmessage.push(`"humidity": ${this.CurrentRelativeHumidity}`);
381
- entry['humidity'] = this.CurrentRelativeHumidity;
380
+ if (this.device.mqttURL) {
381
+ mqttmessage.push(`"humidity": ${this.CurrentRelativeHumidity}`);
382
+ entry['humidity'] = this.CurrentRelativeHumidity;
383
+ }
382
384
  }
383
385
  }
384
386
  if (!this.device.meter?.hide_temperature) {
385
387
  if (this.CurrentTemperature === undefined) {
386
388
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} CurrentTemperature: ${this.CurrentTemperature}`);
387
389
  } else {
388
- mqttmessage.push(`"temperature": ${this.CurrentTemperature}`);
389
- entry['temp'] = this.CurrentTemperature;
390
+ if (this.device.mqttURL) {
391
+ mqttmessage.push(`"temperature": ${this.CurrentTemperature}`);
392
+ entry['temp'] = this.CurrentTemperature;
393
+ }
390
394
  this.accessory.context.CurrentTemperature = this.CurrentTemperature;
391
395
  this.temperatureservice?.updateCharacteristic(this.platform.Characteristic.CurrentTemperature, this.CurrentTemperature);
392
396
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic CurrentTemperature: ${this.CurrentTemperature}`);
@@ -397,7 +401,9 @@ export class Meter {
397
401
  if (this.BatteryLevel === undefined) {
398
402
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} BatteryLevel: ${this.BatteryLevel}`);
399
403
  } else {
400
- mqttmessage.push(`"battery": ${this.BatteryLevel}`);
404
+ if (this.device.mqttURL) {
405
+ mqttmessage.push(`"battery": ${this.BatteryLevel}`);
406
+ }
401
407
  this.accessory.context.BatteryLevel = this.BatteryLevel;
402
408
  this.batteryService?.updateCharacteristic(this.platform.Characteristic.BatteryLevel, this.BatteryLevel);
403
409
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic BatteryLevel: ${this.BatteryLevel}`);
@@ -405,16 +411,22 @@ export class Meter {
405
411
  if (this.StatusLowBattery === undefined) {
406
412
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} StatusLowBattery: ${this.StatusLowBattery}`);
407
413
  } else {
408
- mqttmessage.push(`"lowBattery": ${this.StatusLowBattery}`);
414
+ if (this.device.mqttURL) {
415
+ mqttmessage.push(`"lowBattery": ${this.StatusLowBattery}`);
416
+ }
409
417
  this.accessory.context.StatusLowBattery = this.StatusLowBattery;
410
418
  this.batteryService?.updateCharacteristic(this.platform.Characteristic.StatusLowBattery, this.StatusLowBattery);
411
419
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic StatusLowBattery: ${this.StatusLowBattery}`);
412
420
  }
413
421
  }
414
- this.mqttPublish(`{${mqttmessage.join(',')}}`);
422
+ if (this.device.mqttURL) {
423
+ this.mqttPublish(`{${mqttmessage.join(',')}}`);
424
+ }
415
425
  if (this.CurrentRelativeHumidity > 0) {
416
426
  // reject unreliable data
417
- this.historyService?.addEntry(entry);
427
+ if (this.device.mqttURL) {
428
+ this.historyService?.addEntry(entry);
429
+ }
418
430
  }
419
431
  }
420
432
 
@@ -634,6 +646,9 @@ export class Meter {
634
646
  if (device.connectionType !== undefined) {
635
647
  config['connectionType'] = device.connectionType;
636
648
  }
649
+ if (device.external !== undefined) {
650
+ config['external'] = device.external;
651
+ }
637
652
  if (device.logging !== undefined) {
638
653
  config['logging'] = device.logging;
639
654
  }
@@ -377,16 +377,20 @@ export class MeterPlus {
377
377
  this.humidityservice?.updateCharacteristic(this.platform.Characteristic.CurrentRelativeHumidity, this.CurrentRelativeHumidity);
378
378
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName}`
379
379
  + ` updateCharacteristic CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`);
380
- mqttmessage.push(`"humidity": ${this.CurrentRelativeHumidity}`);
381
- entry['humidity'] = this.CurrentRelativeHumidity;
380
+ if (this.device.mqttURL) {
381
+ mqttmessage.push(`"humidity": ${this.CurrentRelativeHumidity}`);
382
+ entry['humidity'] = this.CurrentRelativeHumidity;
383
+ }
382
384
  }
383
385
  }
384
386
  if (!this.device.meter?.hide_temperature) {
385
387
  if (this.CurrentTemperature === undefined) {
386
388
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} CurrentTemperature: ${this.CurrentTemperature}`);
387
389
  } else {
388
- mqttmessage.push(`"temperature": ${this.CurrentTemperature}`);
389
- entry['temp'] = this.CurrentTemperature;
390
+ if (this.device.mqttURL) {
391
+ mqttmessage.push(`"temperature": ${this.CurrentTemperature}`);
392
+ entry['temp'] = this.CurrentTemperature;
393
+ }
390
394
  this.accessory.context.CurrentTemperature = this.CurrentTemperature;
391
395
  this.temperatureservice?.updateCharacteristic(this.platform.Characteristic.CurrentTemperature, this.CurrentTemperature);
392
396
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic CurrentTemperature: ${this.CurrentTemperature}`);
@@ -396,7 +400,9 @@ export class MeterPlus {
396
400
  if (this.BatteryLevel === undefined) {
397
401
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} BatteryLevel: ${this.BatteryLevel}`);
398
402
  } else {
399
- mqttmessage.push(`"battery": ${this.BatteryLevel}`);
403
+ if (this.device.mqttURL) {
404
+ mqttmessage.push(`"battery": ${this.BatteryLevel}`);
405
+ }
400
406
  this.accessory.context.BatteryLevel = this.BatteryLevel;
401
407
  this.batteryService?.updateCharacteristic(this.platform.Characteristic.BatteryLevel, this.BatteryLevel);
402
408
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic BatteryLevel: ${this.BatteryLevel}`);
@@ -404,16 +410,22 @@ export class MeterPlus {
404
410
  if (this.StatusLowBattery === undefined) {
405
411
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} StatusLowBattery: ${this.StatusLowBattery}`);
406
412
  } else {
407
- mqttmessage.push(`"lowBattery": ${this.StatusLowBattery}`);
413
+ if (this.device.mqttURL) {
414
+ mqttmessage.push(`"lowBattery": ${this.StatusLowBattery}`);
415
+ }
408
416
  this.accessory.context.StatusLowBattery = this.StatusLowBattery;
409
417
  this.batteryService?.updateCharacteristic(this.platform.Characteristic.StatusLowBattery, this.StatusLowBattery);
410
418
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} updateCharacteristic StatusLowBattery: ${this.StatusLowBattery}`);
411
419
  }
412
420
  }
413
- this.mqttPublish(`{${mqttmessage.join(',')}}`);
421
+ if (this.device.mqttURL) {
422
+ this.mqttPublish(`{${mqttmessage.join(',')}}`);
423
+ }
414
424
  if (this.CurrentRelativeHumidity > 0) {
415
425
  // reject unreliable data
416
- this.historyService?.addEntry(entry);
426
+ if (this.device.mqttURL) {
427
+ this.historyService?.addEntry(entry);
428
+ }
417
429
  }
418
430
  }
419
431
 
@@ -643,6 +655,9 @@ export class MeterPlus {
643
655
  if (device.connectionType !== undefined) {
644
656
  config['connectionType'] = device.connectionType;
645
657
  }
658
+ if (device.external !== undefined) {
659
+ config['external'] = device.external;
660
+ }
646
661
  if (device.logging !== undefined) {
647
662
  config['logging'] = device.logging;
648
663
  }
@@ -537,6 +537,9 @@ export class Motion {
537
537
  if (device.connectionType !== undefined) {
538
538
  config['connectionType'] = device.connectionType;
539
539
  }
540
+ if (device.external !== undefined) {
541
+ config['external'] = device.external;
542
+ }
540
543
  if (device.logging !== undefined) {
541
544
  config['logging'] = device.logging;
542
545
  }
@@ -641,6 +641,9 @@ export class Plug {
641
641
  if (device.connectionType !== undefined) {
642
642
  config['connectionType'] = device.connectionType;
643
643
  }
644
+ if (device.external !== undefined) {
645
+ config['external'] = device.external;
646
+ }
644
647
  if (device.logging !== undefined) {
645
648
  config['logging'] = device.logging;
646
649
  }
@@ -1028,6 +1028,9 @@ export class StripLight {
1028
1028
  if (device.connectionType !== undefined) {
1029
1029
  config['connectionType'] = device.connectionType;
1030
1030
  }
1031
+ if (device.external !== undefined) {
1032
+ config['external'] = device.external;
1033
+ }
1031
1034
  if (device.logging !== undefined) {
1032
1035
  config['logging'] = device.logging;
1033
1036
  }
@@ -641,6 +641,9 @@ export class AirConditioner {
641
641
  if (device.connectionType !== undefined) {
642
642
  config['connectionType'] = device.connectionType;
643
643
  }
644
+ if (device.external !== undefined) {
645
+ config['external'] = device.external;
646
+ }
644
647
  if (Object.entries(config).length !== 0) {
645
648
  this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Config: ${superStringify(config)}`);
646
649
  }
@@ -700,7 +703,7 @@ export class AirConditioner {
700
703
  }
701
704
  }
702
705
 
703
- debugErrorLog(...log: any[]): void {
706
+ debugErrorLog(...log: any[]): void {
704
707
  if (this.enablingDeviceLogging()) {
705
708
  if (this.deviceLogging?.includes('debug')) {
706
709
  this.platform.log.error('[DEBUG]', String(...log));
@@ -341,6 +341,9 @@ export class AirPurifier {
341
341
  if (device.connectionType !== undefined) {
342
342
  config['connectionType'] = device.connectionType;
343
343
  }
344
+ if (device.external !== undefined) {
345
+ config['external'] = device.external;
346
+ }
344
347
  if (Object.entries(config).length !== 0) {
345
348
  this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Config: ${superStringify(config)}`);
346
349
  }
@@ -230,6 +230,9 @@ export class Camera {
230
230
  if (device.connectionType !== undefined) {
231
231
  config['connectionType'] = device.connectionType;
232
232
  }
233
+ if (device.external !== undefined) {
234
+ config['external'] = device.external;
235
+ }
233
236
  if (Object.entries(config).length !== 0) {
234
237
  this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Config: ${superStringify(config)}`);
235
238
  }
@@ -362,6 +362,9 @@ export class Fan {
362
362
  if (device.connectionType !== undefined) {
363
363
  config['connectionType'] = device.connectionType;
364
364
  }
365
+ if (device.external !== undefined) {
366
+ config['external'] = device.external;
367
+ }
365
368
  if (Object.entries(config).length !== 0) {
366
369
  this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Config: ${superStringify(config)}`);
367
370
  }
@@ -249,6 +249,9 @@ export class Light {
249
249
  if (device.connectionType !== undefined) {
250
250
  config['connectionType'] = device.connectionType;
251
251
  }
252
+ if (device.external !== undefined) {
253
+ config['external'] = device.external;
254
+ }
252
255
  if (Object.entries(config).length !== 0) {
253
256
  this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Config: ${superStringify(config)}`);
254
257
  }
@@ -273,6 +273,9 @@ export class Others {
273
273
  if (device.connectionType !== undefined) {
274
274
  config['connectionType'] = device.connectionType;
275
275
  }
276
+ if (device.external !== undefined) {
277
+ config['external'] = device.external;
278
+ }
276
279
  if (Object.entries(config).length !== 0) {
277
280
  this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Config: ${superStringify(config)}`);
278
281
  }
@@ -464,6 +464,9 @@ export class TV {
464
464
  if (device.connectionType !== undefined) {
465
465
  config['connectionType'] = device.connectionType;
466
466
  }
467
+ if (device.external !== undefined) {
468
+ config['external'] = device.external;
469
+ }
467
470
  if (Object.entries(config).length !== 0) {
468
471
  this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Config: ${superStringify(config)}`);
469
472
  }
@@ -227,6 +227,9 @@ export class VacuumCleaner {
227
227
  if (device.connectionType !== undefined) {
228
228
  config['connectionType'] = device.connectionType;
229
229
  }
230
+ if (device.external !== undefined) {
231
+ config['external'] = device.external;
232
+ }
230
233
  if (Object.entries(config).length !== 0) {
231
234
  this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Config: ${superStringify(config)}`);
232
235
  }
@@ -230,6 +230,9 @@ export class WaterHeater {
230
230
  if (device.connectionType !== undefined) {
231
231
  config['connectionType'] = device.connectionType;
232
232
  }
233
+ if (device.external !== undefined) {
234
+ config['external'] = device.external;
235
+ }
233
236
  if (Object.entries(config).length !== 0) {
234
237
  this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Config: ${superStringify(config)}`);
235
238
  }
package/src/platform.ts CHANGED
@@ -1729,11 +1729,11 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1729
1729
  }
1730
1730
 
1731
1731
  public async externalOrPlatform(device: device & devicesConfig, accessory: PlatformAccessory) {
1732
- this.debugLog(`${accessory.displayName} External Accessory Mode: ${device.external}`);
1733
1732
  if (device.external) {
1734
- this.warnLog(`${accessory.displayName} External Accessory Mode`);
1733
+ this.debugWarnLog(`${accessory.displayName} External Accessory Mode`);
1735
1734
  this.externalAccessory(accessory);
1736
1735
  } else {
1736
+ this.debugLog(`${accessory.displayName} External Accessory Mode: ${device.external}`);
1737
1737
  this.api.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory]);
1738
1738
  }
1739
1739
  }