@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
@@ -1 +1 @@
1
- {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAoBA,OAAc,EAAE,aAAa,EAAsB,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,GAAG,EAAE,qBAAqB,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5G,OAAO,EAAyC,QAAQ,EAAE,MAAM,EAAE,uBAAuB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE9I;;;;GAIG;AACH,qBAAa,iBA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G,EAAE,GAAG,EAAE,GAAG,IAAI;IAM5B,OAAO,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAM5B,QAAQ,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAM7B,QAAQ,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAU7B,uBAAuB,IAAI,OAAO;CAGnC"}
package/dist/platform.js CHANGED
@@ -43,7 +43,7 @@ class SwitchBotPlatform {
43
43
  this.axios = axios_1.default.create({
44
44
  responseType: 'json',
45
45
  });
46
- this.version = require('../package.json').version; // eslint-disable-line @typescript-eslint/no-var-requires
46
+ this.version = require('../package.json').version || '1.12.8'; // eslint-disable-line @typescript-eslint/no-var-requires
47
47
  this.logs();
48
48
  this.debugLog('Finished initializing platform:', this.config.name);
49
49
  // only load if configured
@@ -509,7 +509,7 @@ class SwitchBotPlatform {
509
509
  existingAccessory.context.model = device.deviceType;
510
510
  existingAccessory.context.deviceID = device.deviceId;
511
511
  existingAccessory.displayName = device.deviceName;
512
- existingAccessory.context.firmwareRevision = this.version;
512
+ existingAccessory.context.firmwareRevision = device.firmware;
513
513
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
514
514
  await this.connectionTypeExistingAccessory(device, existingAccessory);
515
515
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -532,7 +532,7 @@ class SwitchBotPlatform {
532
532
  accessory.context.device = device;
533
533
  accessory.context.model = device.deviceType;
534
534
  accessory.context.deviceID = device.deviceId;
535
- accessory.context.firmwareRevision = this.version;
535
+ accessory.context.firmwareRevision = device.firmware;
536
536
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
537
537
  await this.connectionTypeNewAccessory(device, accessory);
538
538
  // create the accessory handler for the newly create accessory
@@ -561,7 +561,7 @@ class SwitchBotPlatform {
561
561
  existingAccessory.context.model = device.deviceType;
562
562
  existingAccessory.context.deviceID = device.deviceId;
563
563
  existingAccessory.displayName = device.deviceName;
564
- existingAccessory.context.firmwareRevision = this.version;
564
+ existingAccessory.context.firmwareRevision = device.firmware;
565
565
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
566
566
  await this.connectionTypeExistingAccessory(device, existingAccessory);
567
567
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -585,7 +585,7 @@ class SwitchBotPlatform {
585
585
  accessory.context.device = device;
586
586
  accessory.context.model = device.deviceType;
587
587
  accessory.context.deviceID = device.deviceId;
588
- accessory.context.firmwareRevision = this.version;
588
+ accessory.context.firmwareRevision = device.firmware;
589
589
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
590
590
  await this.connectionTypeNewAccessory(device, accessory);
591
591
  // accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
@@ -614,7 +614,7 @@ class SwitchBotPlatform {
614
614
  existingAccessory.context.model = device.deviceType;
615
615
  existingAccessory.context.deviceID = device.deviceId;
616
616
  existingAccessory.displayName = device.deviceName;
617
- existingAccessory.context.firmwareRevision = this.version;
617
+ existingAccessory.context.firmwareRevision = device.firmware;
618
618
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
619
619
  await this.connectionTypeExistingAccessory(device, existingAccessory);
620
620
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -637,7 +637,7 @@ class SwitchBotPlatform {
637
637
  accessory.context.device = device;
638
638
  accessory.context.model = device.deviceType;
639
639
  accessory.context.deviceID = device.deviceId;
640
- accessory.context.firmwareRevision = this.version;
640
+ accessory.context.firmwareRevision = device.firmware;
641
641
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
642
642
  await this.connectionTypeNewAccessory(device, accessory);
643
643
  // create the accessory handler for the newly create accessory
@@ -665,7 +665,7 @@ class SwitchBotPlatform {
665
665
  existingAccessory.context.model = device.deviceType;
666
666
  existingAccessory.context.deviceID = device.deviceId;
667
667
  existingAccessory.displayName = device.deviceName;
668
- existingAccessory.context.firmwareRevision = this.version;
668
+ existingAccessory.context.firmwareRevision = device.firmware;
669
669
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
670
670
  await this.connectionTypeExistingAccessory(device, existingAccessory);
671
671
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -688,7 +688,7 @@ class SwitchBotPlatform {
688
688
  accessory.context.device = device;
689
689
  accessory.context.model = device.deviceType;
690
690
  accessory.context.deviceID = device.deviceId;
691
- accessory.context.firmwareRevision = this.version;
691
+ accessory.context.firmwareRevision = device.firmware;
692
692
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
693
693
  await this.connectionTypeNewAccessory(device, accessory);
694
694
  // create the accessory handler for the newly create accessory
@@ -716,7 +716,7 @@ class SwitchBotPlatform {
716
716
  existingAccessory.context.model = device.deviceType;
717
717
  existingAccessory.context.deviceID = device.deviceId;
718
718
  existingAccessory.displayName = device.deviceName;
719
- existingAccessory.context.firmwareRevision = this.version;
719
+ existingAccessory.context.firmwareRevision = device.firmware;
720
720
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
721
721
  await this.connectionTypeExistingAccessory(device, existingAccessory);
722
722
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -739,7 +739,7 @@ class SwitchBotPlatform {
739
739
  accessory.context.device = device;
740
740
  accessory.context.model = device.deviceType;
741
741
  accessory.context.deviceID = device.deviceId;
742
- accessory.context.firmwareRevision = this.version;
742
+ accessory.context.firmwareRevision = device.firmware;
743
743
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
744
744
  await this.connectionTypeNewAccessory(device, accessory);
745
745
  // create the accessory handler for the newly create accessory
@@ -767,7 +767,7 @@ class SwitchBotPlatform {
767
767
  existingAccessory.context.model = device.deviceType;
768
768
  existingAccessory.context.deviceID = device.deviceId;
769
769
  existingAccessory.displayName = device.deviceName;
770
- existingAccessory.context.firmwareRevision = this.version;
770
+ existingAccessory.context.firmwareRevision = device.firmware;
771
771
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
772
772
  await this.connectionTypeExistingAccessory(device, existingAccessory);
773
773
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -790,7 +790,7 @@ class SwitchBotPlatform {
790
790
  accessory.context.device = device;
791
791
  accessory.context.model = device.deviceType;
792
792
  accessory.context.deviceID = device.deviceId;
793
- accessory.context.firmwareRevision = this.version;
793
+ accessory.context.firmwareRevision = device.firmware;
794
794
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
795
795
  await this.connectionTypeNewAccessory(device, accessory);
796
796
  // create the accessory handler for the newly create accessory
@@ -818,7 +818,7 @@ class SwitchBotPlatform {
818
818
  existingAccessory.context.model = device.deviceType;
819
819
  existingAccessory.context.deviceID = device.deviceId;
820
820
  existingAccessory.displayName = device.deviceName;
821
- existingAccessory.context.firmwareRevision = this.version;
821
+ existingAccessory.context.firmwareRevision = device.firmware;
822
822
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
823
823
  await this.connectionTypeExistingAccessory(device, existingAccessory);
824
824
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -853,7 +853,7 @@ class SwitchBotPlatform {
853
853
  accessory.context.device = device;
854
854
  accessory.context.model = device.deviceType;
855
855
  accessory.context.deviceID = device.deviceId;
856
- accessory.context.firmwareRevision = this.version;
856
+ accessory.context.firmwareRevision = device.firmware;
857
857
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
858
858
  await this.connectionTypeNewAccessory(device, accessory);
859
859
  // create the accessory handler for the newly create accessory
@@ -893,7 +893,7 @@ class SwitchBotPlatform {
893
893
  existingAccessory.context.model = device.deviceType;
894
894
  existingAccessory.context.deviceID = device.deviceId;
895
895
  existingAccessory.displayName = device.deviceName;
896
- existingAccessory.context.firmwareRevision = this.version;
896
+ existingAccessory.context.firmwareRevision = device.firmware;
897
897
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
898
898
  await this.connectionTypeExistingAccessory(device, existingAccessory);
899
899
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -916,7 +916,7 @@ class SwitchBotPlatform {
916
916
  accessory.context.device = device;
917
917
  accessory.context.model = device.deviceType;
918
918
  accessory.context.deviceID = device.deviceId;
919
- accessory.context.firmwareRevision = this.version;
919
+ accessory.context.firmwareRevision = device.firmware;
920
920
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
921
921
  await this.connectionTypeNewAccessory(device, accessory);
922
922
  // create the accessory handler for the newly create accessory
@@ -944,7 +944,7 @@ class SwitchBotPlatform {
944
944
  existingAccessory.context.model = device.deviceType;
945
945
  existingAccessory.context.deviceID = device.deviceId;
946
946
  existingAccessory.displayName = device.deviceName;
947
- existingAccessory.context.firmwareRevision = this.version;
947
+ existingAccessory.context.firmwareRevision = device.firmware;
948
948
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
949
949
  await this.connectionTypeExistingAccessory(device, existingAccessory);
950
950
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -967,7 +967,7 @@ class SwitchBotPlatform {
967
967
  accessory.context.device = device;
968
968
  accessory.context.model = device.deviceType;
969
969
  accessory.context.deviceID = device.deviceId;
970
- accessory.context.firmwareRevision = this.version;
970
+ accessory.context.firmwareRevision = device.firmware;
971
971
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
972
972
  await this.connectionTypeNewAccessory(device, accessory);
973
973
  // create the accessory handler for the newly create accessory
@@ -995,7 +995,7 @@ class SwitchBotPlatform {
995
995
  existingAccessory.context.model = device.deviceType;
996
996
  existingAccessory.context.deviceID = device.deviceId;
997
997
  existingAccessory.displayName = device.deviceName;
998
- existingAccessory.context.firmwareRevision = this.version;
998
+ existingAccessory.context.firmwareRevision = device.firmware;
999
999
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
1000
1000
  await this.connectionTypeExistingAccessory(device, existingAccessory);
1001
1001
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1018,7 +1018,7 @@ class SwitchBotPlatform {
1018
1018
  accessory.context.device = device;
1019
1019
  accessory.context.model = device.deviceType;
1020
1020
  accessory.context.deviceID = device.deviceId;
1021
- accessory.context.firmwareRevision = this.version;
1021
+ accessory.context.firmwareRevision = device.firmware;
1022
1022
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
1023
1023
  await this.connectionTypeNewAccessory(device, accessory);
1024
1024
  // create the accessory handler for the newly create accessory
@@ -1046,7 +1046,7 @@ class SwitchBotPlatform {
1046
1046
  existingAccessory.context.model = device.deviceType;
1047
1047
  existingAccessory.context.deviceID = device.deviceId;
1048
1048
  existingAccessory.displayName = device.deviceName;
1049
- existingAccessory.context.firmwareRevision = this.version;
1049
+ existingAccessory.context.firmwareRevision = device.firmware;
1050
1050
  existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
1051
1051
  await this.connectionTypeExistingAccessory(device, existingAccessory);
1052
1052
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1069,7 +1069,7 @@ class SwitchBotPlatform {
1069
1069
  accessory.context.device = device;
1070
1070
  accessory.context.model = device.deviceType;
1071
1071
  accessory.context.deviceID = device.deviceId;
1072
- accessory.context.firmwareRevision = this.version;
1072
+ accessory.context.firmwareRevision = device.firmware;
1073
1073
  accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
1074
1074
  await this.connectionTypeNewAccessory(device, accessory);
1075
1075
  // create the accessory handler for the newly create accessory
@@ -1095,7 +1095,7 @@ class SwitchBotPlatform {
1095
1095
  existingAccessory.context.model = device.remoteType;
1096
1096
  existingAccessory.context.deviceID = device.deviceId;
1097
1097
  existingAccessory.displayName = device.deviceName;
1098
- existingAccessory.context.firmwareRevision = this.version;
1098
+ existingAccessory.context.firmwareRevision = device.firmware;
1099
1099
  existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
1100
1100
  await this.connectionTypeExistingIRAccessory(existingAccessory);
1101
1101
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1114,7 +1114,7 @@ class SwitchBotPlatform {
1114
1114
  accessory.context.device = device;
1115
1115
  accessory.context.model = device.remoteType;
1116
1116
  accessory.context.deviceID = device.deviceId;
1117
- accessory.context.firmwareRevision = this.version;
1117
+ accessory.context.firmwareRevision = device.firmware;
1118
1118
  accessory.context.deviceType = `IR: ${device.remoteType}`;
1119
1119
  await this.connectionTypeNewIRAccessory(accessory);
1120
1120
  // create the accessory handler for the newly create accessory
@@ -1146,7 +1146,7 @@ class SwitchBotPlatform {
1146
1146
  existingAccessory.context.model = device.remoteType;
1147
1147
  existingAccessory.context.deviceID = device.deviceId;
1148
1148
  existingAccessory.displayName = device.deviceName;
1149
- existingAccessory.context.firmwareRevision = this.version;
1149
+ existingAccessory.context.firmwareRevision = device.firmware;
1150
1150
  existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
1151
1151
  await this.connectionTypeExistingIRAccessory(existingAccessory);
1152
1152
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1169,7 +1169,7 @@ class SwitchBotPlatform {
1169
1169
  accessory.context.device = device;
1170
1170
  accessory.context.model = device.remoteType;
1171
1171
  accessory.context.deviceID = device.deviceId;
1172
- accessory.context.firmwareRevision = this.version;
1172
+ accessory.context.firmwareRevision = device.firmware;
1173
1173
  accessory.context.deviceType = `IR: ${device.remoteType}`;
1174
1174
  await this.connectionTypeNewIRAccessory(accessory);
1175
1175
  // create the accessory handler for the newly create accessory
@@ -1197,7 +1197,7 @@ class SwitchBotPlatform {
1197
1197
  existingAccessory.context.model = device.remoteType;
1198
1198
  existingAccessory.context.deviceID = device.deviceId;
1199
1199
  existingAccessory.displayName = device.deviceName;
1200
- existingAccessory.context.firmwareRevision = this.version;
1200
+ existingAccessory.context.firmwareRevision = device.firmware;
1201
1201
  existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
1202
1202
  await this.connectionTypeExistingIRAccessory(existingAccessory);
1203
1203
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1220,7 +1220,7 @@ class SwitchBotPlatform {
1220
1220
  accessory.context.device = device;
1221
1221
  accessory.context.model = device.remoteType;
1222
1222
  accessory.context.deviceID = device.deviceId;
1223
- accessory.context.firmwareRevision = this.version;
1223
+ accessory.context.firmwareRevision = device.firmware;
1224
1224
  accessory.context.deviceType = `IR: ${device.remoteType}`;
1225
1225
  await this.connectionTypeNewIRAccessory(accessory);
1226
1226
  // create the accessory handler for the newly create accessory
@@ -1248,7 +1248,7 @@ class SwitchBotPlatform {
1248
1248
  existingAccessory.context.model = device.remoteType;
1249
1249
  existingAccessory.context.deviceID = device.deviceId;
1250
1250
  existingAccessory.displayName = device.deviceName;
1251
- existingAccessory.context.firmwareRevision = this.version;
1251
+ existingAccessory.context.firmwareRevision = device.firmware;
1252
1252
  existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
1253
1253
  await this.connectionTypeExistingIRAccessory(existingAccessory);
1254
1254
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1271,7 +1271,7 @@ class SwitchBotPlatform {
1271
1271
  accessory.context.device = device;
1272
1272
  accessory.context.model = device.remoteType;
1273
1273
  accessory.context.deviceID = device.deviceId;
1274
- accessory.context.firmwareRevision = this.version;
1274
+ accessory.context.firmwareRevision = device.firmware;
1275
1275
  accessory.context.deviceType = `IR: ${device.remoteType}`;
1276
1276
  await this.connectionTypeNewIRAccessory(accessory);
1277
1277
  // create the accessory handler for the newly create accessory
@@ -1299,7 +1299,7 @@ class SwitchBotPlatform {
1299
1299
  existingAccessory.context.model = device.remoteType;
1300
1300
  existingAccessory.context.deviceID = device.deviceId;
1301
1301
  existingAccessory.displayName = device.deviceName;
1302
- existingAccessory.context.firmwareRevision = this.version;
1302
+ existingAccessory.context.firmwareRevision = device.firmware;
1303
1303
  existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
1304
1304
  await this.connectionTypeExistingIRAccessory(existingAccessory);
1305
1305
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1322,7 +1322,7 @@ class SwitchBotPlatform {
1322
1322
  accessory.context.device = device;
1323
1323
  accessory.context.model = device.remoteType;
1324
1324
  accessory.context.deviceID = device.deviceId;
1325
- accessory.context.firmwareRevision = this.version;
1325
+ accessory.context.firmwareRevision = device.firmware;
1326
1326
  accessory.context.deviceType = `IR: ${device.remoteType}`;
1327
1327
  await this.connectionTypeNewIRAccessory(accessory);
1328
1328
  // create the accessory handler for the newly create accessory
@@ -1350,7 +1350,7 @@ class SwitchBotPlatform {
1350
1350
  existingAccessory.context.model = device.remoteType;
1351
1351
  existingAccessory.context.deviceID = device.deviceId;
1352
1352
  existingAccessory.displayName = device.deviceName;
1353
- existingAccessory.context.firmwareRevision = this.version;
1353
+ existingAccessory.context.firmwareRevision = device.firmware;
1354
1354
  existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
1355
1355
  await this.connectionTypeExistingIRAccessory(existingAccessory);
1356
1356
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1373,7 +1373,7 @@ class SwitchBotPlatform {
1373
1373
  accessory.context.device = device;
1374
1374
  accessory.context.model = device.remoteType;
1375
1375
  accessory.context.deviceID = device.deviceId;
1376
- accessory.context.firmwareRevision = this.version;
1376
+ accessory.context.firmwareRevision = device.firmware;
1377
1377
  accessory.context.deviceType = `IR: ${device.remoteType}`;
1378
1378
  await this.connectionTypeNewIRAccessory(accessory);
1379
1379
  // create the accessory handler for the newly create accessory
@@ -1401,7 +1401,7 @@ class SwitchBotPlatform {
1401
1401
  existingAccessory.context.model = device.remoteType;
1402
1402
  existingAccessory.context.deviceID = device.deviceId;
1403
1403
  existingAccessory.displayName = device.deviceName;
1404
- existingAccessory.context.firmwareRevision = this.version;
1404
+ existingAccessory.context.firmwareRevision = device.firmware;
1405
1405
  existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
1406
1406
  await this.connectionTypeExistingIRAccessory(existingAccessory);
1407
1407
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1424,7 +1424,7 @@ class SwitchBotPlatform {
1424
1424
  accessory.context.device = device;
1425
1425
  accessory.context.model = device.remoteType;
1426
1426
  accessory.context.deviceID = device.deviceId;
1427
- accessory.context.firmwareRevision = this.version;
1427
+ accessory.context.firmwareRevision = device.firmware;
1428
1428
  accessory.context.deviceType = `IR: ${device.remoteType}`;
1429
1429
  await this.connectionTypeNewIRAccessory(accessory);
1430
1430
  // create the accessory handler for the newly create accessory
@@ -1452,7 +1452,7 @@ class SwitchBotPlatform {
1452
1452
  existingAccessory.context.model = device.remoteType;
1453
1453
  existingAccessory.context.deviceID = device.deviceId;
1454
1454
  existingAccessory.displayName = device.deviceName;
1455
- existingAccessory.context.firmwareRevision = this.version;
1455
+ existingAccessory.context.firmwareRevision = device.firmware;
1456
1456
  existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
1457
1457
  await this.connectionTypeExistingIRAccessory(existingAccessory);
1458
1458
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1475,7 +1475,7 @@ class SwitchBotPlatform {
1475
1475
  accessory.context.device = device;
1476
1476
  accessory.context.model = device.remoteType;
1477
1477
  accessory.context.deviceID = device.deviceId;
1478
- accessory.context.firmwareRevision = this.version;
1478
+ accessory.context.firmwareRevision = device.firmware;
1479
1479
  accessory.context.deviceType = `IR: ${device.remoteType}`;
1480
1480
  await this.connectionTypeNewIRAccessory(accessory);
1481
1481
  // create the accessory handler for the newly create accessory
@@ -1503,7 +1503,7 @@ class SwitchBotPlatform {
1503
1503
  existingAccessory.context.model = device.remoteType;
1504
1504
  existingAccessory.context.deviceID = device.deviceId;
1505
1505
  existingAccessory.displayName = device.deviceName;
1506
- existingAccessory.context.firmwareRevision = this.version;
1506
+ existingAccessory.context.firmwareRevision = device.firmware;
1507
1507
  existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
1508
1508
  await this.connectionTypeExistingIRAccessory(existingAccessory);
1509
1509
  this.api.updatePlatformAccessories([existingAccessory]);
@@ -1526,7 +1526,7 @@ class SwitchBotPlatform {
1526
1526
  accessory.context.device = device;
1527
1527
  accessory.context.model = device.remoteType;
1528
1528
  accessory.context.deviceID = device.deviceId;
1529
- accessory.context.firmwareRevision = this.version;
1529
+ accessory.context.firmwareRevision = device.firmware;
1530
1530
  accessory.context.deviceType = `IR: ${device.remoteType}`;
1531
1531
  await this.connectionTypeNewIRAccessory(accessory);
1532
1532
  // create the accessory handler for the newly create accessory