hoffmation-base 2.18.11 → 2.18.13

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
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, () => {
@@ -124,7 +122,7 @@ class ShellyTrv extends shellyDevice_1.ShellyDevice {
124
122
  }
125
123
  }
126
124
  checkAutomaticChange() {
127
- var _a, _b, _c, _d, _e, _f, _g, _h;
125
+ var _a, _b;
128
126
  if (!this._initialSeasonCheckDone) {
129
127
  this.checkSeasonTurnOff();
130
128
  }
@@ -137,7 +135,12 @@ class ShellyTrv extends shellyDevice_1.ShellyDevice {
137
135
  if (!this.settings.useOwnTemperatur && !this.settings.controlByPid) {
138
136
  this.setExternalTemperatureEnabled(true);
139
137
  }
140
- const heatGroupSettings = (_b = (_a = this.room) === null || _a === void 0 ? void 0 : _a.HeatGroup) === null || _b === void 0 ? void 0 : _b.settings;
138
+ const heatGroup = (_a = this.room) === null || _a === void 0 ? void 0 : _a.HeatGroup;
139
+ if (heatGroup === undefined) {
140
+ this.log(models_1.LogLevel.Warn, `HeatGroup is undefined for ${this.info.customName}`);
141
+ return;
142
+ }
143
+ const heatGroupSettings = heatGroup.settings;
141
144
  if ((heatGroupSettings === null || heatGroupSettings === void 0 ? void 0 : heatGroupSettings.automaticMode) == false) {
142
145
  this.desiredTemperature = heatGroupSettings.manualTemperature;
143
146
  return;
@@ -145,8 +148,7 @@ class ShellyTrv extends shellyDevice_1.ShellyDevice {
145
148
  if (!this.settings.automaticMode) {
146
149
  return;
147
150
  }
148
- const setting = models_1.TemperatureSettings.getActiveSetting((_f = (_e = (_d = (_c = this.room) === null || _c === void 0 ? void 0 : _c.HeatGroup) === null || _d === void 0 ? void 0 : _d.settings) === null || _e === void 0 ? void 0 : _e.automaticPoints) !== null && _f !== void 0 ? _f : [], new Date());
149
- const targetTemperature = (_h = (_g = setting === null || setting === void 0 ? void 0 : setting.temperature) !== null && _g !== void 0 ? _g : heatGroupSettings === null || heatGroupSettings === void 0 ? void 0 : heatGroupSettings.automaticFallBackTemperatur) !== null && _h !== void 0 ? _h : 20;
151
+ const targetTemperature = (_b = heatGroup.desiredTemp) !== null && _b !== void 0 ? _b : 20;
150
152
  if (this._desiredTemperatur !== targetTemperature) {
151
153
  this.log(models_1.LogLevel.Debug, `Automatische Temperaturanpassung für ${this.info.customName} auf ${targetTemperature}°C`);
152
154
  this.desiredTemperature = targetTemperature;
@@ -166,38 +168,35 @@ class ShellyTrv extends shellyDevice_1.ShellyDevice {
166
168
  (_a = services_1.Utils.dbo) === null || _a === void 0 ? void 0 : _a.persistHeater(this);
167
169
  }
168
170
  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;
171
+ if (idSplit[3] === 'tmp' && idSplit[4] === 'valvePosition') {
172
+ this.log(models_1.LogLevel.Trace, `Valve position update for ${this.info.customName} to "${state.val}"`);
173
+ this._level = state.val / 100;
174
+ }
175
+ else if (idSplit[3] === 'ext' && idSplit[4] === 'enabled') {
176
+ this._useExternalTemperatureEnabled = state.val;
177
+ }
178
+ else if (idSplit[3] === 'tmp' && idSplit[4] === 'minimumValvePosition') {
179
+ this._minimumValveLevel = state.val;
180
+ }
181
+ else if (idSplit[3] === 'tmp' && idSplit[4] === 'temperatureC') {
182
+ this._temperatur = state.val;
183
+ }
184
+ else if (idSplit[3] === 'tmp' && idSplit[4] === 'automaticTemperatureControl') {
185
+ this._automaticMode = state.val;
186
+ const desiredMode = !this.settings.controlByPid;
187
+ if (this._automaticMode !== desiredMode) {
188
+ this.setMode(desiredMode);
189
+ }
190
+ }
191
+ else if (idSplit[3] === 'tmp' && idSplit[4] === 'temperatureTargetC') {
192
+ this._targetTempVal = state.val;
193
+ }
194
+ else if (idSplit[3] === 'bat' && idSplit[4] === 'value') {
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
+ }
201
200
  }
202
201
  super.update(idSplit, state, initial, true);
203
202
  }