@switchbot/homebridge-switchbot 1.12.8 → 1.12.9-beta.10
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/.github/ISSUE_TEMPLATE/bug-report.yml +6 -1
- package/.github/ISSUE_TEMPLATE/feature-request.yml +6 -1
- package/.github/ISSUE_TEMPLATE/support-request.yml +6 -1
- package/CHANGELOG.md +12 -0
- package/config.schema.json +62 -0
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +3 -1
- package/dist/device/bot.js.map +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +3 -1
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +3 -1
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts +4 -0
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +47 -3
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +3 -2
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/lock.d.ts +1 -0
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +44 -6
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +3 -1
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +3 -1
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +3 -1
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +3 -1
- package/dist/device/plug.js.map +1 -1
- package/dist/device/striplight.d.ts.map +1 -1
- package/dist/device/striplight.js +3 -1
- package/dist/device/striplight.js.map +1 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +40 -41
- package/dist/platform.js.map +1 -1
- package/dist/settings.d.ts +3 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js.map +1 -1
- package/package.json +76 -76
- package/src/device/bot.ts +3 -1
- package/src/device/colorbulb.ts +3 -1
- package/src/device/contact.ts +3 -1
- package/src/device/curtain.ts +45 -3
- package/src/device/humidifier.ts +3 -2
- package/src/device/lock.ts +45 -6
- package/src/device/meter.ts +3 -1
- package/src/device/meterplus.ts +3 -1
- package/src/device/motion.ts +3 -1
- package/src/device/plug.ts +3 -1
- package/src/device/striplight.ts +3 -1
- package/src/platform.ts +40 -41
- package/src/settings.ts +3 -0
package/src/platform.ts
CHANGED
|
@@ -521,11 +521,10 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
521
521
|
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName} DeviceID: ${device.deviceId}`);
|
|
522
522
|
|
|
523
523
|
// if you need to update the accessory.context then you should run `api.updatePlatformAccessories`. eg.:
|
|
524
|
-
//existingAccessory.context.firmwareRevision = firmware;
|
|
525
524
|
existingAccessory.context.model = device.deviceType;
|
|
526
525
|
existingAccessory.context.deviceID = device.deviceId;
|
|
527
526
|
existingAccessory.displayName = device.deviceName;
|
|
528
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
527
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
529
528
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
530
529
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
531
530
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -548,7 +547,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
548
547
|
accessory.context.device = device;
|
|
549
548
|
accessory.context.model = device.deviceType;
|
|
550
549
|
accessory.context.deviceID = device.deviceId;
|
|
551
|
-
accessory.context.firmwareRevision = this.version;
|
|
550
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
552
551
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
553
552
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
554
553
|
// create the accessory handler for the newly create accessory
|
|
@@ -582,7 +581,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
582
581
|
existingAccessory.context.model = device.deviceType;
|
|
583
582
|
existingAccessory.context.deviceID = device.deviceId;
|
|
584
583
|
existingAccessory.displayName = device.deviceName;
|
|
585
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
584
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
586
585
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
587
586
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
588
587
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -607,7 +606,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
607
606
|
accessory.context.device = device;
|
|
608
607
|
accessory.context.model = device.deviceType;
|
|
609
608
|
accessory.context.deviceID = device.deviceId;
|
|
610
|
-
accessory.context.firmwareRevision = this.version;
|
|
609
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
611
610
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
612
611
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
613
612
|
// accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
|
|
@@ -640,7 +639,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
640
639
|
existingAccessory.context.model = device.deviceType;
|
|
641
640
|
existingAccessory.context.deviceID = device.deviceId;
|
|
642
641
|
existingAccessory.displayName = device.deviceName;
|
|
643
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
642
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
644
643
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
645
644
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
646
645
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -663,7 +662,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
663
662
|
accessory.context.device = device;
|
|
664
663
|
accessory.context.model = device.deviceType;
|
|
665
664
|
accessory.context.deviceID = device.deviceId;
|
|
666
|
-
accessory.context.firmwareRevision = this.version;
|
|
665
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
667
666
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
668
667
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
669
668
|
// create the accessory handler for the newly create accessory
|
|
@@ -695,7 +694,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
695
694
|
existingAccessory.context.model = device.deviceType;
|
|
696
695
|
existingAccessory.context.deviceID = device.deviceId;
|
|
697
696
|
existingAccessory.displayName = device.deviceName;
|
|
698
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
697
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
699
698
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
700
699
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
701
700
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -718,7 +717,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
718
717
|
accessory.context.device = device;
|
|
719
718
|
accessory.context.model = device.deviceType;
|
|
720
719
|
accessory.context.deviceID = device.deviceId;
|
|
721
|
-
accessory.context.firmwareRevision = this.version;
|
|
720
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
722
721
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
723
722
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
724
723
|
// create the accessory handler for the newly create accessory
|
|
@@ -750,7 +749,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
750
749
|
existingAccessory.context.model = device.deviceType;
|
|
751
750
|
existingAccessory.context.deviceID = device.deviceId;
|
|
752
751
|
existingAccessory.displayName = device.deviceName;
|
|
753
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
752
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
754
753
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
755
754
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
756
755
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -773,7 +772,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
773
772
|
accessory.context.device = device;
|
|
774
773
|
accessory.context.model = device.deviceType;
|
|
775
774
|
accessory.context.deviceID = device.deviceId;
|
|
776
|
-
accessory.context.firmwareRevision = this.version;
|
|
775
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
777
776
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
778
777
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
779
778
|
// create the accessory handler for the newly create accessory
|
|
@@ -805,7 +804,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
805
804
|
existingAccessory.context.model = device.deviceType;
|
|
806
805
|
existingAccessory.context.deviceID = device.deviceId;
|
|
807
806
|
existingAccessory.displayName = device.deviceName;
|
|
808
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
807
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
809
808
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
810
809
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
811
810
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -828,7 +827,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
828
827
|
accessory.context.device = device;
|
|
829
828
|
accessory.context.model = device.deviceType;
|
|
830
829
|
accessory.context.deviceID = device.deviceId;
|
|
831
|
-
accessory.context.firmwareRevision = this.version;
|
|
830
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
832
831
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
833
832
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
834
833
|
// create the accessory handler for the newly create accessory
|
|
@@ -860,7 +859,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
860
859
|
existingAccessory.context.model = device.deviceType;
|
|
861
860
|
existingAccessory.context.deviceID = device.deviceId;
|
|
862
861
|
existingAccessory.displayName = device.deviceName;
|
|
863
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
862
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
864
863
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
865
864
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
866
865
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -894,7 +893,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
894
893
|
accessory.context.device = device;
|
|
895
894
|
accessory.context.model = device.deviceType;
|
|
896
895
|
accessory.context.deviceID = device.deviceId;
|
|
897
|
-
accessory.context.firmwareRevision = this.version;
|
|
896
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
898
897
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
899
898
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
900
899
|
// create the accessory handler for the newly create accessory
|
|
@@ -941,7 +940,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
941
940
|
existingAccessory.context.model = device.deviceType;
|
|
942
941
|
existingAccessory.context.deviceID = device.deviceId;
|
|
943
942
|
existingAccessory.displayName = device.deviceName;
|
|
944
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
943
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
945
944
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
946
945
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
947
946
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -964,7 +963,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
964
963
|
accessory.context.device = device;
|
|
965
964
|
accessory.context.model = device.deviceType;
|
|
966
965
|
accessory.context.deviceID = device.deviceId;
|
|
967
|
-
accessory.context.firmwareRevision = this.version;
|
|
966
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
968
967
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
969
968
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
970
969
|
// create the accessory handler for the newly create accessory
|
|
@@ -996,7 +995,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
996
995
|
existingAccessory.context.model = device.deviceType;
|
|
997
996
|
existingAccessory.context.deviceID = device.deviceId;
|
|
998
997
|
existingAccessory.displayName = device.deviceName;
|
|
999
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
998
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1000
999
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1001
1000
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
1002
1001
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1019,7 +1018,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1019
1018
|
accessory.context.device = device;
|
|
1020
1019
|
accessory.context.model = device.deviceType;
|
|
1021
1020
|
accessory.context.deviceID = device.deviceId;
|
|
1022
|
-
accessory.context.firmwareRevision = this.version;
|
|
1021
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1023
1022
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1024
1023
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
1025
1024
|
// create the accessory handler for the newly create accessory
|
|
@@ -1051,7 +1050,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1051
1050
|
existingAccessory.context.model = device.deviceType;
|
|
1052
1051
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1053
1052
|
existingAccessory.displayName = device.deviceName;
|
|
1054
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
1053
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1055
1054
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1056
1055
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
1057
1056
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1074,7 +1073,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1074
1073
|
accessory.context.device = device;
|
|
1075
1074
|
accessory.context.model = device.deviceType;
|
|
1076
1075
|
accessory.context.deviceID = device.deviceId;
|
|
1077
|
-
accessory.context.firmwareRevision = this.version;
|
|
1076
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1078
1077
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1079
1078
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
1080
1079
|
// create the accessory handler for the newly create accessory
|
|
@@ -1106,7 +1105,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1106
1105
|
existingAccessory.context.model = device.deviceType;
|
|
1107
1106
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1108
1107
|
existingAccessory.displayName = device.deviceName;
|
|
1109
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
1108
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1110
1109
|
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1111
1110
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
1112
1111
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1129,7 +1128,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1129
1128
|
accessory.context.device = device;
|
|
1130
1129
|
accessory.context.model = device.deviceType;
|
|
1131
1130
|
accessory.context.deviceID = device.deviceId;
|
|
1132
|
-
accessory.context.firmwareRevision = this.version;
|
|
1131
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1133
1132
|
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
1134
1133
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
1135
1134
|
// create the accessory handler for the newly create accessory
|
|
@@ -1159,7 +1158,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1159
1158
|
existingAccessory.context.model = device.remoteType;
|
|
1160
1159
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1161
1160
|
existingAccessory.displayName = device.deviceName;
|
|
1162
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
1161
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1163
1162
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1164
1163
|
await this.connectionTypeExistingIRAccessory(existingAccessory);
|
|
1165
1164
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1179,7 +1178,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1179
1178
|
accessory.context.device = device;
|
|
1180
1179
|
accessory.context.model = device.remoteType;
|
|
1181
1180
|
accessory.context.deviceID = device.deviceId;
|
|
1182
|
-
accessory.context.firmwareRevision = this.version;
|
|
1181
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1183
1182
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1184
1183
|
await this.connectionTypeNewIRAccessory(accessory);
|
|
1185
1184
|
// create the accessory handler for the newly create accessory
|
|
@@ -1216,7 +1215,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1216
1215
|
existingAccessory.context.model = device.remoteType;
|
|
1217
1216
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1218
1217
|
existingAccessory.displayName = device.deviceName;
|
|
1219
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
1218
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1220
1219
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1221
1220
|
await this.connectionTypeExistingIRAccessory(existingAccessory);
|
|
1222
1221
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1239,7 +1238,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1239
1238
|
accessory.context.device = device;
|
|
1240
1239
|
accessory.context.model = device.remoteType;
|
|
1241
1240
|
accessory.context.deviceID = device.deviceId;
|
|
1242
|
-
accessory.context.firmwareRevision = this.version;
|
|
1241
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1243
1242
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1244
1243
|
await this.connectionTypeNewIRAccessory(accessory);
|
|
1245
1244
|
// create the accessory handler for the newly create accessory
|
|
@@ -1271,7 +1270,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1271
1270
|
existingAccessory.context.model = device.remoteType;
|
|
1272
1271
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1273
1272
|
existingAccessory.displayName = device.deviceName;
|
|
1274
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
1273
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1275
1274
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1276
1275
|
await this.connectionTypeExistingIRAccessory(existingAccessory);
|
|
1277
1276
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1294,7 +1293,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1294
1293
|
accessory.context.device = device;
|
|
1295
1294
|
accessory.context.model = device.remoteType;
|
|
1296
1295
|
accessory.context.deviceID = device.deviceId;
|
|
1297
|
-
accessory.context.firmwareRevision = this.version;
|
|
1296
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1298
1297
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1299
1298
|
await this.connectionTypeNewIRAccessory(accessory);
|
|
1300
1299
|
// create the accessory handler for the newly create accessory
|
|
@@ -1326,7 +1325,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1326
1325
|
existingAccessory.context.model = device.remoteType;
|
|
1327
1326
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1328
1327
|
existingAccessory.displayName = device.deviceName;
|
|
1329
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
1328
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1330
1329
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1331
1330
|
await this.connectionTypeExistingIRAccessory(existingAccessory);
|
|
1332
1331
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1349,7 +1348,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1349
1348
|
accessory.context.device = device;
|
|
1350
1349
|
accessory.context.model = device.remoteType;
|
|
1351
1350
|
accessory.context.deviceID = device.deviceId;
|
|
1352
|
-
accessory.context.firmwareRevision = this.version;
|
|
1351
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1353
1352
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1354
1353
|
await this.connectionTypeNewIRAccessory(accessory);
|
|
1355
1354
|
// create the accessory handler for the newly create accessory
|
|
@@ -1381,7 +1380,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1381
1380
|
existingAccessory.context.model = device.remoteType;
|
|
1382
1381
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1383
1382
|
existingAccessory.displayName = device.deviceName;
|
|
1384
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
1383
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1385
1384
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1386
1385
|
await this.connectionTypeExistingIRAccessory(existingAccessory);
|
|
1387
1386
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1404,7 +1403,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1404
1403
|
accessory.context.device = device;
|
|
1405
1404
|
accessory.context.model = device.remoteType;
|
|
1406
1405
|
accessory.context.deviceID = device.deviceId;
|
|
1407
|
-
accessory.context.firmwareRevision = this.version;
|
|
1406
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1408
1407
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1409
1408
|
await this.connectionTypeNewIRAccessory(accessory);
|
|
1410
1409
|
// create the accessory handler for the newly create accessory
|
|
@@ -1436,7 +1435,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1436
1435
|
existingAccessory.context.model = device.remoteType;
|
|
1437
1436
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1438
1437
|
existingAccessory.displayName = device.deviceName;
|
|
1439
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
1438
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1440
1439
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1441
1440
|
await this.connectionTypeExistingIRAccessory(existingAccessory);
|
|
1442
1441
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1459,7 +1458,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1459
1458
|
accessory.context.device = device;
|
|
1460
1459
|
accessory.context.model = device.remoteType;
|
|
1461
1460
|
accessory.context.deviceID = device.deviceId;
|
|
1462
|
-
accessory.context.firmwareRevision = this.version;
|
|
1461
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1463
1462
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1464
1463
|
await this.connectionTypeNewIRAccessory(accessory);
|
|
1465
1464
|
// create the accessory handler for the newly create accessory
|
|
@@ -1491,7 +1490,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1491
1490
|
existingAccessory.context.model = device.remoteType;
|
|
1492
1491
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1493
1492
|
existingAccessory.displayName = device.deviceName;
|
|
1494
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
1493
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1495
1494
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1496
1495
|
await this.connectionTypeExistingIRAccessory(existingAccessory);
|
|
1497
1496
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1514,7 +1513,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1514
1513
|
accessory.context.device = device;
|
|
1515
1514
|
accessory.context.model = device.remoteType;
|
|
1516
1515
|
accessory.context.deviceID = device.deviceId;
|
|
1517
|
-
accessory.context.firmwareRevision = this.version;
|
|
1516
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1518
1517
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1519
1518
|
await this.connectionTypeNewIRAccessory(accessory);
|
|
1520
1519
|
// create the accessory handler for the newly create accessory
|
|
@@ -1546,7 +1545,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1546
1545
|
existingAccessory.context.model = device.remoteType;
|
|
1547
1546
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1548
1547
|
existingAccessory.displayName = device.deviceName;
|
|
1549
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
1548
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1550
1549
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1551
1550
|
await this.connectionTypeExistingIRAccessory(existingAccessory);
|
|
1552
1551
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1569,7 +1568,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1569
1568
|
accessory.context.device = device;
|
|
1570
1569
|
accessory.context.model = device.remoteType;
|
|
1571
1570
|
accessory.context.deviceID = device.deviceId;
|
|
1572
|
-
accessory.context.firmwareRevision = this.version;
|
|
1571
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1573
1572
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1574
1573
|
await this.connectionTypeNewIRAccessory(accessory);
|
|
1575
1574
|
// create the accessory handler for the newly create accessory
|
|
@@ -1601,7 +1600,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1601
1600
|
existingAccessory.context.model = device.remoteType;
|
|
1602
1601
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1603
1602
|
existingAccessory.displayName = device.deviceName;
|
|
1604
|
-
existingAccessory.context.firmwareRevision = this.version;
|
|
1603
|
+
existingAccessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1605
1604
|
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1606
1605
|
await this.connectionTypeExistingIRAccessory(existingAccessory);
|
|
1607
1606
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
@@ -1624,7 +1623,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1624
1623
|
accessory.context.device = device;
|
|
1625
1624
|
accessory.context.model = device.remoteType;
|
|
1626
1625
|
accessory.context.deviceID = device.deviceId;
|
|
1627
|
-
accessory.context.firmwareRevision = this.version;
|
|
1626
|
+
accessory.context.firmwareRevision = device.firmware || this.version || '1.12.8';
|
|
1628
1627
|
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1629
1628
|
await this.connectionTypeNewIRAccessory(accessory);
|
|
1630
1629
|
// 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;
|
|
@@ -86,6 +87,8 @@ export type curtain = {
|
|
|
86
87
|
set_max?: number;
|
|
87
88
|
set_min?: number;
|
|
88
89
|
set_minStep?: number;
|
|
90
|
+
setCloseMode?: string;
|
|
91
|
+
setOpenMode?: string;
|
|
89
92
|
};
|
|
90
93
|
|
|
91
94
|
export type contact = {
|