@switchbot/homebridge-switchbot 2.0.0-beta.26 → 2.0.0-beta.27
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/bot.d.ts.map +1 -1
- package/dist/device/bot.js +4 -10
- package/dist/device/bot.js.map +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +24 -7
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.js +1 -1
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +8 -3
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/humidifier.d.ts +4 -4
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +26 -11
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +8 -3
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.js +1 -1
- package/dist/device/meterplus.js +1 -1
- package/dist/device/motion.js +1 -1
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +8 -3
- package/dist/device/plug.js.map +1 -1
- package/dist/device/striplight.d.ts.map +1 -1
- package/dist/device/striplight.js +26 -9
- package/dist/device/striplight.js.map +1 -1
- package/package.json +1 -1
- package/src/device/bot.ts +4 -10
- package/src/device/colorbulb.ts +19 -7
- package/src/device/contact.ts +1 -1
- package/src/device/curtain.ts +7 -3
- package/src/device/humidifier.ts +23 -11
- package/src/device/lock.ts +7 -3
- package/src/device/meter.ts +1 -1
- package/src/device/meterplus.ts +1 -1
- package/src/device/motion.ts +1 -1
- package/src/device/plug.ts +7 -3
- package/src/device/striplight.ts +21 -9
package/src/device/striplight.ts
CHANGED
|
@@ -683,7 +683,11 @@ export class StripLight {
|
|
|
683
683
|
* Handle requests to set the value of the "On" characteristic
|
|
684
684
|
*/
|
|
685
685
|
async OnSet(value: CharacteristicValue): Promise<void> {
|
|
686
|
-
|
|
686
|
+
if (this.On === this.accessory.context.On) {
|
|
687
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} No Changes, Set On: ${value}`);
|
|
688
|
+
} else {
|
|
689
|
+
this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} Set On: ${value}`);
|
|
690
|
+
}
|
|
687
691
|
|
|
688
692
|
this.On = value;
|
|
689
693
|
this.doStripLightUpdate.next();
|
|
@@ -693,7 +697,9 @@ export class StripLight {
|
|
|
693
697
|
* Handle requests to set the value of the "Brightness" characteristic
|
|
694
698
|
*/
|
|
695
699
|
async BrightnessSet(value: CharacteristicValue): Promise<void> {
|
|
696
|
-
if (this.
|
|
700
|
+
if (this.Brightness === this.accessory.context.Brightness) {
|
|
701
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} No Changes, Set Brightness: ${value}`);
|
|
702
|
+
} else if (this.On) {
|
|
697
703
|
this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} Set Brightness: ${value}`);
|
|
698
704
|
} else {
|
|
699
705
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Set Brightness: ${value}`);
|
|
@@ -707,10 +713,12 @@ export class StripLight {
|
|
|
707
713
|
* Handle requests to set the value of the "ColorTemperature" characteristic
|
|
708
714
|
*/
|
|
709
715
|
async ColorTemperatureSet(value: CharacteristicValue): Promise<void> {
|
|
710
|
-
if (this.
|
|
711
|
-
this.
|
|
716
|
+
if (this.ColorTemperature === this.accessory.context.ColorTemperature) {
|
|
717
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} No Changes, Set ColorTemperature: ${value}`);
|
|
718
|
+
} else if (this.On) {
|
|
719
|
+
this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} Set ColorTemperature: ${value}`);
|
|
712
720
|
} else {
|
|
713
|
-
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} ColorTemperature: ${value}`);
|
|
721
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Set ColorTemperature: ${value}`);
|
|
714
722
|
}
|
|
715
723
|
|
|
716
724
|
// Convert mired to kelvin to nearest 100 (SwitchBot seems to need this)
|
|
@@ -736,7 +744,9 @@ export class StripLight {
|
|
|
736
744
|
* Handle requests to set the value of the "Hue" characteristic
|
|
737
745
|
*/
|
|
738
746
|
async HueSet(value: CharacteristicValue): Promise<void> {
|
|
739
|
-
if (this.
|
|
747
|
+
if (this.Hue === this.accessory.context.Hue) {
|
|
748
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} No Changes, Set Hue: ${value}`);
|
|
749
|
+
} else if (this.On) {
|
|
740
750
|
this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} Set Hue: ${value}`);
|
|
741
751
|
} else {
|
|
742
752
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Set Hue: ${value}`);
|
|
@@ -752,7 +762,9 @@ export class StripLight {
|
|
|
752
762
|
* Handle requests to set the value of the "Saturation" characteristic
|
|
753
763
|
*/
|
|
754
764
|
async SaturationSet(value: CharacteristicValue): Promise<void> {
|
|
755
|
-
if (this.
|
|
765
|
+
if (this.Saturation === this.accessory.context.Saturation) {
|
|
766
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} No Changes, Set Saturation: ${value}`);
|
|
767
|
+
} else if (this.On) {
|
|
756
768
|
this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} Set Saturation: ${value}`);
|
|
757
769
|
} else {
|
|
758
770
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Set Saturation: ${value}`);
|
|
@@ -822,7 +834,7 @@ export class StripLight {
|
|
|
822
834
|
}
|
|
823
835
|
|
|
824
836
|
async BLEPushConnection() {
|
|
825
|
-
if (this.platform.config.credentials?.token && this.device.connectionType
|
|
837
|
+
if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
|
|
826
838
|
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} Using OpenAPI Connection to Push Changes`);
|
|
827
839
|
await this.openAPIpushChanges();
|
|
828
840
|
}
|
|
@@ -830,7 +842,7 @@ export class StripLight {
|
|
|
830
842
|
|
|
831
843
|
async BLERefreshConnection(switchbot: any): Promise<void> {
|
|
832
844
|
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} wasn't able to establish BLE Connection, node-switchbot: ${switchbot}`);
|
|
833
|
-
if (this.platform.config.credentials?.token && this.device.connectionType
|
|
845
|
+
if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
|
|
834
846
|
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} Using OpenAPI Connection to Refresh Status`);
|
|
835
847
|
await this.openAPIRefreshStatus();
|
|
836
848
|
}
|