hoffmation-base 3.0.0-alpha.32 → 3.0.0-alpha.33

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.
@@ -16,7 +16,7 @@ class RoomSettingsController {
16
16
  this.lampOffset = new server_1.SunTimeOffsets(this.sonnenAufgangLampenDelay, this.sonnenUntergangLampenDelay);
17
17
  this._settingsContainer.onChangeCb = this.onSettingChange.bind(this);
18
18
  this._settingsContainer.initializeFromDb(room);
19
- server_1.WeatherService.addWeatherUpdateCb(`RolloWeatherUpdate${this.roomName}`, () => {
19
+ server_1.WeatherService.addWeatherUpdateCb(`ShutterWeatherUpdate${this.roomName}`, () => {
20
20
  var _a;
21
21
  if (this.sonnenUntergangRolloAdditionalOffsetPerCloudiness > 0) {
22
22
  (_a = this.room) === null || _a === void 0 ? void 0 : _a.recalcTimeCallbacks();
@@ -96,15 +96,22 @@ class TimeCallback {
96
96
  }
97
97
  break;
98
98
  }
99
- if (nextCalculatedTime < now && this.nextToDo && this.nextToDo > this.lastDone) {
100
- server_1.ServerLogService.writeLog(logLevel_1.LogLevel.Info, `Time Callback recalc results in the past, while previous target wasn't yet done --> fire immediately.`);
101
- this.perform(now);
102
- return;
103
- }
104
99
  if (((_a = this.nextToDo) === null || _a === void 0 ? void 0 : _a.getTime()) == nextCalculatedTime.getTime()) {
105
100
  // No change
106
101
  return;
107
102
  }
103
+ if (this.nextToDo && this.nextToDo > this.lastDone) {
104
+ if (nextCalculatedTime < now) {
105
+ server_1.ServerLogService.writeLog(logLevel_1.LogLevel.Info, `Time Callback recalc results in the past, while previous target wasn't yet done --> fire immediately.`);
106
+ this.perform(now);
107
+ return;
108
+ }
109
+ else if (nextCalculatedTime.getDay() !== this.nextToDo.getDay() && this.type === TimeCallbackType.SunSet) {
110
+ // Recalculation between Sunset and delayed sunset action can result in the next day beeing calculated --> fire immediately
111
+ server_1.ServerLogService.writeLog(logLevel_1.LogLevel.Info, `Time Callback recalc results in the next day, while previous action wasn't yet fired --> fire immediately.`);
112
+ this.perform(now);
113
+ }
114
+ }
108
115
  this.nextToDo = nextCalculatedTime;
109
116
  server_1.ServerLogService.writeLog(logLevel_1.LogLevel.Debug, `Next Time event for "${this.name}" at ${this.nextToDo.toLocaleString('de-DE')}`);
110
117
  }