@switchbot/homebridge-switchbot 1.12.9-beta.2 → 1.12.9-beta.22

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 (72) hide show
  1. package/.github/workflows/dependabot.yml +12 -0
  2. package/.github/workflows/nodejs-beta.yml +0 -3
  3. package/.github/workflows/nodejs.yml +0 -3
  4. package/CHANGELOG.md +3 -0
  5. package/config.schema.json +18 -0
  6. package/dist/device/bot.d.ts +3 -0
  7. package/dist/device/bot.d.ts.map +1 -1
  8. package/dist/device/bot.js +19 -1
  9. package/dist/device/bot.js.map +1 -1
  10. package/dist/device/colorbulb.d.ts +3 -0
  11. package/dist/device/colorbulb.d.ts.map +1 -1
  12. package/dist/device/colorbulb.js +19 -1
  13. package/dist/device/colorbulb.js.map +1 -1
  14. package/dist/device/contact.d.ts +3 -0
  15. package/dist/device/contact.d.ts.map +1 -1
  16. package/dist/device/contact.js +19 -1
  17. package/dist/device/contact.js.map +1 -1
  18. package/dist/device/curtain.d.ts +3 -0
  19. package/dist/device/curtain.d.ts.map +1 -1
  20. package/dist/device/curtain.js +39 -2
  21. package/dist/device/curtain.js.map +1 -1
  22. package/dist/device/humidifier.d.ts +3 -0
  23. package/dist/device/humidifier.d.ts.map +1 -1
  24. package/dist/device/humidifier.js +19 -2
  25. package/dist/device/humidifier.js.map +1 -1
  26. package/dist/device/lock.d.ts +4 -0
  27. package/dist/device/lock.d.ts.map +1 -1
  28. package/dist/device/lock.js +60 -6
  29. package/dist/device/lock.js.map +1 -1
  30. package/dist/device/meter.d.ts +3 -0
  31. package/dist/device/meter.d.ts.map +1 -1
  32. package/dist/device/meter.js +19 -1
  33. package/dist/device/meter.js.map +1 -1
  34. package/dist/device/meterplus.d.ts +3 -0
  35. package/dist/device/meterplus.d.ts.map +1 -1
  36. package/dist/device/meterplus.js +19 -1
  37. package/dist/device/meterplus.js.map +1 -1
  38. package/dist/device/motion.d.ts +3 -0
  39. package/dist/device/motion.d.ts.map +1 -1
  40. package/dist/device/motion.js +19 -1
  41. package/dist/device/motion.js.map +1 -1
  42. package/dist/device/plug.d.ts +3 -0
  43. package/dist/device/plug.d.ts.map +1 -1
  44. package/dist/device/plug.js +19 -1
  45. package/dist/device/plug.js.map +1 -1
  46. package/dist/device/striplight.d.ts +3 -0
  47. package/dist/device/striplight.d.ts.map +1 -1
  48. package/dist/device/striplight.js +19 -1
  49. package/dist/device/striplight.js.map +1 -1
  50. package/dist/irdevice/other.js +4 -4
  51. package/dist/irdevice/other.js.map +1 -1
  52. package/dist/platform.d.ts.map +1 -1
  53. package/dist/platform.js +41 -41
  54. package/dist/platform.js.map +1 -1
  55. package/dist/settings.d.ts +1 -0
  56. package/dist/settings.d.ts.map +1 -1
  57. package/dist/settings.js.map +1 -1
  58. package/package.json +3 -3
  59. package/src/device/bot.ts +19 -1
  60. package/src/device/colorbulb.ts +19 -1
  61. package/src/device/contact.ts +19 -1
  62. package/src/device/curtain.ts +38 -2
  63. package/src/device/humidifier.ts +19 -2
  64. package/src/device/lock.ts +61 -6
  65. package/src/device/meter.ts +19 -1
  66. package/src/device/meterplus.ts +19 -1
  67. package/src/device/motion.ts +19 -1
  68. package/src/device/plug.ts +19 -1
  69. package/src/device/striplight.ts +19 -1
  70. package/src/irdevice/other.ts +4 -4
  71. package/src/platform.ts +41 -41
  72. package/src/settings.ts +1 -0
