@switchbot/homebridge-switchbot 2.0.0-beta.37 → 2.0.0-beta.39

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.
package/src/platform.ts CHANGED
@@ -581,7 +581,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
581
581
  }
582
582
  } else if (await this.registerDevice(device)) {
583
583
  // the accessory does not yet exist, so we need to create it
584
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
584
+ if (!device.external) {
585
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
586
+ }
585
587
 
586
588
  // create a new accessory
587
589
  const accessory = new this.api.platformAccessory(device.deviceName, uuid);
@@ -637,7 +639,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
637
639
  }
638
640
  } else if (await this.registerDevice(device)) {
639
641
  // the accessory does not yet exist, so we need to create it
640
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
642
+ if (!device.external) {
643
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
644
+ }
641
645
 
642
646
  this.debugLog(superStringify(device.bot?.mode));
643
647
 
@@ -694,7 +698,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
694
698
  }
695
699
  } else if (await this.registerDevice(device)) {
696
700
  // the accessory does not yet exist, so we need to create it
697
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
701
+ if (!device.external) {
702
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
703
+ }
698
704
 
699
705
  // create a new accessory
700
706
  const accessory = new this.api.platformAccessory(device.deviceName, uuid);
@@ -748,7 +754,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
748
754
  }
749
755
  } else if (await this.registerDevice(device)) {
750
756
  // the accessory does not yet exist, so we need to create it
751
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
757
+ if (!device.external) {
758
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
759
+ }
752
760
 
753
761
  // create a new accessory
754
762
  const accessory = new this.api.platformAccessory(device.deviceName, uuid);
@@ -802,7 +810,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
802
810
  }
803
811
  } else if (await this.registerDevice(device)) {
804
812
  // the accessory does not yet exist, so we need to create it
805
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
813
+ if (!device.external) {
814
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
815
+ }
806
816
 
807
817
  // create a new accessory
808
818
  const accessory = new this.api.platformAccessory(device.deviceName, uuid);
@@ -856,7 +866,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
856
866
  }
857
867
  } else if (await this.registerDevice(device)) {
858
868
  // the accessory does not yet exist, so we need to create it
859
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
869
+ if (!device.external) {
870
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
871
+ }
860
872
 
861
873
  // create a new accessory
862
874
  const accessory = new this.api.platformAccessory(device.deviceName, uuid);
@@ -910,7 +922,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
910
922
  }
911
923
  } else if (await this.registerDevice(device)) {
912
924
  // the accessory does not yet exist, so we need to create it
913
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
925
+ if (!device.external) {
926
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
927
+ }
914
928
 
915
929
  if (device.group && !device.curtain?.disable_group) {
916
930
  this.debugLog(`Your Curtains are grouped
@@ -975,7 +989,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
975
989
  }
976
990
  } else if (await this.registerDevice(device)) {
977
991
  // the accessory does not yet exist, so we need to create it
978
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
992
+ if (!device.external) {
993
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
994
+ }
979
995
 
980
996
  // create a new accessory
981
997
  const accessory = new this.api.platformAccessory(device.deviceName, uuid);
@@ -1029,7 +1045,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1029
1045
  }
1030
1046
  } else if (await this.registerDevice(device)) {
1031
1047
  // the accessory does not yet exist, so we need to create it
1032
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
1048
+ if (!device.external) {
1049
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
1050
+ }
1033
1051
 
1034
1052
  // create a new accessory
1035
1053
  const accessory = new this.api.platformAccessory(device.deviceName, uuid);
@@ -1083,7 +1101,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1083
1101
  }
1084
1102
  } else if (await this.registerDevice(device)) {
1085
1103
  // the accessory does not yet exist, so we need to create it
1086
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
1104
+ if (!device.external) {
1105
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
1106
+ }
1087
1107
 
1088
1108
  // create a new accessory
1089
1109
  const accessory = new this.api.platformAccessory(device.deviceName, uuid);
@@ -1137,7 +1157,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1137
1157
  }
1138
1158
  } else if (await this.registerDevice(device)) {
1139
1159
  // the accessory does not yet exist, so we need to create it
1140
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
1160
+ if (!device.external) {
1161
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
1162
+ }
1141
1163
 
1142
1164
  // create a new accessory
1143
1165
  const accessory = new this.api.platformAccessory(device.deviceName, uuid);
@@ -1191,7 +1213,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1191
1213
  }
1192
1214
  } else if (await this.registerDevice(device)) {
1193
1215
  // the accessory does not yet exist, so we need to create it
1194
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
1216
+ if (!device.external) {
1217
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.deviceType} DeviceID: ${device.deviceId}`);
1218
+ }
1195
1219
 
1196
1220
  // create a new accessory
1197
1221
  const accessory = new this.api.platformAccessory(device.deviceName, uuid);
@@ -1240,7 +1264,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1240
1264
  this.debugLog(`${device.remoteType} uuid: ${device.deviceId}-${device.remoteType}, (${existingAccessory.UUID})`);
1241
1265
  } else if (!device.hide_device && device.hubDeviceId) {
1242
1266
  // the accessory does not yet exist, so we need to create it
1243
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.remoteType} DeviceID: ${device.deviceId}`);
1267
+ if (!device.external) {
1268
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.remoteType} DeviceID: ${device.deviceId}`);
1269
+ }
1244
1270
 
