@switchbot/homebridge-switchbot 3.1.1-beta.1 → 3.1.1-beta.3
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/CHANGELOG.md +0 -5
- package/dist/device/blindtilt.d.ts.map +1 -1
- package/dist/device/blindtilt.js +2 -6
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +2 -6
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +5 -15
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +5 -15
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +1 -3
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +2 -6
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/hub.d.ts.map +1 -1
- package/dist/device/hub.js +1 -3
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +4 -12
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.d.ts.map +1 -1
- package/dist/device/iosensor.js +1 -3
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.d.ts.map +1 -1
- package/dist/device/lightstrip.js +4 -12
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +2 -6
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +1 -3
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +1 -3
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +1 -3
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +2 -6
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +3 -9
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +1 -3
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +1 -3
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +1 -3
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +1 -3
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +1 -3
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +1 -3
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +1 -3
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +1 -3
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +1 -3
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +5 -11
- package/dist/platform.js.map +1 -1
- package/package.json +1 -3
- package/src/device/blindtilt.ts +2 -6
- package/src/device/bot.ts +2 -6
- package/src/device/ceilinglight.ts +5 -15
- package/src/device/colorbulb.ts +5 -15
- package/src/device/contact.ts +1 -3
- package/src/device/curtain.ts +2 -6
- package/src/device/hub.ts +1 -3
- package/src/device/humidifier.ts +4 -12
- package/src/device/iosensor.ts +1 -3
- package/src/device/lightstrip.ts +4 -12
- package/src/device/lock.ts +2 -6
- package/src/device/meter.ts +1 -3
- package/src/device/meterplus.ts +1 -3
- package/src/device/motion.ts +1 -3
- package/src/device/plug.ts +2 -6
- package/src/device/robotvacuumcleaner.ts +3 -9
- package/src/irdevice/airconditioner.ts +1 -3
- package/src/irdevice/airpurifier.ts +1 -3
- package/src/irdevice/camera.ts +1 -3
- package/src/irdevice/fan.ts +1 -3
- package/src/irdevice/light.ts +1 -3
- package/src/irdevice/other.ts +1 -3
- package/src/irdevice/tv.ts +1 -3
- package/src/irdevice/vacuumcleaner.ts +1 -3
- package/src/irdevice/waterheater.ts +1 -3
- package/src/platform.ts +5 -11
|
@@ -431,12 +431,10 @@ export class CeilingLight {
|
|
|
431
431
|
async openAPIRefreshStatus() {
|
|
432
432
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} openAPIRefreshStatus`);
|
|
433
433
|
try {
|
|
434
|
-
const { body, statusCode
|
|
434
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
435
435
|
headers: this.platform.generateHeaders(),
|
|
436
436
|
});
|
|
437
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
438
437
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
439
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
440
438
|
const deviceStatus: any = await body.json();
|
|
441
439
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
442
440
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -561,14 +559,12 @@ export class CeilingLight {
|
|
|
561
559
|
});
|
|
562
560
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
563
561
|
try {
|
|
564
|
-
const { body, statusCode
|
|
562
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
565
563
|
body: bodyChange,
|
|
566
564
|
method: 'POST',
|
|
567
565
|
headers: this.platform.generateHeaders(),
|
|
568
566
|
});
|
|
569
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
570
567
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
571
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
572
568
|
const deviceStatus: any = await body.json();
|
|
573
569
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
574
570
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -622,14 +618,12 @@ export class CeilingLight {
|
|
|
622
618
|
});
|
|
623
619
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
624
620
|
try {
|
|
625
|
-
const { body, statusCode
|
|
621
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
626
622
|
body: bodyChange,
|
|
627
623
|
method: 'POST',
|
|
628
624
|
headers: this.platform.generateHeaders(),
|
|
629
625
|
});
|
|
630
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
631
626
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
632
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
633
627
|
const deviceStatus: any = await body.json();
|
|
634
628
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
635
629
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -668,14 +662,12 @@ export class CeilingLight {
|
|
|
668
662
|
});
|
|
669
663
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
670
664
|
try {
|
|
671
|
-
const { body, statusCode
|
|
665
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
672
666
|
body: bodyChange,
|
|
673
667
|
method: 'POST',
|
|
674
668
|
headers: this.platform.generateHeaders(),
|
|
675
669
|
});
|
|
676
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
677
670
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
678
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
679
671
|
const deviceStatus: any = await body.json();
|
|
680
672
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
681
673
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -712,14 +704,12 @@ export class CeilingLight {
|
|
|
712
704
|
});
|
|
713
705
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
714
706
|
try {
|
|
715
|
-
const { body, statusCode
|
|
707
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
716
708
|
body: bodyChange,
|
|
717
709
|
method: 'POST',
|
|
718
710
|
headers: this.platform.generateHeaders(),
|
|
719
711
|
});
|
|
720
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
721
712
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
722
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
723
713
|
const deviceStatus: any = await body.json();
|
|
724
714
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
725
715
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
package/src/device/colorbulb.ts
CHANGED
|
@@ -478,12 +478,10 @@ export class ColorBulb {
|
|
|
478
478
|
async openAPIRefreshStatus() {
|
|
479
479
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} openAPIRefreshStatus`);
|
|
480
480
|
try {
|
|
481
|
-
const { body, statusCode
|
|
481
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
482
482
|
headers: this.platform.generateHeaders(),
|
|
483
483
|
});
|
|
484
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
485
484
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
486
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
487
485
|
const deviceStatus: any = await body.json();
|
|
488
486
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
489
487
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -744,14 +742,12 @@ export class ColorBulb {
|
|
|
744
742
|
});
|
|
745
743
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
746
744
|
try {
|
|
747
|
-
const { body, statusCode
|
|
745
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
748
746
|
body: bodyChange,
|
|
749
747
|
method: 'POST',
|
|
750
748
|
headers: this.platform.generateHeaders(),
|
|
751
749
|
});
|
|
752
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
753
750
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
754
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
755
751
|
const deviceStatus: any = await body.json();
|
|
756
752
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
757
753
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -805,14 +801,12 @@ export class ColorBulb {
|
|
|
805
801
|
});
|
|
806
802
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
807
803
|
try {
|
|
808
|
-
const { body, statusCode
|
|
804
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
809
805
|
body: bodyChange,
|
|
810
806
|
method: 'POST',
|
|
811
807
|
headers: this.platform.generateHeaders(),
|
|
812
808
|
});
|
|
813
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
814
809
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
815
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
816
810
|
const deviceStatus: any = await body.json();
|
|
817
811
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
818
812
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -851,14 +845,12 @@ export class ColorBulb {
|
|
|
851
845
|
});
|
|
852
846
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
853
847
|
try {
|
|
854
|
-
const { body, statusCode
|
|
848
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
855
849
|
body: bodyChange,
|
|
856
850
|
method: 'POST',
|
|
857
851
|
headers: this.platform.generateHeaders(),
|
|
858
852
|
});
|
|
859
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
860
853
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
861
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
862
854
|
const deviceStatus: any = await body.json();
|
|
863
855
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
864
856
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -895,14 +887,12 @@ export class ColorBulb {
|
|
|
895
887
|
});
|
|
896
888
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
897
889
|
try {
|
|
898
|
-
const { body, statusCode
|
|
890
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
899
891
|
body: bodyChange,
|
|
900
892
|
method: 'POST',
|
|
901
893
|
headers: this.platform.generateHeaders(),
|
|
902
894
|
});
|
|
903
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
904
895
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
905
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
906
896
|
const deviceStatus: any = await body.json();
|
|
907
897
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
908
898
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
package/src/device/contact.ts
CHANGED
|
@@ -411,12 +411,10 @@ export class Contact {
|
|
|
411
411
|
async openAPIRefreshStatus(): Promise<void> {
|
|
412
412
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} openAPIRefreshStatus`);
|
|
413
413
|
try {
|
|
414
|
-
const { body, statusCode
|
|
414
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
415
415
|
headers: this.platform.generateHeaders(),
|
|
416
416
|
});
|
|
417
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
418
417
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
419
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
420
418
|
const deviceStatus: any = await body.json();
|
|
421
419
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
422
420
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
package/src/device/curtain.ts
CHANGED
|
@@ -609,12 +609,10 @@ export class Curtain {
|
|
|
609
609
|
async openAPIRefreshStatus(): Promise<void> {
|
|
610
610
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} openAPIRefreshStatus`);
|
|
611
611
|
try {
|
|
612
|
-
const { body, statusCode
|
|
612
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
613
613
|
headers: this.platform.generateHeaders(),
|
|
614
614
|
});
|
|
615
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
616
615
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
617
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
618
616
|
const deviceStatus: any = await body.json();
|
|
619
617
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
620
618
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -774,14 +772,12 @@ export class Curtain {
|
|
|
774
772
|
});
|
|
775
773
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
776
774
|
try {
|
|
777
|
-
const { body, statusCode
|
|
775
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
778
776
|
body: bodyChange,
|
|
779
777
|
method: 'POST',
|
|
780
778
|
headers: this.platform.generateHeaders(),
|
|
781
779
|
});
|
|
782
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
783
780
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
784
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
785
781
|
const deviceStatus: any = await body.json();
|
|
786
782
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
787
783
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
package/src/device/hub.ts
CHANGED
|
@@ -428,12 +428,10 @@ export class Hub {
|
|
|
428
428
|
async openAPIRefreshStatus(): Promise<void> {
|
|
429
429
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} openAPIRefreshStatus`);
|
|
430
430
|
try {
|
|
431
|
-
const { body, statusCode
|
|
431
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
432
432
|
headers: this.platform.generateHeaders(),
|
|
433
433
|
});
|
|
434
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
435
434
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
436
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
437
435
|
const deviceStatus: any = await body.json();
|
|
438
436
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
439
437
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
package/src/device/humidifier.ts
CHANGED
|
@@ -402,12 +402,10 @@ export class Humidifier {
|
|
|
402
402
|
async openAPIRefreshStatus(): Promise<void> {
|
|
403
403
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} openAPIRefreshStatus`);
|
|
404
404
|
try {
|
|
405
|
-
const { body, statusCode
|
|
405
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
406
406
|
headers: this.platform.generateHeaders(),
|
|
407
407
|
});
|
|
408
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
409
408
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
410
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
411
409
|
const deviceStatus: any = await body.json();
|
|
412
410
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
413
411
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -506,14 +504,12 @@ export class Humidifier {
|
|
|
506
504
|
});
|
|
507
505
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
508
506
|
try {
|
|
509
|
-
const { body, statusCode
|
|
507
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
510
508
|
body: bodyChange,
|
|
511
509
|
method: 'POST',
|
|
512
510
|
headers: this.platform.generateHeaders(),
|
|
513
511
|
});
|
|
514
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
515
512
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
516
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
517
513
|
const deviceStatus: any = await body.json();
|
|
518
514
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
519
515
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -559,14 +555,12 @@ export class Humidifier {
|
|
|
559
555
|
});
|
|
560
556
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
561
557
|
try {
|
|
562
|
-
const { body, statusCode
|
|
558
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
563
559
|
body: bodyChange,
|
|
564
560
|
method: 'POST',
|
|
565
561
|
headers: this.platform.generateHeaders(),
|
|
566
562
|
});
|
|
567
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
568
563
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
569
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
570
564
|
const deviceStatus: any = await body.json();
|
|
571
565
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
572
566
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -607,14 +601,12 @@ export class Humidifier {
|
|
|
607
601
|
});
|
|
608
602
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
609
603
|
try {
|
|
610
|
-
const { body, statusCode
|
|
604
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
611
605
|
body: bodyChange,
|
|
612
606
|
method: 'POST',
|
|
613
607
|
headers: this.platform.generateHeaders(),
|
|
614
608
|
});
|
|
615
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
616
609
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
617
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
618
610
|
const deviceStatus: any = await body.json();
|
|
619
611
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
620
612
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
package/src/device/iosensor.ts
CHANGED
|
@@ -381,12 +381,10 @@ export class IOSensor {
|
|
|
381
381
|
async openAPIRefreshStatus(): Promise<void> {
|
|
382
382
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} openAPIRefreshStatus`);
|
|
383
383
|
try {
|
|
384
|
-
const { body, statusCode
|
|
384
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
385
385
|
headers: this.platform.generateHeaders(),
|
|
386
386
|
});
|
|
387
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
388
387
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
389
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
390
388
|
const deviceStatus: any = await body.json();
|
|
391
389
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
392
390
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
package/src/device/lightstrip.ts
CHANGED
|
@@ -417,12 +417,10 @@ export class StripLight {
|
|
|
417
417
|
async openAPIRefreshStatus(): Promise<void> {
|
|
418
418
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} openAPIRefreshStatus`);
|
|
419
419
|
try {
|
|
420
|
-
const { body, statusCode
|
|
420
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
421
421
|
headers: this.platform.generateHeaders(),
|
|
422
422
|
});
|
|
423
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
424
423
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
425
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
426
424
|
const deviceStatus: any = await body.json();
|
|
427
425
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
428
426
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -638,14 +636,12 @@ export class StripLight {
|
|
|
638
636
|
});
|
|
639
637
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
640
638
|
try {
|
|
641
|
-
const { body, statusCode
|
|
639
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
642
640
|
body: bodyChange,
|
|
643
641
|
method: 'POST',
|
|
644
642
|
headers: this.platform.generateHeaders(),
|
|
645
643
|
});
|
|
646
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
647
644
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
648
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
649
645
|
const deviceStatus: any = await body.json();
|
|
650
646
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
651
647
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -696,14 +692,12 @@ export class StripLight {
|
|
|
696
692
|
});
|
|
697
693
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
698
694
|
try {
|
|
699
|
-
const { body, statusCode
|
|
695
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
700
696
|
body: bodyChange,
|
|
701
697
|
method: 'POST',
|
|
702
698
|
headers: this.platform.generateHeaders(),
|
|
703
699
|
});
|
|
704
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
705
700
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
706
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
707
701
|
const deviceStatus: any = await body.json();
|
|
708
702
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
709
703
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -740,14 +734,12 @@ export class StripLight {
|
|
|
740
734
|
});
|
|
741
735
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
742
736
|
try {
|
|
743
|
-
const { body, statusCode
|
|
737
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
744
738
|
body: bodyChange,
|
|
745
739
|
method: 'POST',
|
|
746
740
|
headers: this.platform.generateHeaders(),
|
|
747
741
|
});
|
|
748
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
749
742
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
750
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
751
743
|
const deviceStatus: any = await body.json();
|
|
752
744
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
753
745
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
package/src/device/lock.ts
CHANGED
|
@@ -440,12 +440,10 @@ export class Lock {
|
|
|
440
440
|
async openAPIRefreshStatus(): Promise<void> {
|
|
441
441
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} openAPIRefreshStatus`);
|
|
442
442
|
try {
|
|
443
|
-
const { body, statusCode
|
|
443
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
444
444
|
headers: this.platform.generateHeaders(),
|
|
445
445
|
});
|
|
446
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
447
446
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
448
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
449
447
|
const deviceStatus: any = await body.json();
|
|
450
448
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
451
449
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -558,14 +556,12 @@ export class Lock {
|
|
|
558
556
|
});
|
|
559
557
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
560
558
|
try {
|
|
561
|
-
const { body, statusCode
|
|
559
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
562
560
|
body: bodyChange,
|
|
563
561
|
method: 'POST',
|
|
564
562
|
headers: this.platform.generateHeaders(),
|
|
565
563
|
});
|
|
566
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
567
564
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
568
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
569
565
|
const deviceStatus: any = await body.json();
|
|
570
566
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
571
567
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
package/src/device/meter.ts
CHANGED
|
@@ -370,12 +370,10 @@ export class Meter {
|
|
|
370
370
|
async openAPIRefreshStatus(): Promise<void> {
|
|
371
371
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} openAPIRefreshStatus`);
|
|
372
372
|
try {
|
|
373
|
-
const { body, statusCode
|
|
373
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
374
374
|
headers: this.platform.generateHeaders(),
|
|
375
375
|
});
|
|
376
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
377
376
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
378
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
379
377
|
const deviceStatus: any = await body.json();
|
|
380
378
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
381
379
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
package/src/device/meterplus.ts
CHANGED
|
@@ -372,12 +372,10 @@ export class MeterPlus {
|
|
|
372
372
|
async openAPIRefreshStatus(): Promise<void> {
|
|
373
373
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} openAPIRefreshStatus`);
|
|
374
374
|
try {
|
|
375
|
-
const { body, statusCode
|
|
375
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
376
376
|
headers: this.platform.generateHeaders(),
|
|
377
377
|
});
|
|
378
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
379
378
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
380
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
381
379
|
const deviceStatus: any = await body.json();
|
|
382
380
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
383
381
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
package/src/device/motion.ts
CHANGED
|
@@ -365,12 +365,10 @@ export class Motion {
|
|
|
365
365
|
async openAPIRefreshStatus(): Promise<void> {
|
|
366
366
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} openAPIRefreshStatus`);
|
|
367
367
|
try {
|
|
368
|
-
const { body, statusCode
|
|
368
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
369
369
|
headers: this.platform.generateHeaders(),
|
|
370
370
|
});
|
|
371
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
372
371
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
373
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
374
372
|
const deviceStatus: any = await body.json();
|
|
375
373
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
376
374
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
package/src/device/plug.ts
CHANGED
|
@@ -273,12 +273,10 @@ export class Plug {
|
|
|
273
273
|
async openAPIRefreshStatus() {
|
|
274
274
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} openAPIRefreshStatus`);
|
|
275
275
|
try {
|
|
276
|
-
const { body, statusCode
|
|
276
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
277
277
|
headers: this.platform.generateHeaders(),
|
|
278
278
|
});
|
|
279
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
280
279
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
281
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
282
280
|
const deviceStatus: any = await body.json();
|
|
283
281
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
284
282
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -398,14 +396,12 @@ export class Plug {
|
|
|
398
396
|
});
|
|
399
397
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
400
398
|
try {
|
|
401
|
-
const { body, statusCode
|
|
399
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
402
400
|
body: bodyChange,
|
|
403
401
|
method: 'POST',
|
|
404
402
|
headers: this.platform.generateHeaders(),
|
|
405
403
|
});
|
|
406
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
407
404
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
408
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
409
405
|
const deviceStatus: any = await body.json();
|
|
410
406
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
411
407
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -320,12 +320,10 @@ export class RobotVacuumCleaner {
|
|
|
320
320
|
async openAPIRefreshStatus() {
|
|
321
321
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} openAPIRefreshStatus`);
|
|
322
322
|
try {
|
|
323
|
-
const { body, statusCode
|
|
323
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
324
324
|
headers: this.platform.generateHeaders(),
|
|
325
325
|
});
|
|
326
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
327
326
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
328
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
329
327
|
const deviceStatus: any = await body.json();
|
|
330
328
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
331
329
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -446,14 +444,12 @@ export class RobotVacuumCleaner {
|
|
|
446
444
|
});
|
|
447
445
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
448
446
|
try {
|
|
449
|
-
const { body, statusCode
|
|
447
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
450
448
|
body: bodyChange,
|
|
451
449
|
method: 'POST',
|
|
452
450
|
headers: this.platform.generateHeaders(),
|
|
453
451
|
});
|
|
454
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
455
452
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
456
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
457
453
|
const deviceStatus: any = await body.json();
|
|
458
454
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
459
455
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -486,13 +482,11 @@ export class RobotVacuumCleaner {
|
|
|
486
482
|
const body = await this.brightnessCommands();
|
|
487
483
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${body},`);
|
|
488
484
|
try {
|
|
489
|
-
const { body, statusCode
|
|
485
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
490
486
|
method: 'POST',
|
|
491
487
|
headers: this.platform.generateHeaders(),
|
|
492
488
|
});
|
|
493
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
494
489
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
495
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
496
490
|
const deviceStatus: any = await body.json();
|
|
497
491
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
498
492
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -259,14 +259,12 @@ export class AirConditioner {
|
|
|
259
259
|
if (this.device.connectionType === 'OpenAPI' && !this.disablePushDetail) {
|
|
260
260
|
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
261
261
|
try {
|
|
262
|
-
const { body, statusCode
|
|
262
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
263
263
|
body: bodyChange,
|
|
264
264
|
method: 'POST',
|
|
265
265
|
headers: this.platform.generateHeaders(),
|
|
266
266
|
});
|
|
267
|
-
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
268
267
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
269
|
-
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
270
268
|
const deviceStatus: any = await body.json();
|
|
271
269
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
272
270
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
@@ -215,14 +215,12 @@ export class AirPurifier {
|
|
|
215
215
|
if (this.device.connectionType === 'OpenAPI') {
|
|
216
216
|
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
217
217
|
try {
|
|
218
|
-
const { body, statusCode
|
|
218
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
219
219
|
body: bodyChange,
|
|
220
220
|
method: 'POST',
|
|
221
221
|
headers: this.platform.generateHeaders(),
|
|
222
222
|
});
|
|
223
|
-
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
224
223
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
225
|
-
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
226
224
|
const deviceStatus: any = await body.json();
|
|
227
225
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
228
226
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
package/src/irdevice/camera.ts
CHANGED
|
@@ -120,14 +120,12 @@ export class Camera {
|
|
|
120
120
|
if (this.device.connectionType === 'OpenAPI') {
|
|
121
121
|
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
122
122
|
try {
|
|
123
|
-
const { body, statusCode
|
|
123
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
124
124
|
body: bodyChange,
|
|
125
125
|
method: 'POST',
|
|
126
126
|
headers: this.platform.generateHeaders(),
|
|
127
127
|
});
|
|
128
|
-
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
129
128
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
130
|
-
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
131
129
|
const deviceStatus: any = await body.json();
|
|
132
130
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
133
131
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
package/src/irdevice/fan.ts
CHANGED
|
@@ -237,14 +237,12 @@ export class Fan {
|
|
|
237
237
|
if (this.device.connectionType === 'OpenAPI') {
|
|
238
238
|
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
239
239
|
try {
|
|
240
|
-
const { body, statusCode
|
|
240
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
241
241
|
body: bodyChange,
|
|
242
242
|
method: 'POST',
|
|
243
243
|
headers: this.platform.generateHeaders(),
|
|
244
244
|
});
|
|
245
|
-
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
246
245
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
247
|
-
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
248
246
|
const deviceStatus: any = await body.json();
|
|
249
247
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
250
248
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
package/src/irdevice/light.ts
CHANGED
|
@@ -235,14 +235,12 @@ export class Light {
|
|
|
235
235
|
if (this.device.connectionType === 'OpenAPI') {
|
|
236
236
|
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
237
237
|
try {
|
|
238
|
-
const { body, statusCode
|
|
238
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
239
239
|
body: bodyChange,
|
|
240
240
|
method: 'POST',
|
|
241
241
|
headers: this.platform.generateHeaders(),
|
|
242
242
|
});
|
|
243
|
-
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
244
243
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
245
|
-
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
246
244
|
const deviceStatus: any = await body.json();
|
|
247
245
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
248
246
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
package/src/irdevice/other.ts
CHANGED
|
@@ -427,14 +427,12 @@ export class Others {
|
|
|
427
427
|
if (this.device.connectionType === 'OpenAPI') {
|
|
428
428
|
this.infoLog(`${this.device.remoteType}: ${this.accessory.displayName} Sending request to SwitchBot API, body: ${bodyChange},`);
|
|
429
429
|
try {
|
|
430
|
-
const { body, statusCode
|
|
430
|
+
const { body, statusCode } = await request(`${Devices}/${this.device.deviceId}/commands`, {
|
|
431
431
|
body: bodyChange,
|
|
432
432
|
method: 'POST',
|
|
433
433
|
headers: this.platform.generateHeaders(),
|
|
434
434
|
});
|
|
435
|
-
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
436
435
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
437
|
-
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
438
436
|
const deviceStatus: any = await body.json();
|
|
439
437
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
440
438
|
this.debugWarnLog(`${this.device.remoteType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|