package/src/platform.ts CHANGED
@@ -38,7 +38,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
38
38
  responseType: 'json',
39
39
  });
40
40
 
41
- version = require('../package.json').version; // eslint-disable-line @typescript-eslint/no-var-requires
41
+ version = require('../package.json').version || '1.12.8'; // eslint-disable-line @typescript-eslint/no-var-requires
42
42
  deviceStatus!: deviceResponses;
43
43
  registeringDevice!: boolean;
44
44
  debugMode!: boolean;
@@ -525,7 +525,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
525
525
  existingAccessory.context.model = device.deviceType;
526
526
  existingAccessory.context.deviceID = device.deviceId;
527
527
  existingAccessory.displayName = device.deviceName;
528
- existingAccessory.context.firmwareRevision = this.version;
528
+ existingAccessory.context.firmwareRevision = device.firmware;
529
529
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
530
530
  await this.connectionTypeExistingAccessory(device, existingAccessory);
531
531
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -548,7 +548,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
548
548
  accessory.context.device = device;
549
549
  accessory.context.model = device.deviceType;
550
550
  accessory.context.deviceID = device.deviceId;
551
- accessory.context.firmwareRevision = this.version;
551
+ accessory.context.firmwareRevision = device.firmware;
552
552
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
553
553
  await this.connectionTypeNewAccessory(device, accessory);
554
554
  // create the accessory handler for the newly create accessory
@@ -582,7 +582,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
582
582
  existingAccessory.context.model = device.deviceType;
583
583
  existingAccessory.context.deviceID = device.deviceId;
584
584
  existingAccessory.displayName = device.deviceName;
585
- existingAccessory.context.firmwareRevision = this.version;
585
+ existingAccessory.context.firmwareRevision = device.firmware;
586
586
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
587
587
  await this.connectionTypeExistingAccessory(device, existingAccessory);
588
588
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -607,7 +607,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
607
607
  accessory.context.device = device;
608
608
  accessory.context.model = device.deviceType;
609
609
  accessory.context.deviceID = device.deviceId;
610
- accessory.context.firmwareRevision = this.version;
610
+ accessory.context.firmwareRevision = device.firmware;
611
611
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
612
612
  await this.connectionTypeNewAccessory(device, accessory);
613
613
  // accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
@@ -640,7 +640,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
640
640
  existingAccessory.context.model = device.deviceType;
641
641
  existingAccessory.context.deviceID = device.deviceId;
642
642
  existingAccessory.displayName = device.deviceName;
643
- existingAccessory.context.firmwareRevision = this.version;
643
+ existingAccessory.context.firmwareRevision = device.firmware;
644
644
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
645
645
  await this.connectionTypeExistingAccessory(device, existingAccessory);
646
646
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -663,7 +663,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
663
663
  accessory.context.device = device;
664
664
  accessory.context.model = device.deviceType;
665
665
  accessory.context.deviceID = device.deviceId;
666
- accessory.context.firmwareRevision = this.version;
666
+ accessory.context.firmwareRevision = device.firmware;
667
667
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
668
668
  await this.connectionTypeNewAccessory(device, accessory);
669
669
  // create the accessory handler for the newly create accessory
@@ -695,7 +695,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
695
695
  existingAccessory.context.model = device.deviceType;
696
696
  existingAccessory.context.deviceID = device.deviceId;
697
697
  existingAccessory.displayName = device.deviceName;
698
- existingAccessory.context.firmwareRevision = this.version;
698
+ existingAccessory.context.firmwareRevision = device.firmware;
699
699
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
700
700
  await this.connectionTypeExistingAccessory(device, existingAccessory);
701
701
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -718,7 +718,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
718
718
  accessory.context.device = device;
719
719
  accessory.context.model = device.deviceType;
720
720
  accessory.context.deviceID = device.deviceId;
721
- accessory.context.firmwareRevision = this.version;
721
+ accessory.context.firmwareRevision = device.firmware;
722
722
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
723
723
  await this.connectionTypeNewAccessory(device, accessory);
