@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.
@@ -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
- this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} Set On: ${value}`);
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.On) {
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.On) {
711
- this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} ColorTemperature: ${value}`);
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.On) {
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.On) {
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 !== 'BLE/OpenAPI') {
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 !== 'BLE/OpenAPI') {
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
  }