@switchbot/homebridge-switchbot 2.4.0-beta.1 → 2.4.0-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.
@@ -538,8 +538,8 @@ export class Plug {
538
538
 
539
539
  async maxRetry(): Promise<number> {
540
540
  let maxRetry: number;
541
- if (this.device.bot?.maxRetry) {
542
- maxRetry = this.device.bot?.maxRetry;
541
+ if (this.device.maxRetry) {
542
+ maxRetry = this.device.maxRetry;
543
543
  } else {
544
544
  maxRetry = 5;
545
545
  }
@@ -673,6 +673,9 @@ export class Plug {
673
673
  if (device.offline !== undefined) {
674
674
  config['offline'] = device.offline;
675
675
  }
676
+ if (device.maxRetry !== undefined) {
677
+ config['maxRetry'] = device.maxRetry;
678
+ }
676
679
  if (Object.entries(config).length !== 0) {
677
680
  this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} Config: ${superStringify(config)}`);
678
681
  }
@@ -662,8 +662,8 @@ export class RobotVacuumCleaner {
662
662
 
663
663
  async maxRetry(): Promise<number> {
664
664
  let maxRetry: number;
665
- if (this.device.bot?.maxRetry) {
666
- maxRetry = this.device.bot?.maxRetry;
665
+ if (this.device.maxRetry) {
666
+ maxRetry = this.device.maxRetry;
667
667
  } else {
668
668
  maxRetry = 5;
669
669
  }
@@ -802,6 +802,9 @@ export class RobotVacuumCleaner {
802
802
  if (device.offline !== undefined) {
803
803
  config['offline'] = device.offline;
804
804
  }
805
+ if (device.maxRetry !== undefined) {
806
+ config['maxRetry'] = device.maxRetry;
807
+ }
805
808
  if (Object.entries(config).length !== 0) {
806
809
  this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} Config: ${superStringify(config)}`);
807
810
  }
@@ -903,8 +903,8 @@ export class StripLight {
903
903
 
904
904
  async maxRetry(): Promise<number> {
905
905
  let maxRetry: number;
906
- if (this.device.bot?.maxRetry) {
907
- maxRetry = this.device.bot?.maxRetry;
906
+ if (this.device.maxRetry) {
907
+ maxRetry = this.device.maxRetry;
908
908
  } else {
909
909
  maxRetry = 5;
910
910
  }
@@ -1074,6 +1074,9 @@ export class StripLight {
1074
1074
  if (device.offline !== undefined) {
1075
1075
  config['offline'] = device.offline;
1076
1076
  }
1077
+ if (device.maxRetry !== undefined) {
1078
+ config['maxRetry'] = device.maxRetry;
1079
+ }
1077
1080
  if (Object.entries(config).length !== 0) {
1078
1081
  this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} Config: ${superStringify(config)}`);
1079
1082
  }
package/src/settings.ts CHANGED
@@ -54,6 +54,7 @@ export interface devicesConfig extends device {
54
54
  scanDuration?: number;
55
55
  hide_device?: boolean;
56
56
  offline?: boolean;
57
+ maxRetry?: number;
57
58
  mqttURL?: string;
58
59
  mqttOptions?: IClientOptions;
59
60
  mqttPubOptions?: IClientOptions;
@@ -81,7 +82,6 @@ export type bot = {
81
82
  doublePress?: number;
82
83
  pushRatePress?: number;
83
84
  allowPush?: boolean;
84
- maxRetry?: number;
85
85
  multiPress?: boolean;
86
86
  };
87
87