@switchbot/homebridge-switchbot 1.10.2-beta.5 → 1.10.2-beta.6

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.
@@ -64,12 +64,6 @@ export class Humidifier {
64
64
  this.CurrentTemperature = 0;
65
65
  this.WaterLevel = 0;
66
66
 
67
- // Humidifiers Config
68
- this.debugLog(
69
- `Humidifier: ${this.accessory.displayName} Config: (ble: ${device.ble}, offline: ${device.offline}, hide_temperature: ` +
70
- `${device.humidifier?.hide_temperature}, set_minStep: ${device.humidifier?.set_minStep})`,
71
- );
72
-
73
67
  // this is subject we use to track when we need to POST changes to the SwitchBot API
74
68
  this.doHumidifierUpdate = new Subject();
75
69
  this.humidifierUpdateInProgress = false;
@@ -696,7 +690,7 @@ export class Humidifier {
696
690
  }
697
691
  }
698
692
 
699
- private offlineOff() {
693
+ offlineOff() {
700
694
  if (this.device.offline) {
701
695
  this.Active = this.platform.Characteristic.Active.INACTIVE;
702
696
  this.service.getCharacteristic(this.platform.Characteristic.Active).updateValue(this.Active);
@@ -706,7 +700,7 @@ export class Humidifier {
706
700
  /**
707
701
  * Handle requests to set the "Target Humidifier Dehumidifier State" characteristic
708
702
  */
709
- private handleTargetHumidifierDehumidifierStateSet(value: CharacteristicValue) {
703
+ handleTargetHumidifierDehumidifierStateSet(value: CharacteristicValue) {
710
704
  this.debugLog(`Humidifier: ${this.accessory.displayName} TargetHumidifierDehumidifierState: ${value}`);
711
705
 
712
706
  this.TargetHumidifierDehumidifierState = value;
@@ -716,7 +710,7 @@ export class Humidifier {
716
710
  /**
717
711
  * Handle requests to set the "Active" characteristic
718
712
  */
719
- private handleActiveSet(value: CharacteristicValue) {
713
+ handleActiveSet(value: CharacteristicValue) {
720
714
  this.debugLog(`Humidifier: ${this.accessory.displayName} Active: ${value}`);
721
715
  this.Active = value;
722
716
  this.doHumidifierUpdate.next();
@@ -725,7 +719,7 @@ export class Humidifier {
725
719
  /**
726
720
  * Handle requests to set the "Relative Humidity Humidifier Threshold" characteristic
727
721
  */
728
- private handleRelativeHumidityHumidifierThresholdSet(value: CharacteristicValue) {
722
+ handleRelativeHumidityHumidifierThresholdSet(value: CharacteristicValue) {
729
723
  this.debugLog(`Humidifier: ${this.accessory.displayName} RelativeHumidityHumidifierThreshold: ${value}`);
730
724
 
731
725
  this.RelativeHumidityHumidifierThreshold = value;
@@ -753,6 +747,9 @@ export class Humidifier {
753
747
  if (device.scanDuration !== undefined) {
754
748
  config['scanDuration'] = device.scanDuration;
755
749
  }
750
+ if (device.offline !== undefined) {
751
+ config['offline'] = device.offline;
752
+ }
756
753
  if (Object.entries(config).length !== 0) {
757
754
  this.warnLog(`Humidifier: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
758
755
  }
@@ -41,9 +41,6 @@ export class Lock {
41
41
  this.LockTargetState = this.accessory.context.On;
42
42
  }
43
43
 
44
- // Lock Config
45
- this.debugLog(`Lock: ${this.accessory.displayName} Config: (offline: ${device.offline})`);
46
-
47
44
  // this is subject we use to track when we need to POST changes to the SwitchBot API
48
45
  this.doLockUpdate = new Subject();
49
46
  this.lockUpdateInProgress = false;
@@ -121,7 +118,7 @@ export class Lock {
121
118
  default:
122
119
  this.LockCurrentState = this.platform.Characteristic.LockCurrentState.SECURED;
123
120
  }
124
- this.debugLog(`Lock ${this.accessory.displayName} On: ${this.LockTargetState}`);
121
+ this.debugLog(`Lock: ${this.accessory.displayName} On: ${this.LockTargetState}`);
125
122
  }
126
123
 
127
124
  private async refreshStatus() {
@@ -66,12 +66,6 @@ export class Meter {
66
66
  this.CurrentTemperature = this.accessory.context.CurrentTemperature;
67
67
  }
68
68
 
69
- // Meter Config
70
- this.debugLog(
71
- `Meter: ${this.accessory.displayName} Config: (ble: ${device.ble}, hide_temperature: ${device.meter?.hide_temperature},` +
72
- ` hide_humidity: ${device.meter?.hide_humidity})`,
73
- );
74
-
75
69
  // this is subject we use to track when we need to POST changes to the SwitchBot API
76
70
  this.doMeterUpdate = new Subject();
77
71
  this.meterUpdateInProgress = false;
@@ -54,13 +54,6 @@ export class Motion {
54
54
  this.config(device);
55
55
  this.MotionDetected = false;
56
56
 
57
- // Motion Config
58
- this.debugLog(
59
- `Motion Sensor: ${this.accessory.displayName} Config: (ble: ${device.ble}, offline: ${device.offline},` +
60
- ` hide_lightsensor: ${device.motion?.hide_lightsensor},` +
61
- ` set_minLux: ${this.device.motion?.set_minLux}, set_maxLux: ${this.device.motion?.set_maxLux})`,
62
- );
63
-
64
57
  // this is subject we use to track when we need to POST changes to the SwitchBot API
65
58
  this.doMotionUpdate = new Subject();
66
59
  this.motionUbpdateInProgress = false;
@@ -390,6 +383,9 @@ export class Motion {
390
383
  if (device.scanDuration !== undefined) {
391
384
  config['scanDuration'] = device.scanDuration;
392
385
  }
386
+ if (device.offline !== undefined) {
387
+ config['offline'] = device.offline;
388
+ }
393
389
  if (Object.entries(config).length !== 0) {
394
390
  this.warnLog(`Motion Sensor: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
395
391
  }
@@ -435,7 +431,7 @@ export class Motion {
435
431
  }
436
432
  }
437
433
 
438
- private minLux(): number {
434
+ minLux(): number {
439
435
  if (this.device.motion?.set_minLux) {
440
436
  this.set_minLux = this.device.motion!.set_minLux!;
441
437
  } else {
@@ -444,7 +440,7 @@ export class Motion {
444
440
  return this.set_minLux;
445
441
  }
446
442
 
447
- private maxLux(): number {
443
+ maxLux(): number {
448
444
  if (this.device.motion?.set_maxLux) {
449
445
  this.set_maxLux = this.device.motion!.set_maxLux!;
450
446
  } else {
@@ -38,9 +38,6 @@ export class Plug {
38
38
  this.On = this.accessory.context.On;
39
39
  }
40
40
 
41
- // Plug Config
42
- this.debugLog(`Plug: ${this.accessory.displayName} Config: (offline: ${device.offline})`);
43
-
44
41
  // this is subject we use to track when we need to POST changes to the SwitchBot API
45
42
  this.doPlugUpdate = new Subject();
46
43
  this.plugUpdateInProgress = false;
@@ -277,6 +274,9 @@ export class Plug {
277
274
  if (device.scanDuration !== undefined) {
278
275
  config['scanDuration'] = device.scanDuration;
279
276
  }
277
+ if (device.offline !== undefined) {
278
+ config['offline'] = device.offline;
279
+ }
280
280
  if (Object.entries(config).length !== 0) {
281
281
  this.warnLog(`Plug: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
282
282
  }