hoffmation-base 3.0.0-alpha.96 → 3.0.0-alpha.98

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.
@@ -12,6 +12,7 @@ const dachsSettings_1 = require("../../../models/deviceSettings/dachsSettings");
12
12
  const lib_1 = require("./lib");
13
13
  const dachsTemperatureSensor_1 = require("./dachsTemperatureSensor");
14
14
  const blockAutomaticHandler_1 = require("../../services/blockAutomaticHandler");
15
+ const config_1 = require("../../config");
15
16
  class Dachs {
16
17
  /** @inheritDoc */
17
18
  get customName() {
@@ -159,10 +160,14 @@ class Dachs {
159
160
  /** @inheritDoc */
160
161
  setActuator(c) {
161
162
  devices_1.LampUtils.setActuator(this, c);
162
- if (c.on && this.warmWaterPump && (this.queuedValue === true || this._dachsOn)) {
163
- const startPumpCommand = new models_1.ActuatorSetStateCommand(c, true, 'Dachs is starting/on');
164
- this.warmWaterPump.setActuator(startPumpCommand);
163
+ if (!c.on ||
164
+ !this.warmWaterPump ||
165
+ (this.queuedValue === false && !this._dachsOn) ||
166
+ this.heatStorageTempSensor.temperatureSensor.temperature < this.warmWaterSensor.temperatureSensor.temperature) {
167
+ return;
165
168
  }
169
+ const startPumpCommand = new models_1.ActuatorSetStateCommand(c, true, 'Dachs is starting/on');
170
+ this.warmWaterPump.setActuator(startPumpCommand);
166
171
  }
167
172
  /** @inheritDoc */
168
173
  toggleActuator(c) {
@@ -274,6 +279,7 @@ class Dachs {
274
279
  this.heatingRod.setActuator(setAction);
275
280
  }
276
281
  shouldDachsBeStarted(action) {
282
+ var _a;
277
283
  if (this.blockDachsStart !== undefined) {
278
284
  if (action.newLevel > this.settings.batteryLevelPreventStartThreshold) {
279
285
  const blockAction = new models_1.ActuatorSetStateCommand(action, true, `Battery reached ${action.newLevel}%, Dachs should not run any more`, null);
@@ -285,6 +291,12 @@ class Dachs {
285
291
  const liftAction = new models_1.ActuatorSetStateCommand(action, false, `Battery reached ${action.newLevel}%, Dachs is now allowed to run if needed`, null);
286
292
  this.blockDachsStart.setActuator(liftAction);
287
293
  }
294
+ else if (((_a = services_1.SettingsService.settings.heaterSettings) === null || _a === void 0 ? void 0 : _a.mode) === config_1.HeatingMode.Winter &&
295
+ this.heatStorageTempSensor.temperatureSensor.temperature < 60 &&
296
+ services_1.Utils.dateByTimeSpan(21, 30) < new Date()) {
297
+ const liftWinterAction = new models_1.ActuatorSetStateCommand(action, false, `Battery at ${action.newLevel}% but it is winter, we are nearing night and heat storage is kinda cold: Dachs is now allowed to run if needed`, null);
298
+ this.blockDachsStart.setActuator(liftWinterAction);
299
+ }
288
300
  else if (this.blockDachsStart.actuatorOn) {
289
301
  // We haven't reached the lower threshold yet --> nothing to do
290
302
  return false;