724
724
  // create the accessory handler for the newly create accessory
@@ -750,7 +750,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
750
750
  existingAccessory.context.model = device.deviceType;
751
751
  existingAccessory.context.deviceID = device.deviceId;
752
752
  existingAccessory.displayName = device.deviceName;
753
- existingAccessory.context.firmwareRevision = this.version;
753
+ existingAccessory.context.firmwareRevision = device.firmware;
754
754
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
755
755
  await this.connectionTypeExistingAccessory(device, existingAccessory);
756
756
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -773,7 +773,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
773
773
  accessory.context.device = device;
774
774
  accessory.context.model = device.deviceType;
775
775
  accessory.context.deviceID = device.deviceId;
776
- accessory.context.firmwareRevision = this.version;
776
+ accessory.context.firmwareRevision = device.firmware;
777
777
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
778
778
  await this.connectionTypeNewAccessory(device, accessory);
779
779
  // create the accessory handler for the newly create accessory
@@ -805,7 +805,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
805
805
  existingAccessory.context.model = device.deviceType;
806
806
  existingAccessory.context.deviceID = device.deviceId;
807
807
  existingAccessory.displayName = device.deviceName;
808
- existingAccessory.context.firmwareRevision = this.version;
808
+ existingAccessory.context.firmwareRevision = device.firmware;
809
809
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
810
810
  await this.connectionTypeExistingAccessory(device, existingAccessory);
811
811
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -828,7 +828,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
828
828
  accessory.context.device = device;
829
829
  accessory.context.model = device.deviceType;
830
830
  accessory.context.deviceID = device.deviceId;
831
- accessory.context.firmwareRevision = this.version;
831
+ accessory.context.firmwareRevision = device.firmware;
832
832
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
833
833
  await this.connectionTypeNewAccessory(device, accessory);
834
834
  // create the accessory handler for the newly create accessory
@@ -860,7 +860,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
860
860
  existingAccessory.context.model = device.deviceType;
861
861
  existingAccessory.context.deviceID = device.deviceId;
862
862
  existingAccessory.displayName = device.deviceName;
863
- existingAccessory.context.firmwareRevision = this.version;
863
+ existingAccessory.context.firmwareRevision = device.firmware;
864
864
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
865
865
  await this.connectionTypeExistingAccessory(device, existingAccessory);
866
866
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -894,7 +894,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
894
894
  accessory.context.device = device;
895
895
  accessory.context.model = device.deviceType;
896
896
  accessory.context.deviceID = device.deviceId;
897
- accessory.context.firmwareRevision = this.version;
897
+ accessory.context.firmwareRevision = device.firmware;
898
898
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
899
899
  await this.connectionTypeNewAccessory(device, accessory);
900
900
  // create the accessory handler for the newly create accessory
@@ -941,7 +941,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
941
941
  existingAccessory.context.model = device.deviceType;
942
942
  existingAccessory.context.deviceID = device.deviceId;
943
943
  existingAccessory.displayName = device.deviceName;
944
- existingAccessory.context.firmwareRevision = this.version;
944
+ existingAccessory.context.firmwareRevision = device.firmware;
945
945
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
946
946
  await this.connectionTypeExistingAccessory(device, existingAccessory);
947
947
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -964,7 +964,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
964
964
  accessory.context.device = device;
965
965
  accessory.context.model = device.deviceType;
966
966
  accessory.context.deviceID = device.deviceId;
967
- accessory.context.firmwareRevision = this.version;
967
+ accessory.context.firmwareRevision = device.firmware;
968
968
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
969
969
  await this.connectionTypeNewAccessory(device, accessory);
970
970
  // create the accessory handler for the newly create accessory
@@ -996,7 +996,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
996
996
  existingAccessory.context.model = device.deviceType;
997
997
  existingAccessory.context.deviceID = device.deviceId;
998
998
  existingAccessory.displayName = device.deviceName;
999
- existingAccessory.context.firmwareRevision = this.version;
999
+ existingAccessory.context.firmwareRevision = device.firmware;
1000
1000
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
1001
1001
  await this.connectionTypeExistingAccessory(device, existingAccessory);
