hoffmation-base 3.3.3 → 3.3.8

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.
@@ -165,10 +165,8 @@ class WindowGroup extends base_group_1.BaseGroup {
165
165
  if (this.sunsetShutterCallback && room.settings.rolloOffset) {
166
166
  this.sunsetShutterCallback.minuteOffset = room.settings.rolloOffset.sunset;
167
167
  this.sunsetShutterCallback.sunTimeOffset = room.settings.rolloOffset;
168
- if (room.settings.sonnenUntergangRolloAdditionalOffsetPerCloudiness > 0) {
169
- this.sunsetShutterCallback.cloudOffset =
170
- services_1.WeatherService.getCurrentCloudiness() * room.settings.sonnenUntergangRolloAdditionalOffsetPerCloudiness;
171
- }
168
+ this.sunsetShutterCallback.cloudOffset =
169
+ services_1.WeatherService.getCurrentCloudiness() * room.settings.sonnenUntergangRolloAdditionalOffsetPerCloudiness;
172
170
  this.sunsetShutterCallback.recalcNextToDo(new Date());
173
171
  }
174
172
  if (this.sunsetShutterCallback === undefined) {
@@ -35,7 +35,7 @@ class TimeCallback {
35
35
  this.lastDone = new Date(0);
36
36
  }
37
37
  recalcNextToDo(now) {
38
- var _a;
38
+ var _a, _b;
39
39
  const today = new Date(now.getTime());
40
40
  today.setHours(0, 0, 0, 0);
41
41
  let nextCalculatedTime;
@@ -71,16 +71,13 @@ class TimeCallback {
71
71
  }
72
72
  break;
73
73
  case enums_1.TimeCallbackType.SunSet:
74
- if (this.nextToDo === undefined || this.lastDone.getDate() === this.calculationSunset.getDate()) {
74
+ if (this._calculationSunset === undefined ||
75
+ this.nextToDo === undefined ||
76
+ this.lastDone.getDate() === this.calculationSunset.getDate()) {
75
77
  this._calculationSunset = new Date(services_1.TimeCallbackService.nextSunSet.getTime());
76
78
  }
77
- if (this.cloudOffset === undefined) {
78
- this.cloudOffset = 0;
79
- }
80
- else {
81
- this.cloudOffset = this.cloudOffset * -1;
82
- }
83
- nextCalculatedTime = new Date(this.calculationSunset.getTime() + (this.minuteOffset + this.cloudOffset) * 60 * 1000);
79
+ (_a = this.cloudOffset) !== null && _a !== void 0 ? _a : (this.cloudOffset = 0);
80
+ nextCalculatedTime = new Date(this.calculationSunset.getTime() + (this.minuteOffset - this.cloudOffset) * 60 * 1000);
84
81
  if (this.sunTimeOffset) {
85
82
  const nextMaxSS = this.sunTimeOffset.getNextMaximumSunset(now);
86
83
  if (nextMaxSS < nextCalculatedTime && nextCalculatedTime.getDate() === nextMaxSS.getDate()) {
@@ -89,7 +86,7 @@ class TimeCallback {
89
86
  }
90
87
  break;
91
88
  }
92
- if (((_a = this.nextToDo) === null || _a === void 0 ? void 0 : _a.getTime()) == nextCalculatedTime.getTime()) {
89
+ if (((_b = this.nextToDo) === null || _b === void 0 ? void 0 : _b.getTime()) == nextCalculatedTime.getTime()) {
93
90
  // No change
94
91
  return;
95
92
  }