@switchbot/homebridge-switchbot 1.3.1-beta.0 → 1.3.1-beta.4
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/config.schema.json +3 -3
- package/dist/devices/bots.d.ts.map +1 -1
- package/dist/devices/bots.js +28 -14
- package/dist/devices/bots.js.map +1 -1
- package/dist/devices/curtains.d.ts.map +1 -1
- package/dist/devices/curtains.js +6 -1
- package/dist/devices/curtains.js.map +1 -1
- package/dist/devices/humidifiers.d.ts.map +1 -1
- package/dist/devices/humidifiers.js +6 -1
- package/dist/devices/humidifiers.js.map +1 -1
- package/dist/devices/indoorcam.d.ts.map +1 -1
- package/dist/devices/indoorcam.js +6 -1
- package/dist/devices/indoorcam.js.map +1 -1
- package/dist/devices/plugs.d.ts.map +1 -1
- package/dist/devices/plugs.js +6 -0
- package/dist/devices/plugs.js.map +1 -1
- package/dist/platform.d.ts +2 -0
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +60 -18
- package/dist/platform.js.map +1 -1
- package/homebridge-ui/public/index.html +5 -1
- package/package.json +3 -3
- package/src/devices/bots.ts +39 -27
- package/src/devices/curtains.ts +7 -2
- package/src/devices/humidifiers.ts +7 -2
- package/src/devices/indoorcam.ts +7 -2
- package/src/devices/plugs.ts +7 -1
- package/src/platform.ts +67 -18
package/dist/devices/plugs.js
CHANGED
|
@@ -126,6 +126,12 @@ class Plug {
|
|
|
126
126
|
const push = (await this.platform.axios.post(`${settings_1.DeviceURL}/${this.device.deviceId}/commands`, payload));
|
|
127
127
|
this.platform.debug(`Plug: ${this.accessory.displayName} pushchanges: ${JSON.stringify(push.data)}`);
|
|
128
128
|
this.statusCode(push);
|
|
129
|
+
(0, rxjs_1.interval)(5000)
|
|
130
|
+
.pipe((0, operators_1.skipWhile)(() => this.plugUpdateInProgress))
|
|
131
|
+
.pipe((0, operators_1.take)(1))
|
|
132
|
+
.subscribe(() => {
|
|
133
|
+
this.refreshStatus();
|
|
134
|
+
});
|
|
129
135
|
}
|
|
130
136
|
updateHomeKitCharacteristics() {
|
|
131
137
|
if (this.On === undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugs.js","sourceRoot":"","sources":["../../src/devices/plugs.ts"],"names":[],"mappings":";;;AAEA,+BAAyC;AAEzC,
|
|
1
|
+
{"version":3,"file":"plugs.js","sourceRoot":"","sources":["../../src/devices/plugs.ts"],"names":[],"mappings":";;;AAEA,+BAAyC;AAEzC,8CAAoE;AAEpE,0CAA8F;AAE9F,MAAa,IAAI;IAkBf,YACmB,QAA2B,EACpC,SAA4B,EAC7B,MAA8B;QAFpB,aAAQ,GAAR,QAAQ,CAAmB;QACpC,cAAS,GAAT,SAAS,CAAmB;QAC7B,WAAM,GAAN,MAAM,CAAwB;QAXvC,SAAS;QACQ,gBAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;QAC1F,eAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,KAAK,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;QAWvG,uBAAuB;QACvB,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC;QAEhB,oFAAoF;QACpF,IAAI,CAAC,YAAY,GAAG,IAAI,cAAO,EAAE,CAAC;QAClC,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC;QAElC,4CAA4C;QAC5C,IAAI,CAAC,aAAa,EAAE,CAAC;QAErB,4BAA4B;QAC5B,SAAS;aACN,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,oBAAoB,CAAE;aACvD,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,YAAY,EAAE,WAAW,CAAC;aACzE,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC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CAAC,WAAW,gCAAgC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;gBACtH,MAAM;YACR,KAAK,GAAG;gBACN,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,WAAW,2EAA2E;sBAClI,gBAAgB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;gBACnE,MAAM;YACR,KAAK,GAAG;gBACN,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,WAAW,6BAA6B,CAAC,CAAC;gBACtF,MAAM;YACR;gBACE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,WAAW,sBAAsB,CAAC,CAAC;SAClF;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAA0B;QAC9B,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,WAAW,cAAc,KAAK,EAAE,CAAC,CAAC;QAE9E,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC;QAChB,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;CAGF;AAvND,oBAuNC"}
|
package/dist/platform.d.ts
CHANGED
|
@@ -56,6 +56,8 @@ export declare class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
56
56
|
private createOthers;
|
|
57
57
|
connectionTypeNewAccessory(device: device & devicesConfig, accessory: PlatformAccessory): Promise<void>;
|
|
58
58
|
connectionTypeExistingAccessory(device: device & devicesConfig, existingAccessory: PlatformAccessory): Promise<void>;
|
|
59
|
+
connectionTypeNewIRAccessory(device: irdevice & devicesConfig, accessory: PlatformAccessory): Promise<void>;
|
|
60
|
+
connectionTypeExistingIRAccessory(device: irdevice & devicesConfig, existingAccessory: PlatformAccessory): Promise<void>;
|
|
59
61
|
unregisterPlatformAccessories(existingAccessory: PlatformAccessory): void;
|
|
60
62
|
deviceListInfo(devices: deviceResponses): void;
|
|
61
63
|
deviceInfo(device: irdevice & devicesConfig | device & devicesConfig): Promise<void>;
|
package/dist/platform.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAmBA,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,iBAAkB,YAAW,qBAAqB;aAiBjC,GAAG,EAAE,MAAM;aAAkB,MAAM,EAAE,uBAAuB;aAAkB,GAAG,EAAE,GAAG;IAhBlH,SAAgB,OAAO,EAAE,OAAO,OAAO,CAAwB;IAC/D,SAAgB,cAAc,EAAE,OAAO,cAAc,CAA+B;IAGpF,SAAgB,WAAW,EAAE,iBAAiB,EAAE,CAAM;IAE/C,KAAK,EAAE,aAAa,CAExB;IAGH,OAAO,MAAsC;IAC7C,YAAY,EAAG,eAAe,CAAC;IAC/B,iBAAiB,EAAG,OAAO,CAAC;IAC5B,SAAS,EAAG,OAAO,CAAC;gBAEQ,GAAG,EAAE,MAAM,EAAkB,MAAM,EAAE,uBAAuB,EAAkB,GAAG,EAAE,GAAG;IAgDlH;;;OAGG;IACH,kBAAkB,CAAC,SAAS,EAAE,iBAAiB;IAO/C;;OAEG;IACH,YAAY;IAqEZ;;KAEC;IACK,eAAe;IA+FrB,OAAO,CAAC,YAAY;IAqDpB,OAAO,CAAC,cAAc;IA8DtB,OAAO,CAAC,cAAc;YAiBR,gBAAgB;
|
|
1
|
+
{"version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B;YAuDjB,iBAAiB;YAuDjB,mBAAmB;YAuDnB,YAAY;YAuDZ,YAAY;IAuDb,0BAA0B,CACrC,MAAM,EAAE,MAAM,GAAG,aAAa,EAC9B,SAAS,EAAE,iBAAiB;IAQjB,+BAA+B,CAC1C,MAAM,EAAE,MAAM,GAAG,aAAa,EAC9B,iBAAiB,EAAE,iBAAiB;IASzB,4BAA4B,CACvC,MAAM,EAAE,QAAQ,GAAG,aAAa,EAChC,SAAS,EAAE,iBAAiB;IAIjB,iCAAiC,CAC5C,MAAM,EAAE,QAAQ,GAAG,aAAa,EAChC,iBAAiB,EAAE,iBAAiB;IAK/B,6BAA6B,CAAC,iBAAiB,EAAE,iBAAiB;IAMlE,cAAc,CAAC,OAAO,EAAE,eAAe;IAMjC,UAAU,CAAC,MAAM,EAAE,QAAQ,GAAG,aAAa,GAAG,MAAM,GAAG,aAAa;IAajF;;;;OAIG;IACH,KAAK,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE;IAQnB;;;OAGG;IACH,MAAM,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE;CASrB"}
|
package/dist/platform.js
CHANGED
|
@@ -400,6 +400,7 @@ class SwitchBotPlatform {
|
|
|
400
400
|
existingAccessory.context.deviceID = device.deviceId;
|
|
401
401
|
existingAccessory.displayName = device.deviceName;
|
|
402
402
|
existingAccessory.context.firmwareRevision = this.version;
|
|
403
|
+
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
403
404
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
404
405
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
405
406
|
// create the accessory handler for the restored accessory
|
|
@@ -422,6 +423,7 @@ class SwitchBotPlatform {
|
|
|
422
423
|
accessory.context.model = device.deviceType;
|
|
423
424
|
accessory.context.deviceID = device.deviceId;
|
|
424
425
|
accessory.context.firmwareRevision = this.version;
|
|
426
|
+
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
425
427
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
426
428
|
// create the accessory handler for the newly create accessory
|
|
427
429
|
// this is imported from `platformAccessory.ts`
|
|
@@ -450,6 +452,7 @@ class SwitchBotPlatform {
|
|
|
450
452
|
existingAccessory.context.deviceID = device.deviceId;
|
|
451
453
|
existingAccessory.displayName = device.deviceName;
|
|
452
454
|
existingAccessory.context.firmwareRevision = this.version;
|
|
455
|
+
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
453
456
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
454
457
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
455
458
|
// create the accessory handler for the restored accessory
|
|
@@ -473,6 +476,7 @@ class SwitchBotPlatform {
|
|
|
473
476
|
accessory.context.model = device.deviceType;
|
|
474
477
|
accessory.context.deviceID = device.deviceId;
|
|
475
478
|
accessory.context.firmwareRevision = this.version;
|
|
479
|
+
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
476
480
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
477
481
|
// accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
|
|
478
482
|
// create the accessory handler for the newly create accessory
|
|
@@ -501,6 +505,7 @@ class SwitchBotPlatform {
|
|
|
501
505
|
existingAccessory.context.deviceID = device.deviceId;
|
|
502
506
|
existingAccessory.displayName = device.deviceName;
|
|
503
507
|
existingAccessory.context.firmwareRevision = this.version;
|
|
508
|
+
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
504
509
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
505
510
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
506
511
|
// create the accessory handler for the restored accessory
|
|
@@ -523,6 +528,7 @@ class SwitchBotPlatform {
|
|
|
523
528
|
accessory.context.model = device.deviceType;
|
|
524
529
|
accessory.context.deviceID = device.deviceId;
|
|
525
530
|
accessory.context.firmwareRevision = this.version;
|
|
531
|
+
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
526
532
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
527
533
|
// create the accessory handler for the newly create accessory
|
|
528
534
|
// this is imported from `platformAccessory.ts`
|
|
@@ -550,6 +556,7 @@ class SwitchBotPlatform {
|
|
|
550
556
|
existingAccessory.context.deviceID = device.deviceId;
|
|
551
557
|
existingAccessory.displayName = device.deviceName;
|
|
552
558
|
existingAccessory.context.firmwareRevision = this.version;
|
|
559
|
+
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
553
560
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
554
561
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
555
562
|
// create the accessory handler for the restored accessory
|
|
@@ -572,6 +579,7 @@ class SwitchBotPlatform {
|
|
|
572
579
|
accessory.context.model = device.deviceType;
|
|
573
580
|
accessory.context.deviceID = device.deviceId;
|
|
574
581
|
accessory.context.firmwareRevision = this.version;
|
|
582
|
+
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
575
583
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
576
584
|
// create the accessory handler for the newly create accessory
|
|
577
585
|
// this is imported from `platformAccessory.ts`
|
|
@@ -599,6 +607,7 @@ class SwitchBotPlatform {
|
|
|
599
607
|
existingAccessory.context.deviceID = device.deviceId;
|
|
600
608
|
existingAccessory.displayName = device.deviceName;
|
|
601
609
|
existingAccessory.context.firmwareRevision = this.version;
|
|
610
|
+
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
602
611
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
603
612
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
604
613
|
// create the accessory handler for the restored accessory
|
|
@@ -621,6 +630,7 @@ class SwitchBotPlatform {
|
|
|
621
630
|
accessory.context.model = device.deviceType;
|
|
622
631
|
accessory.context.deviceID = device.deviceId;
|
|
623
632
|
accessory.context.firmwareRevision = this.version;
|
|
633
|
+
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
624
634
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
625
635
|
// create the accessory handler for the newly create accessory
|
|
626
636
|
// this is imported from `platformAccessory.ts`
|
|
@@ -648,6 +658,7 @@ class SwitchBotPlatform {
|
|
|
648
658
|
existingAccessory.context.deviceID = device.deviceId;
|
|
649
659
|
existingAccessory.displayName = device.deviceName;
|
|
650
660
|
existingAccessory.context.firmwareRevision = this.version;
|
|
661
|
+
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
651
662
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
652
663
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
653
664
|
// create the accessory handler for the restored accessory
|
|
@@ -682,6 +693,7 @@ class SwitchBotPlatform {
|
|
|
682
693
|
accessory.context.model = device.deviceType;
|
|
683
694
|
accessory.context.deviceID = device.deviceId;
|
|
684
695
|
accessory.context.firmwareRevision = this.version;
|
|
696
|
+
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
685
697
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
686
698
|
// create the accessory handler for the newly create accessory
|
|
687
699
|
// this is imported from `platformAccessory.ts`
|
|
@@ -721,6 +733,7 @@ class SwitchBotPlatform {
|
|
|
721
733
|
existingAccessory.context.deviceID = device.deviceId;
|
|
722
734
|
existingAccessory.displayName = device.deviceName;
|
|
723
735
|
existingAccessory.context.firmwareRevision = this.version;
|
|
736
|
+
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
724
737
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
725
738
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
726
739
|
// create the accessory handler for the restored accessory
|
|
@@ -743,6 +756,7 @@ class SwitchBotPlatform {
|
|
|
743
756
|
accessory.context.model = device.deviceType;
|
|
744
757
|
accessory.context.deviceID = device.deviceId;
|
|
745
758
|
accessory.context.firmwareRevision = this.version;
|
|
759
|
+
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
746
760
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
747
761
|
// create the accessory handler for the newly create accessory
|
|
748
762
|
// this is imported from `platformAccessory.ts`
|
|
@@ -770,6 +784,7 @@ class SwitchBotPlatform {
|
|
|
770
784
|
existingAccessory.context.deviceID = device.deviceId;
|
|
771
785
|
existingAccessory.displayName = device.deviceName;
|
|
772
786
|
existingAccessory.context.firmwareRevision = this.version;
|
|
787
|
+
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
773
788
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
774
789
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
775
790
|
// create the accessory handler for the restored accessory
|
|
@@ -792,6 +807,7 @@ class SwitchBotPlatform {
|
|
|
792
807
|
accessory.context.model = device.deviceType;
|
|
793
808
|
accessory.context.deviceID = device.deviceId;
|
|
794
809
|
accessory.context.firmwareRevision = this.version;
|
|
810
|
+
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
795
811
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
796
812
|
// create the accessory handler for the newly create accessory
|
|
797
813
|
// this is imported from `platformAccessory.ts`
|
|
@@ -819,6 +835,7 @@ class SwitchBotPlatform {
|
|
|
819
835
|
existingAccessory.context.deviceID = device.deviceId;
|
|
820
836
|
existingAccessory.displayName = device.deviceName;
|
|
821
837
|
existingAccessory.context.firmwareRevision = this.version;
|
|
838
|
+
existingAccessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
822
839
|
await this.connectionTypeExistingAccessory(device, existingAccessory);
|
|
823
840
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
824
841
|
// create the accessory handler for the restored accessory
|
|
@@ -841,6 +858,7 @@ class SwitchBotPlatform {
|
|
|
841
858
|
accessory.context.model = device.deviceType;
|
|
842
859
|
accessory.context.deviceID = device.deviceId;
|
|
843
860
|
accessory.context.firmwareRevision = this.version;
|
|
861
|
+
accessory.context.deviceType = `SwitchBot: ${device.deviceType}`;
|
|
844
862
|
await this.connectionTypeNewAccessory(device, accessory);
|
|
845
863
|
// create the accessory handler for the newly create accessory
|
|
846
864
|
// this is imported from `platformAccessory.ts`
|
|
@@ -866,7 +884,8 @@ class SwitchBotPlatform {
|
|
|
866
884
|
existingAccessory.context.deviceID = device.deviceId;
|
|
867
885
|
existingAccessory.displayName = device.deviceName;
|
|
868
886
|
existingAccessory.context.firmwareRevision = this.version;
|
|
869
|
-
|
|
887
|
+
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
888
|
+
await this.connectionTypeExistingIRAccessory(device, existingAccessory);
|
|
870
889
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
871
890
|
// create the accessory handler for the restored accessory
|
|
872
891
|
// this is imported from `platformAccessory.ts`
|
|
@@ -884,7 +903,8 @@ class SwitchBotPlatform {
|
|
|
884
903
|
accessory.context.model = device.remoteType;
|
|
885
904
|
accessory.context.deviceID = device.deviceId;
|
|
886
905
|
accessory.context.firmwareRevision = this.version;
|
|
887
|
-
|
|
906
|
+
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
907
|
+
await this.connectionTypeNewIRAccessory(device, accessory);
|
|
888
908
|
// create the accessory handler for the newly create accessory
|
|
889
909
|
// this is imported from `platformAccessory.ts`
|
|
890
910
|
new tvs_1.TV(this, accessory, device);
|
|
@@ -915,7 +935,8 @@ class SwitchBotPlatform {
|
|
|
915
935
|
existingAccessory.context.deviceID = device.deviceId;
|
|
916
936
|
existingAccessory.displayName = device.deviceName;
|
|
917
937
|
existingAccessory.context.firmwareRevision = this.version;
|
|
918
|
-
|
|
938
|
+
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
939
|
+
await this.connectionTypeExistingIRAccessory(device, existingAccessory);
|
|
919
940
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
920
941
|
// create the accessory handler for the restored accessory
|
|
921
942
|
// this is imported from `platformAccessory.ts`
|
|
@@ -937,7 +958,8 @@ class SwitchBotPlatform {
|
|
|
937
958
|
accessory.context.model = device.remoteType;
|
|
938
959
|
accessory.context.deviceID = device.deviceId;
|
|
939
960
|
accessory.context.firmwareRevision = this.version;
|
|
940
|
-
|
|
961
|
+
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
962
|
+
await this.connectionTypeNewIRAccessory(device, accessory);
|
|
941
963
|
// create the accessory handler for the newly create accessory
|
|
942
964
|
// this is imported from `platformAccessory.ts`
|
|
943
965
|
new fans_1.Fan(this, accessory, device);
|
|
@@ -964,7 +986,8 @@ class SwitchBotPlatform {
|
|
|
964
986
|
existingAccessory.context.deviceID = device.deviceId;
|
|
965
987
|
existingAccessory.displayName = device.deviceName;
|
|
966
988
|
existingAccessory.context.firmwareRevision = this.version;
|
|
967
|
-
|
|
989
|
+
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
990
|
+
await this.connectionTypeExistingIRAccessory(device, existingAccessory);
|
|
968
991
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
969
992
|
// create the accessory handler for the restored accessory
|
|
970
993
|
// this is imported from `platformAccessory.ts`
|
|
@@ -986,7 +1009,8 @@ class SwitchBotPlatform {
|
|
|
986
1009
|
accessory.context.model = device.remoteType;
|
|
987
1010
|
accessory.context.deviceID = device.deviceId;
|
|
988
1011
|
accessory.context.firmwareRevision = this.version;
|
|
989
|
-
|
|
1012
|
+
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1013
|
+
await this.connectionTypeNewIRAccessory(device, accessory);
|
|
990
1014
|
// create the accessory handler for the newly create accessory
|
|
991
1015
|
// this is imported from `platformAccessory.ts`
|
|
992
1016
|
new lights_1.Light(this, accessory, device);
|
|
@@ -1013,7 +1037,8 @@ class SwitchBotPlatform {
|
|
|
1013
1037
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1014
1038
|
existingAccessory.displayName = device.deviceName;
|
|
1015
1039
|
existingAccessory.context.firmwareRevision = this.version;
|
|
1016
|
-
|
|
1040
|
+
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1041
|
+
await this.connectionTypeExistingIRAccessory(device, existingAccessory);
|
|
1017
1042
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
1018
1043
|
// create the accessory handler for the restored accessory
|
|
1019
1044
|
// this is imported from `platformAccessory.ts`
|
|
@@ -1035,7 +1060,8 @@ class SwitchBotPlatform {
|
|
|
1035
1060
|
accessory.context.model = device.remoteType;
|
|
1036
1061
|
accessory.context.deviceID = device.deviceId;
|
|
1037
1062
|
accessory.context.firmwareRevision = this.version;
|
|
1038
|
-
|
|
1063
|
+
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1064
|
+
await this.connectionTypeNewIRAccessory(device, accessory);
|
|
1039
1065
|
// create the accessory handler for the newly create accessory
|
|
1040
1066
|
// this is imported from `platformAccessory.ts`
|
|
1041
1067
|
new airconditioners_1.AirConditioner(this, accessory, device);
|
|
@@ -1062,7 +1088,8 @@ class SwitchBotPlatform {
|
|
|
1062
1088
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1063
1089
|
existingAccessory.displayName = device.deviceName;
|
|
1064
1090
|
existingAccessory.context.firmwareRevision = this.version;
|
|
1065
|
-
|
|
1091
|
+
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1092
|
+
await this.connectionTypeExistingIRAccessory(device, existingAccessory);
|
|
1066
1093
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
1067
1094
|
// create the accessory handler for the restored accessory
|
|
1068
1095
|
// this is imported from `platformAccessory.ts`
|
|
@@ -1084,7 +1111,8 @@ class SwitchBotPlatform {
|
|
|
1084
1111
|
accessory.context.model = device.remoteType;
|
|
1085
1112
|
accessory.context.deviceID = device.deviceId;
|
|
1086
1113
|
accessory.context.firmwareRevision = this.version;
|
|
1087
|
-
|
|
1114
|
+
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1115
|
+
await this.connectionTypeNewIRAccessory(device, accessory);
|
|
1088
1116
|
// create the accessory handler for the newly create accessory
|
|
1089
1117
|
// this is imported from `platformAccessory.ts`
|
|
1090
1118
|
new airpurifiers_1.AirPurifier(this, accessory, device);
|
|
@@ -1111,7 +1139,8 @@ class SwitchBotPlatform {
|
|
|
1111
1139
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1112
1140
|
existingAccessory.displayName = device.deviceName;
|
|
1113
1141
|
existingAccessory.context.firmwareRevision = this.version;
|
|
1114
|
-
|
|
1142
|
+
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1143
|
+
await this.connectionTypeExistingIRAccessory(device, existingAccessory);
|
|
1115
1144
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
1116
1145
|
// create the accessory handler for the restored accessory
|
|
1117
1146
|
// this is imported from `platformAccessory.ts`
|
|
@@ -1133,7 +1162,8 @@ class SwitchBotPlatform {
|
|
|
1133
1162
|
accessory.context.model = device.remoteType;
|
|
1134
1163
|
accessory.context.deviceID = device.deviceId;
|
|
1135
1164
|
accessory.context.firmwareRevision = this.version;
|
|
1136
|
-
|
|
1165
|
+
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1166
|
+
await this.connectionTypeNewIRAccessory(device, accessory);
|
|
1137
1167
|
// create the accessory handler for the newly create accessory
|
|
1138
1168
|
// this is imported from `platformAccessory.ts`
|
|
1139
1169
|
new waterheaters_1.WaterHeater(this, accessory, device);
|
|
@@ -1160,7 +1190,8 @@ class SwitchBotPlatform {
|
|
|
1160
1190
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1161
1191
|
existingAccessory.displayName = device.deviceName;
|
|
1162
1192
|
existingAccessory.context.firmwareRevision = this.version;
|
|
1163
|
-
|
|
1193
|
+
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1194
|
+
await this.connectionTypeExistingIRAccessory(device, existingAccessory);
|
|
1164
1195
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
1165
1196
|
// create the accessory handler for the restored accessory
|
|
1166
1197
|
// this is imported from `platformAccessory.ts`
|
|
@@ -1182,7 +1213,8 @@ class SwitchBotPlatform {
|
|
|
1182
1213
|
accessory.context.model = device.remoteType;
|
|
1183
1214
|
accessory.context.deviceID = device.deviceId;
|
|
1184
1215
|
accessory.context.firmwareRevision = this.version;
|
|
1185
|
-
|
|
1216
|
+
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1217
|
+
await this.connectionTypeNewIRAccessory(device, accessory);
|
|
1186
1218
|
// create the accessory handler for the newly create accessory
|
|
1187
1219
|
// this is imported from `platformAccessory.ts`
|
|
1188
1220
|
new vacuumcleaners_1.VacuumCleaner(this, accessory, device);
|
|
@@ -1209,7 +1241,8 @@ class SwitchBotPlatform {
|
|
|
1209
1241
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1210
1242
|
existingAccessory.displayName = device.deviceName;
|
|
1211
1243
|
existingAccessory.context.firmwareRevision = this.version;
|
|
1212
|
-
|
|
1244
|
+
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1245
|
+
await this.connectionTypeExistingIRAccessory(device, existingAccessory);
|
|
1213
1246
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
1214
1247
|
// create the accessory handler for the restored accessory
|
|
1215
1248
|
// this is imported from `platformAccessory.ts`
|
|
@@ -1231,7 +1264,8 @@ class SwitchBotPlatform {
|
|
|
1231
1264
|
accessory.context.model = device.remoteType;
|
|
1232
1265
|
accessory.context.deviceID = device.deviceId;
|
|
1233
1266
|
accessory.context.firmwareRevision = this.version;
|
|
1234
|
-
|
|
1267
|
+
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1268
|
+
await this.connectionTypeNewIRAccessory(device, accessory);
|
|
1235
1269
|
// create the accessory handler for the newly create accessory
|
|
1236
1270
|
// this is imported from `platformAccessory.ts`
|
|
1237
1271
|
new cameras_1.Camera(this, accessory, device);
|
|
@@ -1258,7 +1292,8 @@ class SwitchBotPlatform {
|
|
|
1258
1292
|
existingAccessory.context.deviceID = device.deviceId;
|
|
1259
1293
|
existingAccessory.displayName = device.deviceName;
|
|
1260
1294
|
existingAccessory.context.firmwareRevision = this.version;
|
|
1261
|
-
|
|
1295
|
+
existingAccessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1296
|
+
await this.connectionTypeExistingIRAccessory(device, existingAccessory);
|
|
1262
1297
|
this.api.updatePlatformAccessories([existingAccessory]);
|
|
1263
1298
|
// create the accessory handler for the restored accessory
|
|
1264
1299
|
// this is imported from `platformAccessory.ts`
|
|
@@ -1280,7 +1315,8 @@ class SwitchBotPlatform {
|
|
|
1280
1315
|
accessory.context.model = device.remoteType;
|
|
1281
1316
|
accessory.context.deviceID = device.deviceId;
|
|
1282
1317
|
accessory.context.firmwareRevision = this.version;
|
|
1283
|
-
|
|
1318
|
+
accessory.context.deviceType = `IR: ${device.remoteType}`;
|
|
1319
|
+
await this.connectionTypeNewIRAccessory(device, accessory);
|
|
1284
1320
|
// create the accessory handler for the newly create accessory
|
|
1285
1321
|
// this is imported from `platformAccessory.ts`
|
|
1286
1322
|
new others_1.Others(this, accessory, device);
|
|
@@ -1309,6 +1345,12 @@ class SwitchBotPlatform {
|
|
|
1309
1345
|
existingAccessory.context.connectionType = 'OpenAPI';
|
|
1310
1346
|
}
|
|
1311
1347
|
}
|
|
1348
|
+
async connectionTypeNewIRAccessory(device, accessory) {
|
|
1349
|
+
accessory.context.connectionType = 'IR wirth OpenAPI';
|
|
1350
|
+
}
|
|
1351
|
+
async connectionTypeExistingIRAccessory(device, existingAccessory) {
|
|
1352
|
+
existingAccessory.context.connectionType = 'IR with OpenAPI';
|
|
1353
|
+
}
|
|
1312
1354
|
unregisterPlatformAccessories(existingAccessory) {
|
|
1313
1355
|
// remove platform accessories when no longer present
|
|
1314
1356
|
this.api.unregisterPlatformAccessories(settings_1.PLUGIN_NAME, settings_1.PLATFORM_NAME, [existingAccessory]);
|