1002
1002
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1019,7 +1019,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1019
1019
  accessory.context.device = device;
1020
1020
  accessory.context.model = device.deviceType;
1021
1021
  accessory.context.deviceID = device.deviceId;
1022
- accessory.context.firmwareRevision = this.version;
1022
+ accessory.context.firmwareRevision = device.firmware;
1023
1023
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
1024
1024
  await this.connectionTypeNewAccessory(device, accessory);
1025
1025
  // create the accessory handler for the newly create accessory
@@ -1051,7 +1051,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1051
1051
  existingAccessory.context.model = device.deviceType;
1052
1052
  existingAccessory.context.deviceID = device.deviceId;
1053
1053
  existingAccessory.displayName = device.deviceName;
1054
- existingAccessory.context.firmwareRevision = this.version;
1054
+ existingAccessory.context.firmwareRevision = device.firmware;
1055
1055
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
1056
1056
  await this.connectionTypeExistingAccessory(device, existingAccessory);
1057
1057
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1074,7 +1074,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1074
1074
  accessory.context.device = device;
1075
1075
  accessory.context.model = device.deviceType;
1076
1076
  accessory.context.deviceID = device.deviceId;
1077
- accessory.context.firmwareRevision = this.version;
1077
+ accessory.context.firmwareRevision = device.firmware;
1078
1078
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
1079
1079
  await this.connectionTypeNewAccessory(device, accessory);
1080
1080
  // create the accessory handler for the newly create accessory
@@ -1106,7 +1106,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1106
1106
  existingAccessory.context.model = device.deviceType;
1107
1107
  existingAccessory.context.deviceID = device.deviceId;
1108
1108
  existingAccessory.displayName = device.deviceName;
1109
- existingAccessory.context.firmwareRevision = this.version;
1109
+ existingAccessory.context.firmwareRevision = device.firmware;
1110
1110
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
1111
1111
  await this.connectionTypeExistingAccessory(device, existingAccessory);
1112
1112
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1129,7 +1129,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1129
1129
  accessory.context.device = device;
1130
1130
  accessory.context.model = device.deviceType;
1131
1131
  accessory.context.deviceID = device.deviceId;
1132
- accessory.context.firmwareRevision = this.version;
1132
+ accessory.context.firmwareRevision = device.firmware;
1133
1133
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
1134
1134
  await this.connectionTypeNewAccessory(device, accessory);
1135
1135
  // create the accessory handler for the newly create accessory
@@ -1159,7 +1159,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1159
1159
  existingAccessory.context.model = device.remoteType;
1160
1160
  existingAccessory.context.deviceID = device.deviceId;
1161
1161
  existingAccessory.displayName = device.deviceName;
1162
- existingAccessory.context.firmwareRevision = this.version;
1162
+ existingAccessory.context.firmwareRevision = device.firmware;
1163
1163
  existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
1164
1164
  await this.connectionTypeExistingIRAccessory(existingAccessory);
1165
1165
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1179,7 +1179,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1179
1179
  accessory.context.device = device;
1180
1180
  accessory.context.model = device.remoteType;
1181
1181
  accessory.context.deviceID = device.deviceId;
1182
- accessory.context.firmwareRevision = this.version;
1182
+ accessory.context.firmwareRevision = device.firmware;
1183
1183
  accessory.context.deviceType = `IR: ${device.remoteType}`;
1184
1184
  await this.connectionTypeNewIRAccessory(accessory);
1185
1185
  // create the accessory handler for the newly create accessory
@@ -1216,7 +1216,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1216
1216
  existingAccessory.context.model = device.remoteType;
1217
1217
  existingAccessory.context.deviceID = device.deviceId;
1218
1218
  existingAccessory.displayName = device.deviceName;
1219
- existingAccessory.context.firmwareRevision = this.version;
1219
+ existingAccessory.context.firmwareRevision = device.firmware;
1220
1220
  existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
1221
1221
  await this.connectionTypeExistingIRAccessory(existingAccessory);
1222
1222
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1239,7 +1239,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1239
1239
  accessory.context.device = device;
