@switchbot/homebridge-switchbot 3.5.0-beta.49 → 3.5.0-beta.50
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/platform.d.ts.map +1 -1
- package/dist/platform.js +107 -108
- package/dist/platform.js.map +1 -1
- package/package.json +1 -1
- package/src/platform.ts +107 -108
package/dist/platform.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";;AAIA,OAAO,EAAE,GAAG,EAAE,qBAAqB,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpF,OAAO,EAAwC,MAAM,EAAE,uBAAuB,EAAE,aAAa,EAAE,eAAe,EAAW,MAAM,eAAe,CAAC;AA4B/I,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAW,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAOlC,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAGhC;;;;GAIG;AACH,qBAAa,iBAAkB,YAAW,qBAAqB;IACtD,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACxC,SAAgB,GAAG,EAAE,GAAG,CAAC;IACzB,SAAgB,GAAG,EAAE,OAAO,CAAC;IAE7B,OAAO,EAAG,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAG,OAAO,CAAC;IACpB,UAAU,EAAG,MAAM,CAAC;IACpB,mBAAmB,EAAG,MAAM,CAAC;IAC7B,cAAc,EAAG,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACpD,eAAe,EAAG,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACrD,MAAM,EAAG,uBAAuB,CAAC;IAEjC,oBAAoB,EAAE,IAAI,CAAC,MAAM,GAAG,IAAI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;QAAE,IAAI,EAAE,GAAG,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAuB7H,UAAU;IAYV,UAAU;IAWV,qBAAqB;IAmCrB,YAAY;IAclB;;;OAGG;IACH,UAAU,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAM/B,OAAO,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAM5B,OAAO,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAM5B,YAAY,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAQjC,QAAQ,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAM7B,aAAa,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAQlC,QAAQ,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAU7B,uBAAuB,IAAI,OAAO;CAGnC"}
|
package/dist/platform.js
CHANGED
|
@@ -797,8 +797,8 @@ 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
|
-
if (device.
|
|
801
|
-
existingAccessory.context.version = device.
|
|
800
|
+
if (device.firmware) {
|
|
801
|
+
existingAccessory.context.version = device.firmware;
|
|
802
802
|
}
|
|
803
803
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
804
804
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -825,8 +825,8 @@ export class SwitchBotPlatform {
|
|
|
825
825
|
accessory.context.device = device;
|
|
826
826
|
accessory.context.model = device.deviceType;
|
|
827
827
|
accessory.context.deviceID = device.deviceId;
|
|
828
|
-
if (device.
|
|
829
|
-
accessory.context.version = device.
|
|
828
|
+
if (device.firmware) {
|
|
829
|
+
accessory.context.version = device.firmware;
|
|
830
830
|
}
|
|
831
831
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
832
832
|
accessory.context.connectionType = await this.connectionType(device);
|
|
@@ -854,8 +854,8 @@ export class SwitchBotPlatform {
|
|
|
854
854
|
existingAccessory.context.model = device.deviceType;
|
|
855
855
|
existingAccessory.context.deviceID = device.deviceId;
|
|
856
856
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
857
|
-
if (device.
|
|
858
|
-
existingAccessory.context.version = device.
|
|
857
|
+
if (device.firmware) {
|
|
858
|
+
existingAccessory.context.version = device.firmware;
|
|
859
859
|
}
|
|
860
860
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
861
861
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -882,8 +882,8 @@ export class SwitchBotPlatform {
|
|
|
882
882
|
accessory.context.device = device;
|
|
883
883
|
accessory.context.model = device.deviceType;
|
|
884
884
|
accessory.context.deviceID = device.deviceId;
|
|
885
|
-
if (device.
|
|
886
|
-
accessory.context.version = device.
|
|
885
|
+
if (device.firmware) {
|
|
886
|
+
accessory.context.version = device.firmware;
|
|
887
887
|
}
|
|
888
888
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
889
889
|
accessory.context.connectionType = await this.connectionType(device);
|
|
@@ -912,8 +912,8 @@ export class SwitchBotPlatform {
|
|
|
912
912
|
existingAccessory.context.model = device.deviceType;
|
|
913
913
|
existingAccessory.context.deviceID = device.deviceId;
|
|
914
914
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
915
|
-
if (device.
|
|
916
|
-
existingAccessory.context.version = device.
|
|
915
|
+
if (device.firmware) {
|
|
916
|
+
existingAccessory.context.version = device.firmware;
|
|
917
917
|
}
|
|
918
918
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
919
919
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -940,8 +940,8 @@ export class SwitchBotPlatform {
|
|
|
940
940
|
accessory.context.device = device;
|
|
941
941
|
accessory.context.model = device.deviceType;
|
|
942
942
|
accessory.context.deviceID = device.deviceId;
|
|
943
|
-
if (device.
|
|
944
|
-
accessory.context.version = device.
|
|
943
|
+
if (device.firmware) {
|
|
944
|
+
accessory.context.version = device.firmware;
|
|
945
945
|
}
|
|
946
946
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
947
947
|
accessory.context.connectionType = await this.connectionType(device);
|
|
@@ -970,8 +970,8 @@ export class SwitchBotPlatform {
|
|
|
970
970
|
existingAccessory.context.model = device.deviceType;
|
|
971
971
|
existingAccessory.context.deviceID = device.deviceId;
|
|
972
972
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
973
|
-
if (device.
|
|
974
|
-
existingAccessory.context.version = device.
|
|
973
|
+
if (device.firmware) {
|
|
974
|
+
existingAccessory.context.version = device.firmware;
|
|
975
975
|
}
|
|
976
976
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
977
977
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -998,8 +998,8 @@ export class SwitchBotPlatform {
|
|
|
998
998
|
accessory.context.device = device;
|
|
999
999
|
accessory.context.model = device.deviceType;
|
|
1000
1000
|
accessory.context.deviceID = device.deviceId;
|
|
1001
|
-
if (device.
|
|
1002
|
-
accessory.context.version = device.
|
|
1001
|
+
if (device.firmware) {
|
|
1002
|
+
accessory.context.version = device.firmware;
|
|
1003
1003
|
}
|
|
1004
1004
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1005
1005
|
accessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1028,8 +1028,8 @@ export class SwitchBotPlatform {
|
|
|
1028
1028
|
existingAccessory.context.model = device.deviceType;
|
|
1029
1029
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1030
1030
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1031
|
-
if (device.
|
|
1032
|
-
existingAccessory.context.version = device.
|
|
1031
|
+
if (device.firmware) {
|
|
1032
|
+
existingAccessory.context.version = device.firmware;
|
|
1033
1033
|
}
|
|
1034
1034
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1035
1035
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -1056,8 +1056,8 @@ export class SwitchBotPlatform {
|
|
|
1056
1056
|
accessory.context.device = device;
|
|
1057
1057
|
accessory.context.model = device.deviceType;
|
|
1058
1058
|
accessory.context.deviceID = device.deviceId;
|
|
1059
|
-
if (device.
|
|
1060
|
-
accessory.context.version = device.
|
|
1059
|
+
if (device.firmware) {
|
|
1060
|
+
accessory.context.version = device.firmware;
|
|
1061
1061
|
}
|
|
1062
1062
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1063
1063
|
accessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1085,8 +1085,8 @@ export class SwitchBotPlatform {
|
|
|
1085
1085
|
existingAccessory.context.model = device.deviceType;
|
|
1086
1086
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1087
1087
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1088
|
-
if (device.
|
|
1089
|
-
existingAccessory.context.version = device.
|
|
1088
|
+
if (device.firmware) {
|
|
1089
|
+
existingAccessory.context.version = device.firmware;
|
|
1090
1090
|
}
|
|
1091
1091
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1092
1092
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -1113,8 +1113,8 @@ export class SwitchBotPlatform {
|
|
|
1113
1113
|
accessory.context.device = device;
|
|
1114
1114
|
accessory.context.model = device.deviceType;
|
|
1115
1115
|
accessory.context.deviceID = device.deviceId;
|
|
1116
|
-
if (device.
|
|
1117
|
-
accessory.context.version = device.
|
|
1116
|
+
if (device.firmware) {
|
|
1117
|
+
accessory.context.version = device.firmware;
|
|
1118
1118
|
}
|
|
1119
1119
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1120
1120
|
accessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1142,8 +1142,8 @@ export class SwitchBotPlatform {
|
|
|
1142
1142
|
existingAccessory.context.model = device.deviceType;
|
|
1143
1143
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1144
1144
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1145
|
-
if (device.
|
|
1146
|
-
existingAccessory.context.version = device.
|
|
1145
|
+
if (device.firmware) {
|
|
1146
|
+
existingAccessory.context.version = device.firmware;
|
|
1147
1147
|
}
|
|
1148
1148
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1149
1149
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -1170,8 +1170,8 @@ export class SwitchBotPlatform {
|
|
|
1170
1170
|
accessory.context.device = device;
|
|
1171
1171
|
accessory.context.model = device.deviceType;
|
|
1172
1172
|
accessory.context.deviceID = device.deviceId;
|
|
1173
|
-
if (device.
|
|
1174
|
-
accessory.context.version = device.
|
|
1173
|
+
if (device.firmware) {
|
|
1174
|
+
accessory.context.version = device.firmware;
|
|
1175
1175
|
}
|
|
1176
1176
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1177
1177
|
accessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1199,8 +1199,8 @@ export class SwitchBotPlatform {
|
|
|
1199
1199
|
existingAccessory.context.model = device.deviceType;
|
|
1200
1200
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1201
1201
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1202
|
-
if (device.
|
|
1203
|
-
existingAccessory.context.version = device.
|
|
1202
|
+
if (device.firmware) {
|
|
1203
|
+
existingAccessory.context.version = device.firmware;
|
|
1204
1204
|
}
|
|
1205
1205
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1206
1206
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -1227,8 +1227,8 @@ export class SwitchBotPlatform {
|
|
|
1227
1227
|
accessory.context.device = device;
|
|
1228
1228
|
accessory.context.model = device.deviceType;
|
|
1229
1229
|
accessory.context.deviceID = device.deviceId;
|
|
1230
|
-
if (device.
|
|
1231
|
-
accessory.context.version = device.
|
|
1230
|
+
if (device.firmware) {
|
|
1231
|
+
accessory.context.version = device.firmware;
|
|
1232
1232
|
}
|
|
1233
1233
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1234
1234
|
accessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1256,8 +1256,8 @@ export class SwitchBotPlatform {
|
|
|
1256
1256
|
existingAccessory.context.model = device.deviceType;
|
|
1257
1257
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1258
1258
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1259
|
-
if (device.
|
|
1260
|
-
existingAccessory.context.version = device.
|
|
1259
|
+
if (device.firmware) {
|
|
1260
|
+
existingAccessory.context.version = device.firmware;
|
|
1261
1261
|
}
|
|
1262
1262
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1263
1263
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -1284,8 +1284,8 @@ export class SwitchBotPlatform {
|
|
|
1284
1284
|
accessory.context.device = device;
|
|
1285
1285
|
accessory.context.model = device.deviceType;
|
|
1286
1286
|
accessory.context.deviceID = device.deviceId;
|
|
1287
|
-
if (device.
|
|
1288
|
-
accessory.context.version = device.
|
|
1287
|
+
if (device.firmware) {
|
|
1288
|
+
accessory.context.version = device.firmware;
|
|
1289
1289
|
}
|
|
1290
1290
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1291
1291
|
accessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1313,8 +1313,8 @@ export class SwitchBotPlatform {
|
|
|
1313
1313
|
existingAccessory.context.model = device.deviceType;
|
|
1314
1314
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1315
1315
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1316
|
-
if (device.
|
|
1317
|
-
existingAccessory.context.version = device.
|
|
1316
|
+
if (device.firmware) {
|
|
1317
|
+
existingAccessory.context.version = device.firmware;
|
|
1318
1318
|
}
|
|
1319
1319
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1320
1320
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -1353,8 +1353,8 @@ export class SwitchBotPlatform {
|
|
|
1353
1353
|
accessory.context.device = device;
|
|
1354
1354
|
accessory.context.model = device.deviceType;
|
|
1355
1355
|
accessory.context.deviceID = device.deviceId;
|
|
1356
|
-
if (device.
|
|
1357
|
-
accessory.context.version = device.
|
|
1356
|
+
if (device.firmware) {
|
|
1357
|
+
accessory.context.version = device.firmware;
|
|
1358
1358
|
}
|
|
1359
1359
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1360
1360
|
accessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1382,8 +1382,8 @@ export class SwitchBotPlatform {
|
|
|
1382
1382
|
existingAccessory.context.model = device.deviceType;
|
|
1383
1383
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1384
1384
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1385
|
-
if (device.
|
|
1386
|
-
existingAccessory.context.version = device.
|
|
1385
|
+
if (device.firmware) {
|
|
1386
|
+
existingAccessory.context.version = device.firmware;
|
|
1387
1387
|
}
|
|
1388
1388
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1389
1389
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -1422,8 +1422,8 @@ export class SwitchBotPlatform {
|
|
|
1422
1422
|
accessory.context.device = device;
|
|
1423
1423
|
accessory.context.model = device.deviceType;
|
|
1424
1424
|
accessory.context.deviceID = device.deviceId;
|
|
1425
|
-
if (device.
|
|
1426
|
-
accessory.context.version = device.
|
|
1425
|
+
if (device.firmware) {
|
|
1426
|
+
accessory.context.version = device.firmware;
|
|
1427
1427
|
}
|
|
1428
1428
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1429
1429
|
accessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1451,8 +1451,8 @@ export class SwitchBotPlatform {
|
|
|
1451
1451
|
existingAccessory.context.model = device.deviceType;
|
|
1452
1452
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1453
1453
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1454
|
-
if (device.
|
|
1455
|
-
existingAccessory.context.version = device.
|
|
1454
|
+
if (device.firmware) {
|
|
1455
|
+
existingAccessory.context.version = device.firmware;
|
|
1456
1456
|
}
|
|
1457
1457
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1458
1458
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -1479,8 +1479,8 @@ export class SwitchBotPlatform {
|
|
|
1479
1479
|
accessory.context.device = device;
|
|
1480
1480
|
accessory.context.model = device.deviceType;
|
|
1481
1481
|
accessory.context.deviceID = device.deviceId;
|
|
1482
|
-
if (device.
|
|
1483
|
-
accessory.context.version = device.
|
|
1482
|
+
if (device.firmware) {
|
|
1483
|
+
accessory.context.version = device.firmware;
|
|
1484
1484
|
}
|
|
1485
1485
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1486
1486
|
accessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1508,8 +1508,8 @@ export class SwitchBotPlatform {
|
|
|
1508
1508
|
existingAccessory.context.model = device.deviceType;
|
|
1509
1509
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1510
1510
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1511
|
-
if (device.
|
|
1512
|
-
existingAccessory.context.version = device.
|
|
1511
|
+
if (device.firmware) {
|
|
1512
|
+
existingAccessory.context.version = device.firmware;
|
|
1513
1513
|
}
|
|
1514
1514
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1515
1515
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -1536,8 +1536,8 @@ export class SwitchBotPlatform {
|
|
|
1536
1536
|
accessory.context.device = device;
|
|
1537
1537
|
accessory.context.model = device.deviceType;
|
|
1538
1538
|
accessory.context.deviceID = device.deviceId;
|
|
1539
|
-
if (device.
|
|
1540
|
-
accessory.context.version = device.
|
|
1539
|
+
if (device.firmware) {
|
|
1540
|
+
accessory.context.version = device.firmware;
|
|
1541
1541
|
}
|
|
1542
1542
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1543
1543
|
accessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1565,9 +1565,8 @@ export class SwitchBotPlatform {
|
|
|
1565
1565
|
existingAccessory.context.model = device.deviceType;
|
|
1566
1566
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1567
1567
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
existingAccessory.context.version = device.version.toString();
|
|
1568
|
+
if (device.firmware) {
|
|
1569
|
+
existingAccessory.context.version = device.firmware;
|
|
1571
1570
|
}
|
|
1572
1571
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1573
1572
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -1594,8 +1593,8 @@ export class SwitchBotPlatform {
|
|
|
1594
1593
|
accessory.context.device = device;
|
|
1595
1594
|
accessory.context.model = device.deviceType;
|
|
1596
1595
|
accessory.context.deviceID = device.deviceId;
|
|
1597
|
-
if (device.
|
|
1598
|
-
accessory.context.version = device.
|
|
1596
|
+
if (device.firmware) {
|
|
1597
|
+
accessory.context.version = device.firmware;
|
|
1599
1598
|
}
|
|
1600
1599
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1601
1600
|
accessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1623,8 +1622,8 @@ export class SwitchBotPlatform {
|
|
|
1623
1622
|
existingAccessory.context.model = device.deviceType;
|
|
1624
1623
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1625
1624
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1626
|
-
if (device.
|
|
1627
|
-
existingAccessory.context.version = device.
|
|
1625
|
+
if (device.firmware) {
|
|
1626
|
+
existingAccessory.context.version = device.firmware;
|
|
1628
1627
|
}
|
|
1629
1628
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1630
1629
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -1651,8 +1650,8 @@ export class SwitchBotPlatform {
|
|
|
1651
1650
|
accessory.context.device = device;
|
|
1652
1651
|
accessory.context.model = device.deviceType;
|
|
1653
1652
|
accessory.context.deviceID = device.deviceId;
|
|
1654
|
-
if (device.
|
|
1655
|
-
accessory.context.version = device.
|
|
1653
|
+
if (device.firmware) {
|
|
1654
|
+
accessory.context.version = device.firmware;
|
|
1656
1655
|
}
|
|
1657
1656
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1658
1657
|
accessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1680,8 +1679,8 @@ export class SwitchBotPlatform {
|
|
|
1680
1679
|
existingAccessory.context.model = device.deviceType;
|
|
1681
1680
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1682
1681
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1683
|
-
if (device.
|
|
1684
|
-
existingAccessory.context.version = device.
|
|
1682
|
+
if (device.firmware) {
|
|
1683
|
+
existingAccessory.context.version = device.firmware;
|
|
1685
1684
|
}
|
|
1686
1685
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1687
1686
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -1708,8 +1707,8 @@ export class SwitchBotPlatform {
|
|
|
1708
1707
|
accessory.context.device = device;
|
|
1709
1708
|
accessory.context.model = device.deviceType;
|
|
1710
1709
|
accessory.context.deviceID = device.deviceId;
|
|
1711
|
-
if (device.
|
|
1712
|
-
accessory.context.version = device.
|
|
1710
|
+
if (device.firmware) {
|
|
1711
|
+
accessory.context.version = device.firmware;
|
|
1713
1712
|
}
|
|
1714
1713
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1715
1714
|
accessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1737,8 +1736,8 @@ export class SwitchBotPlatform {
|
|
|
1737
1736
|
existingAccessory.context.model = device.deviceType;
|
|
1738
1737
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1739
1738
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1740
|
-
if (device.
|
|
1741
|
-
existingAccessory.context.version = device.
|
|
1739
|
+
if (device.firmware) {
|
|
1740
|
+
existingAccessory.context.version = device.firmware;
|
|
1742
1741
|
}
|
|
1743
1742
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1744
1743
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -1765,8 +1764,8 @@ export class SwitchBotPlatform {
|
|
|
1765
1764
|
accessory.context.device = device;
|
|
1766
1765
|
accessory.context.model = device.deviceType;
|
|
1767
1766
|
accessory.context.deviceID = device.deviceId;
|
|
1768
|
-
if (device.
|
|
1769
|
-
accessory.context.version = device.
|
|
1767
|
+
if (device.firmware) {
|
|
1768
|
+
accessory.context.version = device.firmware;
|
|
1770
1769
|
}
|
|
1771
1770
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1772
1771
|
accessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1794,8 +1793,8 @@ export class SwitchBotPlatform {
|
|
|
1794
1793
|
existingAccessory.context.model = device.deviceType;
|
|
1795
1794
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1796
1795
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1797
|
-
if (device.
|
|
1798
|
-
existingAccessory.context.version = device.
|
|
1796
|
+
if (device.firmware) {
|
|
1797
|
+
existingAccessory.context.version = device.firmware;
|
|
1799
1798
|
}
|
|
1800
1799
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1801
1800
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -1822,8 +1821,8 @@ export class SwitchBotPlatform {
|
|
|
1822
1821
|
accessory.context.device = device;
|
|
1823
1822
|
accessory.context.model = device.deviceType;
|
|
1824
1823
|
accessory.context.deviceID = device.deviceId;
|
|
1825
|
-
if (device.
|
|
1826
|
-
accessory.context.version = device.
|
|
1824
|
+
if (device.firmware) {
|
|
1825
|
+
accessory.context.version = device.firmware;
|
|
1827
1826
|
}
|
|
1828
1827
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1829
1828
|
accessory.context.connectionType = await this.connectionType(device);
|
|
@@ -1850,7 +1849,7 @@ export class SwitchBotPlatform {
|
|
|
1850
1849
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1851
1850
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1852
1851
|
if (device.version && !device.firmware) {
|
|
1853
|
-
existingAccessory.context.version = device.version
|
|
1852
|
+
existingAccessory.context.version = device.version;
|
|
1854
1853
|
}
|
|
1855
1854
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1856
1855
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -1873,8 +1872,8 @@ export class SwitchBotPlatform {
|
|
|
1873
1872
|
accessory.context.device = device;
|
|
1874
1873
|
accessory.context.model = device.remoteType;
|
|
1875
1874
|
accessory.context.deviceID = device.deviceId;
|
|
1876
|
-
if (device.
|
|
1877
|
-
accessory.context.version = device.
|
|
1875
|
+
if (device.firmware) {
|
|
1876
|
+
accessory.context.version = device.firmware;
|
|
1878
1877
|
}
|
|
1879
1878
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1880
1879
|
accessory.context.connectionType = device.connectionType;
|
|
@@ -1901,8 +1900,8 @@ export class SwitchBotPlatform {
|
|
|
1901
1900
|
existingAccessory.context.model = device.remoteType;
|
|
1902
1901
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1903
1902
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1904
|
-
if (device.
|
|
1905
|
-
existingAccessory.context.version = device.
|
|
1903
|
+
if (device.firmware) {
|
|
1904
|
+
existingAccessory.context.version = device.firmware;
|
|
1906
1905
|
}
|
|
1907
1906
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1908
1907
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -1929,8 +1928,8 @@ export class SwitchBotPlatform {
|
|
|
1929
1928
|
accessory.context.device = device;
|
|
1930
1929
|
accessory.context.model = device.remoteType;
|
|
1931
1930
|
accessory.context.deviceID = device.deviceId;
|
|
1932
|
-
if (device.
|
|
1933
|
-
accessory.context.version = device.
|
|
1931
|
+
if (device.firmware) {
|
|
1932
|
+
accessory.context.version = device.firmware;
|
|
1934
1933
|
}
|
|
1935
1934
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1936
1935
|
accessory.context.connectionType = device.connectionType;
|
|
@@ -1958,8 +1957,8 @@ export class SwitchBotPlatform {
|
|
|
1958
1957
|
existingAccessory.context.model = device.remoteType;
|
|
1959
1958
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1960
1959
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
1961
|
-
if (device.
|
|
1962
|
-
existingAccessory.context.version = device.
|
|
1960
|
+
if (device.firmware) {
|
|
1961
|
+
existingAccessory.context.version = device.firmware;
|
|
1963
1962
|
}
|
|
1964
1963
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1965
1964
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -1986,8 +1985,8 @@ export class SwitchBotPlatform {
|
|
|
1986
1985
|
accessory.context.device = device;
|
|
1987
1986
|
accessory.context.model = device.remoteType;
|
|
1988
1987
|
accessory.context.deviceID = device.deviceId;
|
|
1989
|
-
if (device.
|
|
1990
|
-
accessory.context.version = device.
|
|
1988
|
+
if (device.firmware) {
|
|
1989
|
+
accessory.context.version = device.firmware;
|
|
1991
1990
|
}
|
|
1992
1991
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1993
1992
|
accessory.context.connectionType = device.connectionType;
|
|
@@ -2015,8 +2014,8 @@ export class SwitchBotPlatform {
|
|
|
2015
2014
|
existingAccessory.context.model = device.remoteType;
|
|
2016
2015
|
existingAccessory.context.deviceID = device.deviceId;
|
|
2017
2016
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
2018
|
-
if (device.
|
|
2019
|
-
existingAccessory.context.version = device.
|
|
2017
|
+
if (device.firmware) {
|
|
2018
|
+
existingAccessory.context.version = device.firmware;
|
|
2020
2019
|
}
|
|
2021
2020
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2022
2021
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -2043,8 +2042,8 @@ export class SwitchBotPlatform {
|
|
|
2043
2042
|
accessory.context.device = device;
|
|
2044
2043
|
accessory.context.model = device.remoteType;
|
|
2045
2044
|
accessory.context.deviceID = device.deviceId;
|
|
2046
|
-
if (device.
|
|
2047
|
-
accessory.context.version = device.
|
|
2045
|
+
if (device.firmware) {
|
|
2046
|
+
accessory.context.version = device.firmware;
|
|
2048
2047
|
}
|
|
2049
2048
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2050
2049
|
accessory.context.connectionType = device.connectionType;
|
|
@@ -2072,8 +2071,8 @@ export class SwitchBotPlatform {
|
|
|
2072
2071
|
existingAccessory.context.model = device.remoteType;
|
|
2073
2072
|
existingAccessory.context.deviceID = device.deviceId;
|
|
2074
2073
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
2075
|
-
if (device.
|
|
2076
|
-
existingAccessory.context.version = device.
|
|
2074
|
+
if (device.firmware) {
|
|
2075
|
+
existingAccessory.context.version = device.firmware;
|
|
2077
2076
|
}
|
|
2078
2077
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2079
2078
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -2100,8 +2099,8 @@ export class SwitchBotPlatform {
|
|
|
2100
2099
|
accessory.context.device = device;
|
|
2101
2100
|
accessory.context.model = device.remoteType;
|
|
2102
2101
|
accessory.context.deviceID = device.deviceId;
|
|
2103
|
-
if (device.
|
|
2104
|
-
accessory.context.version = device.
|
|
2102
|
+
if (device.firmware) {
|
|
2103
|
+
accessory.context.version = device.firmware;
|
|
2105
2104
|
}
|
|
2106
2105
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2107
2106
|
accessory.context.connectionType = device.connectionType;
|
|
@@ -2129,8 +2128,8 @@ export class SwitchBotPlatform {
|
|
|
2129
2128
|
existingAccessory.context.model = device.remoteType;
|
|
2130
2129
|
existingAccessory.context.deviceID = device.deviceId;
|
|
2131
2130
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
2132
|
-
if (device.
|
|
2133
|
-
existingAccessory.context.version = device.
|
|
2131
|
+
if (device.firmware) {
|
|
2132
|
+
existingAccessory.context.version = device.firmware;
|
|
2134
2133
|
}
|
|
2135
2134
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2136
2135
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -2157,8 +2156,8 @@ export class SwitchBotPlatform {
|
|
|
2157
2156
|
accessory.context.device = device;
|
|
2158
2157
|
accessory.context.model = device.remoteType;
|
|
2159
2158
|
accessory.context.deviceID = device.deviceId;
|
|
2160
|
-
if (device.
|
|
2161
|
-
accessory.context.version = device.
|
|
2159
|
+
if (device.firmware) {
|
|
2160
|
+
accessory.context.version = device.firmware;
|
|
2162
2161
|
}
|
|
2163
2162
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2164
2163
|
accessory.context.connectionType = device.connectionType;
|
|
@@ -2186,8 +2185,8 @@ export class SwitchBotPlatform {
|
|
|
2186
2185
|
existingAccessory.context.model = device.remoteType;
|
|
2187
2186
|
existingAccessory.context.deviceID = device.deviceId;
|
|
2188
2187
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
2189
|
-
if (device.
|
|
2190
|
-
existingAccessory.context.version = device.
|
|
2188
|
+
if (device.firmware) {
|
|
2189
|
+
existingAccessory.context.version = device.firmware;
|
|
2191
2190
|
}
|
|
2192
2191
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2193
2192
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -2214,8 +2213,8 @@ export class SwitchBotPlatform {
|
|
|
2214
2213
|
accessory.context.device = device;
|
|
2215
2214
|
accessory.context.model = device.remoteType;
|
|
2216
2215
|
accessory.context.deviceID = device.deviceId;
|
|
2217
|
-
if (device.
|
|
2218
|
-
accessory.context.version = device.
|
|
2216
|
+
if (device.firmware) {
|
|
2217
|
+
accessory.context.version = device.firmware;
|
|
2219
2218
|
}
|
|
2220
2219
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2221
2220
|
accessory.context.connectionType = device.connectionType;
|
|
@@ -2243,8 +2242,8 @@ export class SwitchBotPlatform {
|
|
|
2243
2242
|
existingAccessory.context.model = device.remoteType;
|
|
2244
2243
|
existingAccessory.context.deviceID = device.deviceId;
|
|
2245
2244
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
2246
|
-
if (device.
|
|
2247
|
-
existingAccessory.context.version = device.
|
|
2245
|
+
if (device.firmware) {
|
|
2246
|
+
existingAccessory.context.version = device.firmware;
|
|
2248
2247
|
}
|
|
2249
2248
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2250
2249
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -2271,8 +2270,8 @@ export class SwitchBotPlatform {
|
|
|
2271
2270
|
accessory.context.device = device;
|
|
2272
2271
|
accessory.context.model = device.remoteType;
|
|
2273
2272
|
accessory.context.deviceID = device.deviceId;
|
|
2274
|
-
if (device.
|
|
2275
|
-
accessory.context.version = device.
|
|
2273
|
+
if (device.firmware) {
|
|
2274
|
+
accessory.context.version = device.firmware;
|
|
2276
2275
|
}
|
|
2277
2276
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2278
2277
|
accessory.context.connectionType = device.connectionType;
|
|
@@ -2300,8 +2299,8 @@ export class SwitchBotPlatform {
|
|
|
2300
2299
|
existingAccessory.context.model = device.remoteType;
|
|
2301
2300
|
existingAccessory.context.deviceID = device.deviceId;
|
|
2302
2301
|
existingAccessory.displayName = device.configDeviceName || device.deviceName;
|
|
2303
|
-
if (device.
|
|
2304
|
-
existingAccessory.context.version = device.
|
|
2302
|
+
if (device.firmware) {
|
|
2303
|
+
existingAccessory.context.version = device.firmware;
|
|
2305
2304
|
}
|
|
2306
2305
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2307
2306
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
@@ -2328,8 +2327,8 @@ export class SwitchBotPlatform {
|
|
|
2328
2327
|
accessory.context.device = device;
|
|
2329
2328
|
accessory.context.model = device.remoteType;
|
|
2330
2329
|
accessory.context.deviceID = device.deviceId;
|
|
2331
|
-
if (device.
|
|
2332
|
-
accessory.context.version = device.
|
|
2330
|
+
if (device.firmware) {
|
|
2331
|
+
accessory.context.version = device.firmware;
|
|
2333
2332
|
}
|
|
2334
2333
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
2335
2334
|
accessory.context.connectionType = device.connectionType;
|