@switchbot/homebridge-switchbot 3.5.0-beta.33 → 3.5.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.
- package/dist/device/device.js +2 -2
- package/dist/device/device.js.map +1 -1
- package/dist/irdevice/irdevice.js +1 -1
- package/dist/irdevice/irdevice.js.map +1 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +162 -54
- package/dist/platform.js.map +1 -1
- package/package.json +1 -1
- package/src/device/device.ts +2 -2
- package/src/irdevice/irdevice.ts +1 -1
- package/src/platform.ts +162 -54
package/dist/platform.js
CHANGED
|
@@ -797,7 +797,9 @@ export class SwitchBotPlatform {
|
|
|
797
797
|
existingAccessory.context.model = device.deviceType;
|
|
798
798
|
existingAccessory.context.deviceID = device.deviceId;
|
|
799
799
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
800
|
-
|
|
800
|
+
if (device.version && !device.firmware) {
|
|
801
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
802
|
+
}
|
|
801
803
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
802
804
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
803
805
|
existingAccessory.context.connectionType = await this.connectionType(device);
|
|
@@ -823,7 +825,9 @@ export class SwitchBotPlatform {
|
|
|
823
825
|
accessory.context.device = device;
|
|
824
826
|
accessory.context.model = device.deviceType;
|
|
825
827
|
accessory.context.deviceID = device.deviceId;
|
|
826
|
-
|
|
828
|
+
if (device.version && !device.firmware) {
|
|
829
|
+
accessory.context.FirmwareRevision = device.version;
|
|
830
|
+
}
|
|
827
831
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
828
832
|
accessory.context.connectionType = await this.connectionType(device);
|
|
829
833
|
// create the accessory handler for the newly create accessory
|
|
@@ -850,7 +854,9 @@ export class SwitchBotPlatform {
|
|
|
850
854
|
existingAccessory.context.model = device.deviceType;
|
|
851
855
|
existingAccessory.context.deviceID = device.deviceId;
|
|
852
856
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
853
|
-
|
|
857
|
+
if (device.version && !device.firmware) {
|
|
858
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
859
|
+
}
|
|
854
860
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
855
861
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
856
862
|
existingAccessory.context.connectionType = await this.connectionType(device);
|
|
@@ -876,7 +882,9 @@ export class SwitchBotPlatform {
|
|
|
876
882
|
accessory.context.device = device;
|
|
877
883
|
accessory.context.model = device.deviceType;
|
|
878
884
|
accessory.context.deviceID = device.deviceId;
|
|
879
|
-
|
|
885
|
+
if (device.version && !device.firmware) {
|
|
886
|
+
accessory.context.FirmwareRevision = device.version;
|
|
887
|
+
}
|
|
880
888
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
881
889
|
accessory.context.connectionType = await this.connectionType(device);
|
|
882
890
|
// accessory.context.FirmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
|
|
@@ -904,7 +912,9 @@ export class SwitchBotPlatform {
|
|
|
904
912
|
existingAccessory.context.model = device.deviceType;
|
|
905
913
|
existingAccessory.context.deviceID = device.deviceId;
|
|
906
914
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
907
|
-
|
|
915
|
+
if (device.version && !device.firmware) {
|
|
916
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
917
|
+
}
|
|
908
918
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
909
919
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
910
920
|
existingAccessory.context.connectionType = await this.connectionType(device);
|
|
@@ -930,7 +940,9 @@ export class SwitchBotPlatform {
|
|
|
930
940
|
accessory.context.device = device;
|
|
931
941
|
accessory.context.model = device.deviceType;
|
|
932
942
|
accessory.context.deviceID = device.deviceId;
|
|
933
|
-
|
|
943
|
+
if (device.version && !device.firmware) {
|
|
944
|
+
accessory.context.FirmwareRevision = device.version;
|
|
945
|
+
}
|
|
934
946
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
935
947
|
accessory.context.connectionType = await this.connectionType(device);
|
|
936
948
|
// create the accessory handler for the newly create accessory
|
|
@@ -958,7 +970,9 @@ export class SwitchBotPlatform {
|
|
|
958
970
|
existingAccessory.context.model = device.deviceType;
|
|
959
971
|
existingAccessory.context.deviceID = device.deviceId;
|
|
960
972
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
961
|
-
|
|
973
|
+
if (device.version && !device.firmware) {
|
|
974
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
975
|
+
}
|
|
962
976
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
963
977
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
964
978
|
existingAccessory.context.connectionType = await this.connectionType(device);
|
|
@@ -984,7 +998,9 @@ export class SwitchBotPlatform {
|
|
|
984
998
|
accessory.context.device = device;
|
|
985
999
|
accessory.context.model = device.deviceType;
|
|
986
1000
|
accessory.context.deviceID = device.deviceId;
|
|
987
|
-
|
|
1001
|
+
if (device.version && !device.firmware) {
|
|
1002
|
+
accessory.context.FirmwareRevision = device.version;
|
|
1003
|
+
}
|
|
988
1004
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
989
1005
|
accessory.context.connectionType = await this.connectionType(device);
|
|
990
1006
|
// create the accessory handler for the newly create accessory
|
|
@@ -1012,7 +1028,9 @@ export class SwitchBotPlatform {
|
|
|
1012
1028
|
existingAccessory.context.model = device.deviceType;
|
|
1013
1029
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1014
1030
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1015
|
-
|
|
1031
|
+
if (device.version && !device.firmware) {
|
|
1032
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
1033
|
+
}
|
|
1016
1034
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1017
1035
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
1018
1036
|
existingAccessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1038,7 +1056,9 @@ export class SwitchBotPlatform {
|
|
|
1038
1056
|
accessory.context.device = device;
|
|
1039
1057
|
accessory.context.model = device.deviceType;
|
|
1040
1058
|
accessory.context.deviceID = device.deviceId;
|
|
1041
|
-
|
|
1059
|
+
if (device.version && !device.firmware) {
|
|
1060
|
+
accessory.context.FirmwareRevision = device.version;
|
|
1061
|
+
}
|
|
1042
1062
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1043
1063
|
accessory.context.connectionType = await this.connectionType(device);
|
|
1044
1064
|
// create the accessory handler for the newly create accessory
|
|
@@ -1065,7 +1085,9 @@ export class SwitchBotPlatform {
|
|
|
1065
1085
|
existingAccessory.context.model = device.deviceType;
|
|
1066
1086
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1067
1087
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1068
|
-
|
|
1088
|
+
if (device.version && !device.firmware) {
|
|
1089
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
1090
|
+
}
|
|
1069
1091
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1070
1092
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
1071
1093
|
existingAccessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1091,7 +1113,9 @@ export class SwitchBotPlatform {
|
|
|
1091
1113
|
accessory.context.device = device;
|
|
1092
1114
|
accessory.context.model = device.deviceType;
|
|
1093
1115
|
accessory.context.deviceID = device.deviceId;
|
|
1094
|
-
|
|
1116
|
+
if (device.version && !device.firmware) {
|
|
1117
|
+
accessory.context.FirmwareRevision = device.version;
|
|
1118
|
+
}
|
|
1095
1119
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1096
1120
|
accessory.context.connectionType = await this.connectionType(device);
|
|
1097
1121
|
// create the accessory handler for the newly create accessory
|
|
@@ -1118,7 +1142,9 @@ export class SwitchBotPlatform {
|
|
|
1118
1142
|
existingAccessory.context.model = device.deviceType;
|
|
1119
1143
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1120
1144
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1121
|
-
|
|
1145
|
+
if (device.version && !device.firmware) {
|
|
1146
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
1147
|
+
}
|
|
1122
1148
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1123
1149
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
1124
1150
|
existingAccessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1144,7 +1170,9 @@ export class SwitchBotPlatform {
|
|
|
1144
1170
|
accessory.context.device = device;
|
|
1145
1171
|
accessory.context.model = device.deviceType;
|
|
1146
1172
|
accessory.context.deviceID = device.deviceId;
|
|
1147
|
-
|
|
1173
|
+
if (device.version && !device.firmware) {
|
|
1174
|
+
accessory.context.FirmwareRevision = device.version;
|
|
1175
|
+
}
|
|
1148
1176
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1149
1177
|
accessory.context.connectionType = await this.connectionType(device);
|
|
1150
1178
|
// create the accessory handler for the newly create accessory
|
|
@@ -1171,7 +1199,9 @@ export class SwitchBotPlatform {
|
|
|
1171
1199
|
existingAccessory.context.model = device.deviceType;
|
|
1172
1200
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1173
1201
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1174
|
-
|
|
1202
|
+
if (device.version && !device.firmware) {
|
|
1203
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
1204
|
+
}
|
|
1175
1205
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1176
1206
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
1177
1207
|
existingAccessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1197,7 +1227,9 @@ export class SwitchBotPlatform {
|
|
|
1197
1227
|
accessory.context.device = device;
|
|
1198
1228
|
accessory.context.model = device.deviceType;
|
|
1199
1229
|
accessory.context.deviceID = device.deviceId;
|
|
1200
|
-
|
|
1230
|
+
if (device.version && !device.firmware) {
|
|
1231
|
+
accessory.context.FirmwareRevision = device.version;
|
|
1232
|
+
}
|
|
1201
1233
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1202
1234
|
accessory.context.connectionType = await this.connectionType(device);
|
|
1203
1235
|
// create the accessory handler for the newly create accessory
|
|
@@ -1224,7 +1256,9 @@ export class SwitchBotPlatform {
|
|
|
1224
1256
|
existingAccessory.context.model = device.deviceType;
|
|
1225
1257
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1226
1258
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1227
|
-
|
|
1259
|
+
if (device.version && !device.firmware) {
|
|
1260
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
1261
|
+
}
|
|
1228
1262
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1229
1263
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
1230
1264
|
existingAccessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1250,7 +1284,9 @@ export class SwitchBotPlatform {
|
|
|
1250
1284
|
accessory.context.device = device;
|
|
1251
1285
|
accessory.context.model = device.deviceType;
|
|
1252
1286
|
accessory.context.deviceID = device.deviceId;
|
|
1253
|
-
|
|
1287
|
+
if (device.version && !device.firmware) {
|
|
1288
|
+
accessory.context.FirmwareRevision = device.version;
|
|
1289
|
+
}
|
|
1254
1290
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1255
1291
|
accessory.context.connectionType = await this.connectionType(device);
|
|
1256
1292
|
// create the accessory handler for the newly create accessory
|
|
@@ -1277,7 +1313,9 @@ export class SwitchBotPlatform {
|
|
|
1277
1313
|
existingAccessory.context.model = device.deviceType;
|
|
1278
1314
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1279
1315
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1280
|
-
|
|
1316
|
+
if (device.version && !device.firmware) {
|
|
1317
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
1318
|
+
}
|
|
1281
1319
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1282
1320
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
1283
1321
|
existingAccessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1315,7 +1353,9 @@ export class SwitchBotPlatform {
|
|
|
1315
1353
|
accessory.context.device = device;
|
|
1316
1354
|
accessory.context.model = device.deviceType;
|
|
1317
1355
|
accessory.context.deviceID = device.deviceId;
|
|
1318
|
-
|
|
1356
|
+
if (device.version && !device.firmware) {
|
|
1357
|
+
accessory.context.FirmwareRevision = device.version;
|
|
1358
|
+
}
|
|
1319
1359
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1320
1360
|
accessory.context.connectionType = await this.connectionType(device);
|
|
1321
1361
|
// create the accessory handler for the newly create accessory
|
|
@@ -1342,7 +1382,9 @@ export class SwitchBotPlatform {
|
|
|
1342
1382
|
existingAccessory.context.model = device.deviceType;
|
|
1343
1383
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1344
1384
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1345
|
-
|
|
1385
|
+
if (device.version && !device.firmware) {
|
|
1386
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
1387
|
+
}
|
|
1346
1388
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1347
1389
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
1348
1390
|
existingAccessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1380,7 +1422,9 @@ export class SwitchBotPlatform {
|
|
|
1380
1422
|
accessory.context.device = device;
|
|
1381
1423
|
accessory.context.model = device.deviceType;
|
|
1382
1424
|
accessory.context.deviceID = device.deviceId;
|
|
1383
|
-
|
|
1425
|
+
if (device.version && !device.firmware) {
|
|
1426
|
+
accessory.context.FirmwareRevision = device.version;
|
|
1427
|
+
}
|
|
1384
1428
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1385
1429
|
accessory.context.connectionType = await this.connectionType(device);
|
|
1386
1430
|
// create the accessory handler for the newly create accessory
|
|
@@ -1407,7 +1451,9 @@ export class SwitchBotPlatform {
|
|
|
1407
1451
|
existingAccessory.context.model = device.deviceType;
|
|
1408
1452
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1409
1453
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1410
|
-
|
|
1454
|
+
if (device.version && !device.firmware) {
|
|
1455
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
1456
|
+
}
|
|
1411
1457
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1412
1458
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
1413
1459
|
existingAccessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1433,7 +1479,9 @@ export class SwitchBotPlatform {
|
|
|
1433
1479
|
accessory.context.device = device;
|
|
1434
1480
|
accessory.context.model = device.deviceType;
|
|
1435
1481
|
accessory.context.deviceID = device.deviceId;
|
|
1436
|
-
|
|
1482
|
+
if (device.version && !device.firmware) {
|
|
1483
|
+
accessory.context.FirmwareRevision = device.version;
|
|
1484
|
+
}
|
|
1437
1485
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1438
1486
|
accessory.context.connectionType = await this.connectionType(device);
|
|
1439
1487
|
// create the accessory handler for the newly create accessory
|
|
@@ -1460,7 +1508,9 @@ export class SwitchBotPlatform {
|
|
|
1460
1508
|
existingAccessory.context.model = device.deviceType;
|
|
1461
1509
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1462
1510
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1463
|
-
|
|
1511
|
+
if (device.version && !device.firmware) {
|
|
1512
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
1513
|
+
}
|
|
1464
1514
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1465
1515
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
1466
1516
|
existingAccessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1486,7 +1536,9 @@ export class SwitchBotPlatform {
|
|
|
1486
1536
|
accessory.context.device = device;
|
|
1487
1537
|
accessory.context.model = device.deviceType;
|
|
1488
1538
|
accessory.context.deviceID = device.deviceId;
|
|
1489
|
-
|
|
1539
|
+
if (device.version && !device.firmware) {
|
|
1540
|
+
accessory.context.FirmwareRevision = device.version;
|
|
1541
|
+
}
|
|
1490
1542
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1491
1543
|
accessory.context.connectionType = await this.connectionType(device);
|
|
1492
1544
|
// create the accessory handler for the newly create accessory
|
|
@@ -1513,7 +1565,9 @@ export class SwitchBotPlatform {
|
|
|
1513
1565
|
existingAccessory.context.model = device.deviceType;
|
|
1514
1566
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1515
1567
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1516
|
-
|
|
1568
|
+
if (device.version && !device.firmware) {
|
|
1569
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
1570
|
+
}
|
|
1517
1571
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1518
1572
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
1519
1573
|
existingAccessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1539,7 +1593,9 @@ export class SwitchBotPlatform {
|
|
|
1539
1593
|
accessory.context.device = device;
|
|
1540
1594
|
accessory.context.model = device.deviceType;
|
|
1541
1595
|
accessory.context.deviceID = device.deviceId;
|
|
1542
|
-
|
|
1596
|
+
if (device.version && !device.firmware) {
|
|
1597
|
+
accessory.context.FirmwareRevision = device.version;
|
|
1598
|
+
}
|
|
1543
1599
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1544
1600
|
accessory.context.connectionType = await this.connectionType(device);
|
|
1545
1601
|
// create the accessory handler for the newly create accessory
|
|
@@ -1566,7 +1622,9 @@ export class SwitchBotPlatform {
|
|
|
1566
1622
|
existingAccessory.context.model = device.deviceType;
|
|
1567
1623
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1568
1624
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1569
|
-
|
|
1625
|
+
if (device.version && !device.firmware) {
|
|
1626
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
1627
|
+
}
|
|
1570
1628
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1571
1629
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
1572
1630
|
existingAccessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1592,7 +1650,9 @@ export class SwitchBotPlatform {
|
|
|
1592
1650
|
accessory.context.device = device;
|
|
1593
1651
|
accessory.context.model = device.deviceType;
|
|
1594
1652
|
accessory.context.deviceID = device.deviceId;
|
|
1595
|
-
|
|
1653
|
+
if (device.version && !device.firmware) {
|
|
1654
|
+
accessory.context.FirmwareRevision = device.version;
|
|
1655
|
+
}
|
|
1596
1656
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1597
1657
|
accessory.context.connectionType = await this.connectionType(device);
|
|
1598
1658
|
// create the accessory handler for the newly create accessory
|
|
@@ -1619,7 +1679,9 @@ export class SwitchBotPlatform {
|
|
|
1619
1679
|
existingAccessory.context.model = device.deviceType;
|
|
1620
1680
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1621
1681
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1622
|
-
|
|
1682
|
+
if (device.version && !device.firmware) {
|
|
1683
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
1684
|
+
}
|
|
1623
1685
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1624
1686
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
1625
1687
|
existingAccessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1645,7 +1707,9 @@ export class SwitchBotPlatform {
|
|
|
1645
1707
|
accessory.context.device = device;
|
|
1646
1708
|
accessory.context.model = device.deviceType;
|
|
1647
1709
|
accessory.context.deviceID = device.deviceId;
|
|
1648
|
-
|
|
1710
|
+
if (device.version && !device.firmware) {
|
|
1711
|
+
accessory.context.FirmwareRevision = device.version;
|
|
1712
|
+
}
|
|
1649
1713
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1650
1714
|
accessory.context.connectionType = await this.connectionType(device);
|
|
1651
1715
|
// create the accessory handler for the newly create accessory
|
|
@@ -1672,7 +1736,9 @@ export class SwitchBotPlatform {
|
|
|
1672
1736
|
existingAccessory.context.model = device.deviceType;
|
|
1673
1737
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1674
1738
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1675
|
-
|
|
1739
|
+
if (device.version && !device.firmware) {
|
|
1740
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
1741
|
+
}
|
|
1676
1742
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1677
1743
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
1678
1744
|
existingAccessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1698,7 +1764,9 @@ export class SwitchBotPlatform {
|
|
|
1698
1764
|
accessory.context.device = device;
|
|
1699
1765
|
accessory.context.model = device.deviceType;
|
|
1700
1766
|
accessory.context.deviceID = device.deviceId;
|
|
1701
|
-
|
|
1767
|
+
if (device.version && !device.firmware) {
|
|
1768
|
+
accessory.context.FirmwareRevision = device.version;
|
|
1769
|
+
}
|
|
1702
1770
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1703
1771
|
accessory.context.connectionType = await this.connectionType(device);
|
|
1704
1772
|
// create the accessory handler for the newly create accessory
|
|
@@ -1725,7 +1793,9 @@ export class SwitchBotPlatform {
|
|
|
1725
1793
|
existingAccessory.context.model = device.deviceType;
|
|
1726
1794
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1727
1795
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1728
|
-
|
|
1796
|
+
if (device.version && !device.firmware) {
|
|
1797
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
1798
|
+
}
|
|
1729
1799
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1730
1800
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
1731
1801
|
existingAccessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1751,7 +1821,9 @@ export class SwitchBotPlatform {
|
|
|
1751
1821
|
accessory.context.device = device;
|
|
1752
1822
|
accessory.context.model = device.deviceType;
|
|
1753
1823
|
accessory.context.deviceID = device.deviceId;
|
|
1754
|
-
|
|
1824
|
+
if (device.version && !device.firmware) {
|
|
1825
|
+
accessory.context.FirmwareRevision = device.version;
|
|
1826
|
+
}
|
|
1755
1827
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1756
1828
|
accessory.context.connectionType = await this.connectionType(device);
|
|
1757
1829
|
// create the accessory handler for the newly create accessory
|
|
@@ -1776,7 +1848,9 @@ export class SwitchBotPlatform {
|
|
|
1776
1848
|
existingAccessory.context.model = device.remoteType;
|
|
1777
1849
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1778
1850
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1779
|
-
|
|
1851
|
+
if (device.version && !device.firmware) {
|
|
1852
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
1853
|
+
}
|
|
1780
1854
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1781
1855
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
1782
1856
|
existingAccessory.context.connectionType = device.connectionType;
|
|
@@ -1798,7 +1872,9 @@ export class SwitchBotPlatform {
|
|
|
1798
1872
|
accessory.context.device = device;
|
|
1799
1873
|
accessory.context.model = device.remoteType;
|
|
1800
1874
|
accessory.context.deviceID = device.deviceId;
|
|
1801
|
-
|
|
1875
|
+
if (device.version && !device.firmware) {
|
|
1876
|
+
accessory.context.FirmwareRevision = device.version;
|
|
1877
|
+
}
|
|
1802
1878
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1803
1879
|
accessory.context.connectionType = device.connectionType;
|
|
1804
1880
|
// create the accessory handler for the newly create accessory
|
|
@@ -1824,7 +1900,9 @@ export class SwitchBotPlatform {
|
|
|
1824
1900
|
existingAccessory.context.model = device.remoteType;
|
|
1825
1901
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1826
1902
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1827
|
-
|
|
1903
|
+
if (device.version && !device.firmware) {
|
|
1904
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
1905
|
+
}
|
|
1828
1906
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1829
1907
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
1830
1908
|
existingAccessory.context.connectionType = device.connectionType;
|
|
@@ -1850,7 +1928,9 @@ export class SwitchBotPlatform {
|
|
|
1850
1928
|
accessory.context.device = device;
|
|
1851
1929
|
accessory.context.model = device.remoteType;
|
|
1852
1930
|
accessory.context.deviceID = device.deviceId;
|
|
1853
|
-
|
|
1931
|
+
if (device.version && !device.firmware) {
|
|
1932
|
+
accessory.context.FirmwareRevision = device.version;
|
|
1933
|
+
}
|
|
1854
1934
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1855
1935
|
accessory.context.connectionType = device.connectionType;
|
|
1856
1936
|
// create the accessory handler for the newly create accessory
|
|
@@ -1877,7 +1957,9 @@ export class SwitchBotPlatform {
|
|
|
1877
1957
|
existingAccessory.context.model = device.remoteType;
|
|
1878
1958
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1879
1959
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1880
|
-
|
|
1960
|
+
if (device.version && !device.firmware) {
|
|
1961
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
1962
|
+
}
|
|
1881
1963
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1882
1964
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
1883
1965
|
existingAccessory.context.connectionType = device.connectionType;
|
|
@@ -1903,7 +1985,9 @@ export class SwitchBotPlatform {
|
|
|
1903
1985
|
accessory.context.device = device;
|
|
1904
1986
|
accessory.context.model = device.remoteType;
|
|
1905
1987
|
accessory.context.deviceID = device.deviceId;
|
|
1906
|
-
|
|
1988
|
+
if (device.version && !device.firmware) {
|
|
1989
|
+
accessory.context.FirmwareRevision = device.version;
|
|
1990
|
+
}
|
|
1907
1991
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1908
1992
|
accessory.context.connectionType = device.connectionType;
|
|
1909
1993
|
// create the accessory handler for the newly create accessory
|
|
@@ -1930,7 +2014,9 @@ export class SwitchBotPlatform {
|
|
|
1930
2014
|
existingAccessory.context.model = device.remoteType;
|
|
1931
2015
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1932
2016
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1933
|
-
|
|
2017
|
+
if (device.version && !device.firmware) {
|
|
2018
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
2019
|
+
}
|
|
1934
2020
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1935
2021
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
1936
2022
|
existingAccessory.context.connectionType = device.connectionType;
|
|
@@ -1956,7 +2042,9 @@ export class SwitchBotPlatform {
|
|
|
1956
2042
|
accessory.context.device = device;
|
|
1957
2043
|
accessory.context.model = device.remoteType;
|
|
1958
2044
|
accessory.context.deviceID = device.deviceId;
|
|
1959
|
-
|
|
2045
|
+
if (device.version && !device.firmware) {
|
|
2046
|
+
accessory.context.FirmwareRevision = device.version;
|
|
2047
|
+
}
|
|
1960
2048
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1961
2049
|
accessory.context.connectionType = device.connectionType;
|
|
1962
2050
|
// create the accessory handler for the newly create accessory
|
|
@@ -1983,7 +2071,9 @@ export class SwitchBotPlatform {
|
|
|
1983
2071
|
existingAccessory.context.model = device.remoteType;
|
|
1984
2072
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1985
2073
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1986
|
-
|
|
2074
|
+
if (device.version && !device.firmware) {
|
|
2075
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
2076
|
+
}
|
|
1987
2077
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1988
2078
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
1989
2079
|
existingAccessory.context.connectionType = device.connectionType;
|
|
@@ -2009,7 +2099,9 @@ export class SwitchBotPlatform {
|
|
|
2009
2099
|
accessory.context.device = device;
|
|
2010
2100
|
accessory.context.model = device.remoteType;
|
|
2011
2101
|
accessory.context.deviceID = device.deviceId;
|
|
2012
|
-
|
|
2102
|
+
if (device.version && !device.firmware) {
|
|
2103
|
+
accessory.context.FirmwareRevision = device.version;
|
|
2104
|
+
}
|
|
2013
2105
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2014
2106
|
accessory.context.connectionType = device.connectionType;
|
|
2015
2107
|
// create the accessory handler for the newly create accessory
|
|
@@ -2036,7 +2128,9 @@ export class SwitchBotPlatform {
|
|
|
2036
2128
|
existingAccessory.context.model = device.remoteType;
|
|
2037
2129
|
existingAccessory.context.deviceID = device.deviceId;
|
|
2038
2130
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
2039
|
-
|
|
2131
|
+
if (device.version && !device.firmware) {
|
|
2132
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
2133
|
+
}
|
|
2040
2134
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2041
2135
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
2042
2136
|
existingAccessory.context.connectionType = device.connectionType;
|
|
@@ -2062,7 +2156,9 @@ export class SwitchBotPlatform {
|
|
|
2062
2156
|
accessory.context.device = device;
|
|
2063
2157
|
accessory.context.model = device.remoteType;
|
|
2064
2158
|
accessory.context.deviceID = device.deviceId;
|
|
2065
|
-
|
|
2159
|
+
if (device.version && !device.firmware) {
|
|
2160
|
+
accessory.context.FirmwareRevision = device.version;
|
|
2161
|
+
}
|
|
2066
2162
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2067
2163
|
accessory.context.connectionType = device.connectionType;
|
|
2068
2164
|
// create the accessory handler for the newly create accessory
|
|
@@ -2089,7 +2185,9 @@ export class SwitchBotPlatform {
|
|
|
2089
2185
|
existingAccessory.context.model = device.remoteType;
|
|
2090
2186
|
existingAccessory.context.deviceID = device.deviceId;
|
|
2091
2187
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
2092
|
-
|
|
2188
|
+
if (device.version && !device.firmware) {
|
|
2189
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
2190
|
+
}
|
|
2093
2191
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2094
2192
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
2095
2193
|
existingAccessory.context.connectionType = device.connectionType;
|
|
@@ -2115,7 +2213,9 @@ export class SwitchBotPlatform {
|
|
|
2115
2213
|
accessory.context.device = device;
|
|
2116
2214
|
accessory.context.model = device.remoteType;
|
|
2117
2215
|
accessory.context.deviceID = device.deviceId;
|
|
2118
|
-
|
|
2216
|
+
if (device.version && !device.firmware) {
|
|
2217
|
+
accessory.context.FirmwareRevision = device.version;
|
|
2218
|
+
}
|
|
2119
2219
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2120
2220
|
accessory.context.connectionType = device.connectionType;
|
|
2121
2221
|
// create the accessory handler for the newly create accessory
|
|
@@ -2142,7 +2242,9 @@ export class SwitchBotPlatform {
|
|
|
2142
2242
|
existingAccessory.context.model = device.remoteType;
|
|
2143
2243
|
existingAccessory.context.deviceID = device.deviceId;
|
|
2144
2244
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
2145
|
-
|
|
2245
|
+
if (device.version && !device.firmware) {
|
|
2246
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
2247
|
+
}
|
|
2146
2248
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2147
2249
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
2148
2250
|
existingAccessory.context.connectionType = device.connectionType;
|
|
@@ -2168,7 +2270,9 @@ export class SwitchBotPlatform {
|
|
|
2168
2270
|
accessory.context.device = device;
|
|
2169
2271
|
accessory.context.model = device.remoteType;
|
|
2170
2272
|
accessory.context.deviceID = device.deviceId;
|
|
2171
|
-
|
|
2273
|
+
if (device.version && !device.firmware) {
|
|
2274
|
+
accessory.context.FirmwareRevision = device.version;
|
|
2275
|
+
}
|
|
2172
2276
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2173
2277
|
accessory.context.connectionType = device.connectionType;
|
|
2174
2278
|
// create the accessory handler for the newly create accessory
|
|
@@ -2195,7 +2299,9 @@ export class SwitchBotPlatform {
|
|
|
2195
2299
|
existingAccessory.context.model = device.remoteType;
|
|
2196
2300
|
existingAccessory.context.deviceID = device.deviceId;
|
|
2197
2301
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
2198
|
-
|
|
2302
|
+
if (device.version && !device.firmware) {
|
|
2303
|
+
existingAccessory.context.FirmwareRevision = device.version;
|
|
2304
|
+
}
|
|
2199
2305
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2200
2306
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
2201
2307
|
existingAccessory.context.connectionType = device.connectionType;
|
|
@@ -2221,7 +2327,9 @@ export class SwitchBotPlatform {
|
|
|
2221
2327
|
accessory.context.device = device;
|
|
2222
2328
|
accessory.context.model = device.remoteType;
|
|
2223
2329
|
accessory.context.deviceID = device.deviceId;
|
|
2224
|
-
|
|
2330
|
+
if (device.version && !device.firmware) {
|
|
2331
|
+
accessory.context.FirmwareRevision = device.version;
|
|
2332
|
+
}
|
|
2225
2333
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2226
2334
|
accessory.context.connectionType = device.connectionType;
|
|
2227
2335
|
// create the accessory handler for the newly create accessory
|