1240
1240
  accessory.context.model = device.remoteType;
1241
1241
  accessory.context.deviceID = device.deviceId;
1242
- accessory.context.firmwareRevision = this.version;
1242
+ accessory.context.firmwareRevision = device.firmware;
1243
1243
  accessory.context.deviceType = `IR: ${device.remoteType}`;
1244
1244
  await this.connectionTypeNewIRAccessory(accessory);
1245
1245
  // create the accessory handler for the newly create accessory
@@ -1271,7 +1271,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1271
1271
  existingAccessory.context.model = device.remoteType;
1272
1272
  existingAccessory.context.deviceID = device.deviceId;
1273
1273
  existingAccessory.displayName = device.deviceName;
1274
- existingAccessory.context.firmwareRevision = this.version;
1274
+ existingAccessory.context.firmwareRevision = device.firmware;
1275
1275
  existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
1276
1276
  await this.connectionTypeExistingIRAccessory(existingAccessory);
1277
1277
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1294,7 +1294,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1294
1294
  accessory.context.device = device;
1295
1295
  accessory.context.model = device.remoteType;
1296
1296
  accessory.context.deviceID = device.deviceId;
1297
- accessory.context.firmwareRevision = this.version;
1297
+ accessory.context.firmwareRevision = device.firmware;
1298
1298
  accessory.context.deviceType = `IR: ${device.remoteType}`;
1299
1299
  await this.connectionTypeNewIRAccessory(accessory);
1300
1300
  // create the accessory handler for the newly create accessory
@@ -1326,7 +1326,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1326
1326
  existingAccessory.context.model = device.remoteType;
1327
1327
  existingAccessory.context.deviceID = device.deviceId;
1328
1328
  existingAccessory.displayName = device.deviceName;
1329
- existingAccessory.context.firmwareRevision = this.version;
1329
+ existingAccessory.context.firmwareRevision = device.firmware;
1330
1330
  existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
1331
1331
  await this.connectionTypeExistingIRAccessory(existingAccessory);
1332
1332
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1349,7 +1349,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1349
1349
  accessory.context.device = device;
1350
1350
  accessory.context.model = device.remoteType;
1351
1351
  accessory.context.deviceID = device.deviceId;
1352
- accessory.context.firmwareRevision = this.version;
1352
+ accessory.context.firmwareRevision = device.firmware;
1353
1353
  accessory.context.deviceType = `IR: ${device.remoteType}`;
1354
1354
  await this.connectionTypeNewIRAccessory(accessory);
1355
1355
  // create the accessory handler for the newly create accessory
@@ -1381,7 +1381,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1381
1381
  existingAccessory.context.model = device.remoteType;
1382
1382
  existingAccessory.context.deviceID = device.deviceId;
1383
1383
  existingAccessory.displayName = device.deviceName;
1384
- existingAccessory.context.firmwareRevision = this.version;
1384
+ existingAccessory.context.firmwareRevision = device.firmware;
1385
1385
  existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
1386
1386
  await this.connectionTypeExistingIRAccessory(existingAccessory);
1387
1387
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1404,7 +1404,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1404
1404
  accessory.context.device = device;
1405
1405
  accessory.context.model = device.remoteType;
1406
1406
  accessory.context.deviceID = device.deviceId;
1407
- accessory.context.firmwareRevision = this.version;
1407
+ accessory.context.firmwareRevision = device.firmware;
1408
1408
  accessory.context.deviceType = `IR: ${device.remoteType}`;
1409
1409
  await this.connectionTypeNewIRAccessory(accessory);
1410
1410
  // create the accessory handler for the newly create accessory
@@ -1436,7 +1436,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1436
1436
  existingAccessory.context.model = device.remoteType;
1437
1437
  existingAccessory.context.deviceID = device.deviceId;
1438
1438
  existingAccessory.displayName = device.deviceName;
1439
- existingAccessory.context.firmwareRevision = this.version;
1439
+ existingAccessory.context.firmwareRevision = device.firmware;
1440
1440
  existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
1441
1441
  await this.connectionTypeExistingIRAccessory(existingAccessory);
