hoffmation-base 2.15.9 → 2.15.10

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.
@@ -5,6 +5,7 @@ import { IoBrokerDeviceInfo } from '../../IoBrokerDeviceInfo';
5
5
  import { iDisposable } from '../../../services';
6
6
  export declare class ZigbeeDevice extends IoBrokerBaseDevice implements iDisposable {
7
7
  protected _available: boolean;
8
+ protected _dontSendOnUnavailable: boolean;
8
9
  private readonly _deviceQueryId;
9
10
  get available(): boolean;
10
11
  protected _linkQuality: number;
@@ -18,4 +19,5 @@ export declare class ZigbeeDevice extends IoBrokerBaseDevice implements iDisposa
18
19
  triggerDeviceQuery(): void;
19
20
  dispose(): void;
20
21
  persistZigbeeDevice(): void;
22
+ protected setState(pointId: string, state: string | number | boolean | ioBroker.State | ioBroker.SettableState | null, onSuccess?: (() => void) | undefined, onError?: ((error: Error) => void) | undefined): void;
21
23
  }
@@ -17,6 +17,7 @@ class ZigbeeDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
17
17
  constructor(pInfo, pType) {
18
18
  super(pInfo, pType);
19
19
  this._available = false;
20
+ this._dontSendOnUnavailable = false;
20
21
  this._linkQuality = 0;
21
22
  this.persistZigbeeInterval = services_1.Utils.guardedInterval(() => {
22
23
  this.persistZigbeeDevice();
@@ -67,5 +68,12 @@ class ZigbeeDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
67
68
  var _a;
68
69
  (_a = services_1.Utils.dbo) === null || _a === void 0 ? void 0 : _a.persistZigbeeDevice(this);
69
70
  }
71
+ setState(pointId, state, onSuccess = undefined, onError = undefined) {
72
+ if (this._dontSendOnUnavailable && !this._available) {
73
+ this.log(models_1.LogLevel.Warn, `Device unavailable --> Not changing ${pointId} to ${state}`);
74
+ return;
75
+ }
76
+ super.setState(pointId, state, onSuccess, onError);
77
+ }
70
78
  }
71
79
  exports.ZigbeeDevice = ZigbeeDevice;
@@ -14,6 +14,7 @@ class ZigbeeEuroHeater extends BaseDevices_1.ZigbeeHeater {
14
14
  this._lastRecalc = 0;
15
15
  this._mode = 1;
16
16
  this._recalcTimeout = null;
17
+ this._dontSendOnUnavailable = true;
17
18
  this._setPointTemperaturID = `${this.info.fullID}.heating_setpnt_current`;
18
19
  this._setLocalTempCalibrationId = `${this.info.fullID}.local_temp_calibration`;
19
20
  this._setModeId = `${this.info.fullID}.spz_trv_mode`;