hoffmation-base 2.18.10 → 2.18.12

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.
@@ -23,13 +23,11 @@ export declare class ShellyTrv extends ShellyDevice implements iHeater {
23
23
  private _useExternalTemperatureEnabled;
24
24
  private _pidController;
25
25
  private _lastBatteryPersist;
26
- private readonly _batteryId;
27
26
  private readonly _minumumLevelId;
28
27
  private readonly _setAutomaticModeId;
29
28
  private readonly _setExternalTempId;
30
29
  private readonly _setEnableExternalTempId;
31
30
  private readonly _setPointTemperaturID;
32
- private readonly _temperatureId;
33
31
  private readonly _valvePosId;
34
32
  constructor(pInfo: IoBrokerDeviceInfo);
35
33
  protected _seasonTurnOff: boolean;
@@ -51,13 +51,11 @@ class ShellyTrv extends shellyDevice_1.ShellyDevice {
51
51
  this._roomTemperature = baseDeviceInterfaces_1.UNDEFINED_TEMP_VALUE;
52
52
  this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.heater);
53
53
  this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.batteryDriven);
54
- this._batteryId = `${this.info.fullID}.bat.value`;
55
54
  this._setAutomaticModeId = `${this.info.fullID}.tmp.automaticTemperatureControl`;
56
55
  this._setExternalTempId = `${this.info.fullID}.ext.temperature`;
57
56
  this._setEnableExternalTempId = `${this.info.fullID}.ext.enabled`;
58
- this._setPointTemperaturID = `${this.info.fullID}.tmp.shelly.temperatureTargetC`;
57
+ this._setPointTemperaturID = `${this.info.fullID}.tmp.temperatureTargetC`;
59
58
  this._minumumLevelId = `${this.info.fullID}.tmp.minimumValvePosition`;
60
- this._temperatureId = `${this.info.fullID}.tmp.temperatureC`;
61
59
  this._valvePosId = `${this.info.fullID}.tmp.valvePosition`;
62
60
  this._iAutomaticInterval = services_1.Utils.guardedInterval(this.checkAutomaticChange, 300000, this); // Alle 5 Minuten prüfen
63
61
  services_1.TimeCallbackService.addCallback(new models_1.TimeCallback(`${this.info.fullID} Season Check`, models_1.TimeCallbackType.TimeOfDay, () => {
@@ -166,38 +164,35 @@ class ShellyTrv extends shellyDevice_1.ShellyDevice {
166
164
  (_a = services_1.Utils.dbo) === null || _a === void 0 ? void 0 : _a.persistHeater(this);
167
165
  }
168
166
  update(idSplit, state, initial = false) {
169
- const fullId = idSplit.join('.');
170
- switch (fullId) {
171
- case this._valvePosId:
172
- this.log(models_1.LogLevel.Trace, `Valve position update for ${this.info.customName} to "${state.val}"`);
173
- this._level = state.val / 100;
174
- break;
175
- case this._setEnableExternalTempId:
176
- this._useExternalTemperatureEnabled = state.val;
177
- break;
178
- case this._minumumLevelId:
179
- this._minimumValveLevel = state.val;
180
- break;
181
- case this._temperatureId:
182
- this._temperatur = state.val;
183
- break;
184
- case this._setAutomaticModeId:
185
- this._automaticMode = state.val;
186
- const desiredMode = !this.settings.controlByPid;
187
- if (this._automaticMode !== desiredMode) {
188
- this.setMode(desiredMode);
189
- }
190
- break;
191
- case this._setPointTemperaturID:
192
- this._targetTempVal = state.val;
193
- break;
194
- case this._batteryId:
195
- this._battery = state.val;
196
- this.persistBatteryDevice();
197
- if (this._battery < 20) {
198
- this.log(models_1.LogLevel.Warn, `Das Shelly Gerät hat unter 20% Batterie.`);
199
- }
200
- break;
167
+ if (idSplit[3] === 'tmp' && idSplit[4] === 'valvePosition') {
168
+ this.log(models_1.LogLevel.Trace, `Valve position update for ${this.info.customName} to "${state.val}"`);
169
+ this._level = state.val / 100;
170
+ }
171
+ else if (idSplit[3] === 'ext' && idSplit[4] === 'enabled') {
172
+ this._useExternalTemperatureEnabled = state.val;
173
+ }
174
+ else if (idSplit[3] === 'tmp' && idSplit[4] === 'minimumValvePosition') {
175
+ this._minimumValveLevel = state.val;
176
+ }
177
+ else if (idSplit[3] === 'tmp' && idSplit[4] === 'temperatureC') {
178
+ this._temperatur = state.val;
179
+ }
180
+ else if (idSplit[3] === 'tmp' && idSplit[4] === 'automaticTemperatureControl') {
181
+ this._automaticMode = state.val;
182
+ const desiredMode = !this.settings.controlByPid;
183
+ if (this._automaticMode !== desiredMode) {
184
+ this.setMode(desiredMode);
185
+ }
186
+ }
187
+ else if (idSplit[3] === 'tmp' && idSplit[4] === 'temperatureTargetC') {
188
+ this._targetTempVal = state.val;
189
+ }
190
+ else if (idSplit[3] === 'bat' && idSplit[4] === 'value') {
191
+ this._battery = state.val;
192
+ this.persistBatteryDevice();
193
+ if (this._battery < 20) {
194
+ this.log(models_1.LogLevel.Warn, `Das Shelly Gerät hat unter 20% Batterie.`);
195
+ }
201
196
  }
202
197
  super.update(idSplit, state, initial, true);
203
198
  }