1442
1442
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1459,7 +1459,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1459
1459
  accessory.context.device = device;
1460
1460
  accessory.context.model = device.remoteType;
1461
1461
  accessory.context.deviceID = device.deviceId;
1462
- accessory.context.firmwareRevision = this.version;
1462
+ accessory.context.firmwareRevision = device.firmware;
1463
1463
  accessory.context.deviceType = `IR: ${device.remoteType}`;
1464
1464
  await this.connectionTypeNewIRAccessory(accessory);
1465
1465
  // create the accessory handler for the newly create accessory
@@ -1491,7 +1491,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1491
1491
  existingAccessory.context.model = device.remoteType;
1492
1492
  existingAccessory.context.deviceID = device.deviceId;
1493
1493
  existingAccessory.displayName = device.deviceName;
1494
- existingAccessory.context.firmwareRevision = this.version;
1494
+ existingAccessory.context.firmwareRevision = device.firmware;
1495
1495
  existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
1496
1496
  await this.connectionTypeExistingIRAccessory(existingAccessory);
1497
1497
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1514,7 +1514,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1514
1514
  accessory.context.device = device;
1515
1515
  accessory.context.model = device.remoteType;
1516
1516
  accessory.context.deviceID = device.deviceId;
1517
- accessory.context.firmwareRevision = this.version;
1517
+ accessory.context.firmwareRevision = device.firmware;
1518
1518
  accessory.context.deviceType = `IR: ${device.remoteType}`;
1519
1519
  await this.connectionTypeNewIRAccessory(accessory);
1520
1520
  // create the accessory handler for the newly create accessory
@@ -1546,7 +1546,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1546
1546
  existingAccessory.context.model = device.remoteType;
1547
1547
  existingAccessory.context.deviceID = device.deviceId;
1548
1548
  existingAccessory.displayName = device.deviceName;
1549
- existingAccessory.context.firmwareRevision = this.version;
1549
+ existingAccessory.context.firmwareRevision = device.firmware;
1550
1550
  existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
1551
1551
  await this.connectionTypeExistingIRAccessory(existingAccessory);
1552
1552
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1569,7 +1569,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1569
1569
  accessory.context.device = device;
1570
1570
  accessory.context.model = device.remoteType;
1571
1571
  accessory.context.deviceID = device.deviceId;
1572
- accessory.context.firmwareRevision = this.version;
1572
+ accessory.context.firmwareRevision = device.firmware;
1573
1573
  accessory.context.deviceType = `IR: ${device.remoteType}`;
1574
1574
  await this.connectionTypeNewIRAccessory(accessory);
1575
1575
  // create the accessory handler for the newly create accessory
@@ -1601,7 +1601,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1601
1601
  existingAccessory.context.model = device.remoteType;
1602
1602
  existingAccessory.context.deviceID = device.deviceId;
1603
1603
  existingAccessory.displayName = device.deviceName;
1604
- existingAccessory.context.firmwareRevision = this.version;
1604
+ existingAccessory.context.firmwareRevision = device.firmware;
1605
1605
  existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
1606
1606
  await this.connectionTypeExistingIRAccessory(existingAccessory);
1607
1607
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1624,7 +1624,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1624
1624
  accessory.context.device = device;
1625
1625
  accessory.context.model = device.remoteType;
1626
1626
  accessory.context.deviceID = device.deviceId;
1627
- accessory.context.firmwareRevision = this.version;
1627
+ accessory.context.firmwareRevision = device.firmware;
1628
1628
  accessory.context.deviceType = `IR: ${device.remoteType}`;
1629
1629
  await this.connectionTypeNewIRAccessory(accessory);
1630
1630
  // create the accessory handler for the newly create accessory
package/src/settings.ts CHANGED
@@ -43,6 +43,7 @@ export interface devicesConfig extends device {
43
43
  deviceId: string;
44
44
  logging?: string;
45
45
  refreshRate?: number;
46
+ firmware?: string;
46
47
  bot?: bot;
47
48
  meter?: meter;
48
49
  humidifier?: humidifier;