1245
1271
  // create a new accessory
1246
1272
  const accessory = new this.api.platformAccessory(device.deviceName, uuid);
@@ -1298,7 +1324,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1298
1324
  }
1299
1325
  } else if (!device.hide_device && device.hubDeviceId) {
1300
1326
  // the accessory does not yet exist, so we need to create it
1301
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.remoteType} DeviceID: ${device.deviceId}`);
1327
+ if (!device.external) {
1328
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.remoteType} DeviceID: ${device.deviceId}`);
1329
+ }
1302
1330
 
1303
1331
  // create a new accessory
1304
1332
  const accessory = new this.api.platformAccessory(device.deviceName, uuid);
@@ -1352,7 +1380,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1352
1380
  }
1353
1381
  } else if (!device.hide_device && device.hubDeviceId) {
1354
1382
  // the accessory does not yet exist, so we need to create it
1355
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.remoteType} DeviceID: ${device.deviceId}`);
1383
+ if (!device.external) {
1384
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.remoteType} DeviceID: ${device.deviceId}`);
1385
+ }
1356
1386
 
1357
1387
  // create a new accessory
1358
1388
  const accessory = new this.api.platformAccessory(device.deviceName, uuid);
@@ -1406,7 +1436,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1406
1436
  }
1407
1437
  } else if (!device.hide_device && device.hubDeviceId) {
1408
1438
  // the accessory does not yet exist, so we need to create it
1409
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.remoteType} DeviceID: ${device.deviceId}`);
1439
+ if (!device.external) {
1440
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.remoteType} DeviceID: ${device.deviceId}`);
1441
+ }
1410
1442
 
1411
1443
  // create a new accessory
1412
1444
  const accessory = new this.api.platformAccessory(device.deviceName, uuid);
@@ -1460,7 +1492,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1460
1492
  }
1461
1493
  } else if (!device.hide_device && device.hubDeviceId) {
1462
1494
  // the accessory does not yet exist, so we need to create it
1463
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.remoteType} DeviceID: ${device.deviceId}`);
1495
+ if (!device.external) {
1496
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.remoteType} DeviceID: ${device.deviceId}`);
1497
+ }
1464
1498
 
1465
1499
  // create a new accessory
1466
1500
  const accessory = new this.api.platformAccessory(device.deviceName, uuid);
@@ -1514,7 +1548,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1514
1548
  }
1515
1549
  } else if (!device.hide_device && device.hubDeviceId) {
1516
1550
  // the accessory does not yet exist, so we need to create it
1517
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.remoteType} DeviceID: ${device.deviceId}`);
1551
+ if (!device.external) {
1552
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.remoteType} DeviceID: ${device.deviceId}`);
1553
+ }
1518
1554
 
1519
1555
  // create a new accessory
1520
1556
  const accessory = new this.api.platformAccessory(device.deviceName, uuid);
@@ -1568,7 +1604,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1568
1604
  }
1569
1605
  } else if (!device.hide_device && device.hubDeviceId) {
1570
1606
  // the accessory does not yet exist, so we need to create it
1571
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.remoteType} DeviceID: ${device.deviceId}`);
1607
+ if (!device.external) {
1608
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.remoteType} DeviceID: ${device.deviceId}`);
1609
+ }
1572
1610
 
1573
1611
  // create a new accessory
1574
1612
  const accessory = new this.api.platformAccessory(device.deviceName, uuid);
@@ -1622,7 +1660,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1622
1660
  }
1623
1661
  } else if (!device.hide_device && device.hubDeviceId) {
1624
1662
  // the accessory does not yet exist, so we need to create it
1625
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.remoteType} DeviceID: ${device.deviceId}`);
1663
+ if (!device.external) {
1664
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.remoteType} DeviceID: ${device.deviceId}`);
1665
+ }
1626
1666
 
1627
1667
  // create a new accessory
1628
1668
  const accessory = new this.api.platformAccessory(device.deviceName, uuid);
@@ -1676,7 +1716,9 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1676
1716
  }
1677
1717
  } else if (!device.hide_device && device.hubDeviceId) {
1678
1718
  // the accessory does not yet exist, so we need to create it
1679
- this.infoLog(`Adding new accessory: ${device.deviceName} ${device.remoteType} DeviceID: ${device.deviceId}`);
1719
+ if (!device.external) {
1720
+ this.infoLog(`Adding new accessory: ${device.deviceName} ${device.remoteType} DeviceID: ${device.deviceId}`);
1721
+ }
1680
1722
 
1681
1723
  // create a new accessory
1682
1724
  const accessory = new this.api.platformAccessory(device.deviceName, uuid);