@switchbot/homebridge-switchbot 2.8.1-beta.17 → 2.8.1-beta.19
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/dist/device/blindtilt.d.ts.map +1 -1
- package/dist/device/blindtilt.js +37 -16
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.js +10 -10
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +78 -24
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +36 -5
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +22 -12
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +36 -15
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/hub.d.ts.map +1 -1
- package/dist/device/hub.js +21 -11
- package/dist/device/hub.js.map +1 -1
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +66 -23
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.d.ts.map +1 -1
- package/dist/device/iosensor.js +21 -11
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.d.ts.map +1 -1
- package/dist/device/lightstrip.js +63 -20
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +35 -14
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +21 -11
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +21 -11
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +21 -11
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +32 -11
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +48 -16
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +15 -4
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +15 -4
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +15 -4
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +15 -4
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +16 -5
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +15 -4
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +15 -4
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +15 -4
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +15 -4
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +18 -3
- package/dist/platform.js.map +1 -1
- package/package.json +1 -1
- package/src/device/blindtilt.ts +35 -16
- package/src/device/bot.ts +11 -11
- package/src/device/ceilinglight.ts +73 -24
- package/src/device/colorbulb.ts +32 -5
- package/src/device/contact.ts +21 -12
- package/src/device/curtain.ts +34 -15
- package/src/device/hub.ts +20 -11
- package/src/device/humidifier.ts +62 -23
- package/src/device/iosensor.ts +20 -11
- package/src/device/lightstrip.ts +59 -20
- package/src/device/lock.ts +33 -14
- package/src/device/meter.ts +20 -11
- package/src/device/meterplus.ts +20 -11
- package/src/device/motion.ts +20 -11
- package/src/device/plug.ts +30 -11
- package/src/device/robotvacuumcleaner.ts +45 -16
- package/src/irdevice/airconditioner.ts +14 -4
- package/src/irdevice/airpurifier.ts +14 -4
- package/src/irdevice/camera.ts +14 -4
- package/src/irdevice/fan.ts +14 -4
- package/src/irdevice/light.ts +15 -5
- package/src/irdevice/other.ts +14 -4
- package/src/irdevice/tv.ts +14 -4
- package/src/irdevice/vacuumcleaner.ts +14 -4
- package/src/irdevice/waterheater.ts +14 -4
- package/src/platform.ts +15 -3
package/src/device/blindtilt.ts
CHANGED
|
@@ -526,19 +526,28 @@ export class BlindTilt {
|
|
|
526
526
|
const { body, statusCode, headers } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
527
527
|
headers: this.platform.generateHeaders(),
|
|
528
528
|
});
|
|
529
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
530
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
531
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
529
532
|
const deviceStatus: any = await body.json();
|
|
530
|
-
this.
|
|
531
|
-
this.
|
|
532
|
-
this.
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
533
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
534
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
535
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
536
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
537
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
538
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
539
|
+
this.OpenAPI_CurrentPosition = deviceStatus.body.slidePosition;
|
|
540
|
+
this.OpenAPI_Direction = deviceStatus.body.direction;
|
|
541
|
+
this.OpenAPI_InMotion = deviceStatus.body.moving;
|
|
542
|
+
this.OpenAPI_CurrentAmbientLightLevel = deviceStatus.body.brightness;
|
|
543
|
+
this.OpenAPI_BatteryLevel = deviceStatus.body.battery;
|
|
544
|
+
this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
|
|
545
|
+
this.openAPIparseStatus();
|
|
546
|
+
this.updateHomeKitCharacteristics();
|
|
547
|
+
} else {
|
|
548
|
+
this.statusCode(statusCode);
|
|
549
|
+
this.statusCode(deviceStatus.statusCode);
|
|
550
|
+
}
|
|
542
551
|
} catch (e: any) {
|
|
543
552
|
this.apiError(e);
|
|
544
553
|
this.errorLog(
|
|
@@ -674,10 +683,20 @@ export class BlindTilt {
|
|
|
674
683
|
method: 'POST',
|
|
675
684
|
headers: this.platform.generateHeaders(),
|
|
676
685
|
});
|
|
686
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
687
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
688
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
677
689
|
const deviceStatus: any = await body.json();
|
|
678
|
-
this.
|
|
679
|
-
this.
|
|
680
|
-
this.
|
|
690
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
691
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
692
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
693
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
694
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
695
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
696
|
+
} else {
|
|
697
|
+
this.statusCode(statusCode);
|
|
698
|
+
this.statusCode(deviceStatus.statusCode);
|
|
699
|
+
}
|
|
681
700
|
} catch (e: any) {
|
|
682
701
|
this.apiError(e);
|
|
683
702
|
this.errorLog(
|
|
@@ -863,7 +882,7 @@ export class BlindTilt {
|
|
|
863
882
|
this.accessory.getService(this.platform.Service.AccessoryInformation)!
|
|
864
883
|
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.OpenAPI_FirmwareRevision);
|
|
865
884
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
866
|
-
+ `updateCharacteristic
|
|
885
|
+
+ `updateCharacteristic FirmwareRevision: ${this.OpenAPI_FirmwareRevision}`);
|
|
867
886
|
}
|
|
868
887
|
}
|
|
869
888
|
|
package/src/device/bot.ts
CHANGED
|
@@ -725,7 +725,7 @@ export class Bot {
|
|
|
725
725
|
headers: this.platform.generateHeaders(),
|
|
726
726
|
});
|
|
727
727
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
728
|
-
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${
|
|
728
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
729
729
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
730
730
|
const deviceStatus: any = await body.json();
|
|
731
731
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
@@ -733,19 +733,19 @@ export class Bot {
|
|
|
733
733
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
734
734
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
735
735
|
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
736
|
-
|
|
737
|
-
if (this.device.bot?.mode === 'multipress') {
|
|
738
|
-
this.multiPressCount--;
|
|
739
|
-
if (this.multiPressCount > 0) {
|
|
740
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Multi Press Count: ${this.multiPressCount}`);
|
|
741
|
-
this.On = true;
|
|
742
|
-
this.openAPIpushChanges();
|
|
743
|
-
}
|
|
744
|
-
}
|
|
736
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
745
737
|
} else {
|
|
746
738
|
this.statusCode(statusCode);
|
|
747
739
|
this.statusCode(deviceStatus.statusCode);
|
|
748
740
|
}
|
|
741
|
+
if (this.device.bot?.mode === 'multipress') {
|
|
742
|
+
this.multiPressCount--;
|
|
743
|
+
if (this.multiPressCount > 0) {
|
|
744
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Multi Press Count: ${this.multiPressCount}`);
|
|
745
|
+
this.On = true;
|
|
746
|
+
this.openAPIpushChanges();
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
749
|
} catch (e: any) {
|
|
750
750
|
this.apiError(e);
|
|
751
751
|
this.errorLog(
|
|
@@ -1031,7 +1031,7 @@ export class Bot {
|
|
|
1031
1031
|
this.accessory.getService(this.platform.Service.AccessoryInformation)!
|
|
1032
1032
|
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.OpenAPI_FirmwareRevision);
|
|
1033
1033
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
1034
|
-
+ `updateCharacteristic
|
|
1034
|
+
+ `updateCharacteristic FirmwareRevision: ${this.OpenAPI_FirmwareRevision}`);
|
|
1035
1035
|
}
|
|
1036
1036
|
}
|
|
1037
1037
|
|
|
@@ -402,18 +402,27 @@ export class CeilingLight {
|
|
|
402
402
|
const { body, statusCode, headers } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
403
403
|
headers: this.platform.generateHeaders(),
|
|
404
404
|
});
|
|
405
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
406
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
407
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
405
408
|
const deviceStatus: any = await body.json();
|
|
406
|
-
this.
|
|
407
|
-
this.
|
|
408
|
-
this.
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
409
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
410
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
411
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
412
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
413
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
414
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
415
|
+
this.OpenAPI_On = deviceStatus.body.power;
|
|
416
|
+
this.OpenAPI_RGB = deviceStatus.body.color;
|
|
417
|
+
this.OpenAPI_Brightness = deviceStatus.body.brightness;
|
|
418
|
+
this.OpenAPI_ColorTemperature = deviceStatus.body.colorTemperature;
|
|
419
|
+
this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
|
|
420
|
+
this.openAPIparseStatus();
|
|
421
|
+
this.updateHomeKitCharacteristics();
|
|
422
|
+
} else {
|
|
423
|
+
this.statusCode(statusCode);
|
|
424
|
+
this.statusCode(deviceStatus.statusCode);
|
|
425
|
+
}
|
|
417
426
|
} catch (e: any) {
|
|
418
427
|
this.apiError(e);
|
|
419
428
|
this.errorLog(
|
|
@@ -525,10 +534,20 @@ export class CeilingLight {
|
|
|
525
534
|
method: 'POST',
|
|
526
535
|
headers: this.platform.generateHeaders(),
|
|
527
536
|
});
|
|
537
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
538
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
539
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
528
540
|
const deviceStatus: any = await body.json();
|
|
529
|
-
this.
|
|
530
|
-
this.
|
|
531
|
-
this.
|
|
541
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
542
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
543
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
544
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
545
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
546
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
547
|
+
} else {
|
|
548
|
+
this.statusCode(statusCode);
|
|
549
|
+
this.statusCode(deviceStatus.statusCode);
|
|
550
|
+
}
|
|
532
551
|
} catch (e: any) {
|
|
533
552
|
this.apiError(e);
|
|
534
553
|
this.errorLog(
|
|
@@ -576,10 +595,20 @@ export class CeilingLight {
|
|
|
576
595
|
method: 'POST',
|
|
577
596
|
headers: this.platform.generateHeaders(),
|
|
578
597
|
});
|
|
598
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
599
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
600
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
579
601
|
const deviceStatus: any = await body.json();
|
|
580
|
-
this.
|
|
581
|
-
this.
|
|
582
|
-
this.
|
|
602
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
603
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
604
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
605
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
606
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
607
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
608
|
+
} else {
|
|
609
|
+
this.statusCode(statusCode);
|
|
610
|
+
this.statusCode(deviceStatus.statusCode);
|
|
611
|
+
}
|
|
583
612
|
} catch (e: any) {
|
|
584
613
|
this.apiError(e);
|
|
585
614
|
this.errorLog(
|
|
@@ -612,10 +641,20 @@ export class CeilingLight {
|
|
|
612
641
|
method: 'POST',
|
|
613
642
|
headers: this.platform.generateHeaders(),
|
|
614
643
|
});
|
|
644
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
645
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
646
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
615
647
|
const deviceStatus: any = await body.json();
|
|
616
|
-
this.
|
|
617
|
-
this.
|
|
618
|
-
this.
|
|
648
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
649
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
650
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
651
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
652
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
653
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
654
|
+
} else {
|
|
655
|
+
this.statusCode(statusCode);
|
|
656
|
+
this.statusCode(deviceStatus.statusCode);
|
|
657
|
+
}
|
|
619
658
|
} catch (e: any) {
|
|
620
659
|
this.apiError(e);
|
|
621
660
|
this.errorLog(
|
|
@@ -646,10 +685,20 @@ export class CeilingLight {
|
|
|
646
685
|
method: 'POST',
|
|
647
686
|
headers: this.platform.generateHeaders(),
|
|
648
687
|
});
|
|
688
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
689
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
690
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
649
691
|
const deviceStatus: any = await body.json();
|
|
650
|
-
this.
|
|
651
|
-
this.
|
|
652
|
-
this.
|
|
692
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
693
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
694
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
695
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
696
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
697
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
698
|
+
} else {
|
|
699
|
+
this.statusCode(statusCode);
|
|
700
|
+
this.statusCode(deviceStatus.statusCode);
|
|
701
|
+
}
|
|
653
702
|
} catch (e: any) {
|
|
654
703
|
this.apiError(e);
|
|
655
704
|
this.errorLog(
|
|
@@ -807,7 +856,7 @@ export class CeilingLight {
|
|
|
807
856
|
this.accessory.getService(this.platform.Service.AccessoryInformation)!
|
|
808
857
|
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.OpenAPI_FirmwareRevision);
|
|
809
858
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
810
|
-
+ `updateCharacteristic
|
|
859
|
+
+ `updateCharacteristic FirmwareRevision: ${this.OpenAPI_FirmwareRevision}`);
|
|
811
860
|
}
|
|
812
861
|
}
|
|
813
862
|
|
package/src/device/colorbulb.ts
CHANGED
|
@@ -437,6 +437,8 @@ export class ColorBulb {
|
|
|
437
437
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
438
438
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
439
439
|
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
440
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
441
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
440
442
|
this.OpenAPI_On = deviceStatus.body.power;
|
|
441
443
|
this.OpenAPI_RGB = deviceStatus.body.color;
|
|
442
444
|
this.OpenAPI_Brightness = deviceStatus.body.brightness;
|
|
@@ -445,6 +447,7 @@ export class ColorBulb {
|
|
|
445
447
|
this.openAPIparseStatus();
|
|
446
448
|
this.updateHomeKitCharacteristics();
|
|
447
449
|
} else {
|
|
450
|
+
this.statusCode(statusCode);
|
|
448
451
|
this.statusCode(deviceStatus.statusCode);
|
|
449
452
|
}
|
|
450
453
|
} catch (e: any) {
|
|
@@ -701,7 +704,13 @@ export class ColorBulb {
|
|
|
701
704
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
702
705
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
703
706
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
704
|
-
|
|
707
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
708
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
709
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
710
|
+
} else {
|
|
711
|
+
this.statusCode(statusCode);
|
|
712
|
+
this.statusCode(deviceStatus.statusCode);
|
|
713
|
+
}
|
|
705
714
|
} catch (e: any) {
|
|
706
715
|
this.apiError(e);
|
|
707
716
|
this.errorLog(
|
|
@@ -756,7 +765,13 @@ export class ColorBulb {
|
|
|
756
765
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
757
766
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
758
767
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
759
|
-
|
|
768
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
769
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
770
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
771
|
+
} else {
|
|
772
|
+
this.statusCode(statusCode);
|
|
773
|
+
this.statusCode(deviceStatus.statusCode);
|
|
774
|
+
}
|
|
760
775
|
} catch (e: any) {
|
|
761
776
|
this.apiError(e);
|
|
762
777
|
this.errorLog(
|
|
@@ -796,7 +811,13 @@ export class ColorBulb {
|
|
|
796
811
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
797
812
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
798
813
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
799
|
-
|
|
814
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
815
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
816
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
817
|
+
} else {
|
|
818
|
+
this.statusCode(statusCode);
|
|
819
|
+
this.statusCode(deviceStatus.statusCode);
|
|
820
|
+
}
|
|
800
821
|
} catch (e: any) {
|
|
801
822
|
this.apiError(e);
|
|
802
823
|
this.errorLog(
|
|
@@ -834,7 +855,13 @@ export class ColorBulb {
|
|
|
834
855
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
835
856
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
836
857
|
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
837
|
-
|
|
858
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
859
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
860
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
861
|
+
} else {
|
|
862
|
+
this.statusCode(statusCode);
|
|
863
|
+
this.statusCode(deviceStatus.statusCode);
|
|
864
|
+
}
|
|
838
865
|
} catch (e: any) {
|
|
839
866
|
this.apiError(e);
|
|
840
867
|
this.errorLog(
|
|
@@ -992,7 +1019,7 @@ export class ColorBulb {
|
|
|
992
1019
|
this.accessory.getService(this.platform.Service.AccessoryInformation)!
|
|
993
1020
|
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.OpenAPI_FirmwareRevision);
|
|
994
1021
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
995
|
-
+ `updateCharacteristic
|
|
1022
|
+
+ `updateCharacteristic FirmwareRevision: ${this.OpenAPI_FirmwareRevision}`);
|
|
996
1023
|
}
|
|
997
1024
|
}
|
|
998
1025
|
|
package/src/device/contact.ts
CHANGED
|
@@ -382,18 +382,27 @@ export class Contact {
|
|
|
382
382
|
const { body, statusCode, headers } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
383
383
|
headers: this.platform.generateHeaders(),
|
|
384
384
|
});
|
|
385
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
386
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
387
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
385
388
|
const deviceStatus: any = await body.json();
|
|
386
|
-
this.
|
|
387
|
-
this.
|
|
388
|
-
this.
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
389
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
390
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
391
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
392
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
393
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
394
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
395
|
+
this.OpenAPI_ContactSensorState = deviceStatus.body.openState;
|
|
396
|
+
this.OpenAPI_MotionDetected = deviceStatus.body.moveDetected;
|
|
397
|
+
this.OpenAPI_CurrentAmbientLightLevel = deviceStatus.body.brightness;
|
|
398
|
+
this.OpenAPI_BatteryLevel = deviceStatus.body.battery;
|
|
399
|
+
this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
|
|
400
|
+
this.openAPIparseStatus();
|
|
401
|
+
this.updateHomeKitCharacteristics();
|
|
402
|
+
} else {
|
|
403
|
+
this.statusCode(statusCode);
|
|
404
|
+
this.statusCode(deviceStatus.statusCode);
|
|
405
|
+
}
|
|
397
406
|
} catch (e: any) {
|
|
398
407
|
this.apiError(e);
|
|
399
408
|
this.errorLog(
|
|
@@ -457,7 +466,7 @@ export class Contact {
|
|
|
457
466
|
this.accessory.getService(this.platform.Service.AccessoryInformation)!
|
|
458
467
|
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.OpenAPI_FirmwareRevision);
|
|
459
468
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
460
|
-
+ `updateCharacteristic
|
|
469
|
+
+ `updateCharacteristic FirmwareRevision: ${this.OpenAPI_FirmwareRevision}`);
|
|
461
470
|
}
|
|
462
471
|
}
|
|
463
472
|
|
package/src/device/curtain.ts
CHANGED
|
@@ -550,18 +550,27 @@ export class Curtain {
|
|
|
550
550
|
const { body, statusCode, headers } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
551
551
|
headers: this.platform.generateHeaders(),
|
|
552
552
|
});
|
|
553
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
554
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
555
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
553
556
|
const deviceStatus: any = await body.json();
|
|
554
|
-
this.
|
|
555
|
-
this.
|
|
556
|
-
this.
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
557
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
558
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
559
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
560
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
561
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
562
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
563
|
+
this.OpenAPI_CurrentPosition = deviceStatus.body.slidePosition;
|
|
564
|
+
this.OpenAPI_InMotion = deviceStatus.body.moving;
|
|
565
|
+
this.OpenAPI_CurrentAmbientLightLevel = deviceStatus.body.brightness;
|
|
566
|
+
this.OpenAPI_BatterLevel = deviceStatus.body.battery;
|
|
567
|
+
this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
|
|
568
|
+
this.openAPIparseStatus();
|
|
569
|
+
this.updateHomeKitCharacteristics();
|
|
570
|
+
} else {
|
|
571
|
+
this.statusCode(statusCode);
|
|
572
|
+
this.statusCode(deviceStatus.statusCode);
|
|
573
|
+
}
|
|
565
574
|
} catch (e: any) {
|
|
566
575
|
this.apiError(e);
|
|
567
576
|
this.errorLog(
|
|
@@ -696,10 +705,20 @@ export class Curtain {
|
|
|
696
705
|
method: 'POST',
|
|
697
706
|
headers: this.platform.generateHeaders(),
|
|
698
707
|
});
|
|
708
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
709
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
710
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
699
711
|
const deviceStatus: any = await body.json();
|
|
700
|
-
this.
|
|
701
|
-
this.
|
|
702
|
-
this.
|
|
712
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
713
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
714
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
715
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
716
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
717
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
718
|
+
} else {
|
|
719
|
+
this.statusCode(statusCode);
|
|
720
|
+
this.statusCode(deviceStatus.statusCode);
|
|
721
|
+
}
|
|
703
722
|
} catch (e: any) {
|
|
704
723
|
this.apiError(e);
|
|
705
724
|
this.errorLog(
|
|
@@ -843,7 +862,7 @@ export class Curtain {
|
|
|
843
862
|
this.accessory.getService(this.platform.Service.AccessoryInformation)!
|
|
844
863
|
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.OpenAPI_FirmwareRevision);
|
|
845
864
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
846
|
-
+ `updateCharacteristic
|
|
865
|
+
+ `updateCharacteristic FirmwareRevision: ${this.OpenAPI_FirmwareRevision}`);
|
|
847
866
|
}
|
|
848
867
|
}
|
|
849
868
|
|
package/src/device/hub.ts
CHANGED
|
@@ -290,17 +290,26 @@ export class Hub {
|
|
|
290
290
|
const { body, statusCode, headers } = await request(`${Devices}/${this.device.deviceId}/status`, {
|
|
291
291
|
headers: this.platform.generateHeaders(),
|
|
292
292
|
});
|
|
293
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} body: ${JSON.stringify(body)}`);
|
|
294
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} statusCode: ${statusCode}`);
|
|
295
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} headers: ${JSON.stringify(headers)}`);
|
|
293
296
|
const deviceStatus: any = await body.json();
|
|
294
|
-
this.
|
|
295
|
-
this.
|
|
296
|
-
this.
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
297
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus: ${JSON.stringify(deviceStatus)}`);
|
|
298
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus body: ${JSON.stringify(deviceStatus.body)}`);
|
|
299
|
+
this.debugWarnLog(`${this.device.deviceType}: ${this.accessory.displayName} deviceStatus statusCode: ${deviceStatus.statusCode}`);
|
|
300
|
+
if ((statusCode === 200 || statusCode === 100) && (deviceStatus.statusCode === 200 || deviceStatus.statusCode === 100)) {
|
|
301
|
+
this.debugErrorLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
302
|
+
+ `statusCode: ${statusCode} & deviceStatus StatusCode: ${deviceStatus.statusCode}`);
|
|
303
|
+
this.OpenAPI_CurrentTemperature = deviceStatus.body.temperature;
|
|
304
|
+
this.OpenAPI_CurrentRelativeHumidity = deviceStatus.body.humidity;
|
|
305
|
+
this.OpenAPI_CurrentAmbientLightLevel = deviceStatus.body.lightLevel;
|
|
306
|
+
this.OpenAPI_FirmwareRevision = deviceStatus.body.version;
|
|
307
|
+
this.openAPIparseStatus();
|
|
308
|
+
this.updateHomeKitCharacteristics();
|
|
309
|
+
} else {
|
|
310
|
+
this.statusCode(statusCode);
|
|
311
|
+
this.statusCode(deviceStatus.statusCode);
|
|
312
|
+
}
|
|
304
313
|
} catch (e: any) {
|
|
305
314
|
this.apiError(e);
|
|
306
315
|
this.errorLog(
|
|
@@ -369,7 +378,7 @@ export class Hub {
|
|
|
369
378
|
this.accessory.getService(this.platform.Service.AccessoryInformation)!
|
|
370
379
|
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.OpenAPI_FirmwareRevision);
|
|
371
380
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} `
|
|
372
|
-
+ `updateCharacteristic
|
|
381
|
+
+ `updateCharacteristic FirmwareRevision: ${this.OpenAPI_FirmwareRevision}`);
|
|
373
382
|
}
|
|
374
383
|
}
|
|
375
384
|
|