hoffmation-base 3.0.0-alpha.34 → 3.0.0-alpha.35

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.
@@ -110,15 +110,22 @@ class RoomBase {
110
110
  * @param c - The command to execute
111
111
  */
112
112
  setLightTimeBased(c) {
113
- var _a, _b;
113
+ var _a;
114
114
  if (!this.LightGroup) {
115
115
  this.log(logLevel_1.LogLevel.Trace, 'Ignore "setLightTimeBased" as we have no lamps');
116
116
  return;
117
117
  }
118
- if (c.movementDependant && this.PraesenzGroup && !((_a = this.PraesenzGroup) === null || _a === void 0 ? void 0 : _a.anyPresent())) {
119
- this.log(logLevel_1.LogLevel.Trace, 'Turn off lights as no-one is present.');
120
- this.LightGroup.switchAll(new command_1.ActuatorSetStateCommand(c, false, 'No one is present --> Turn off lights.'));
121
- return;
118
+ if (c.movementDependant) {
119
+ if (!this.PraesenzGroup ||
120
+ this.PraesenzGroup.deviceCluster.getDevicesByType(server_1.DeviceClusterType.MotionDetection).length === 0) {
121
+ this.log(logLevel_1.LogLevel.Trace, 'Ignore movement dependant "setLightTimeBased" as we have no Presence Group or no sensors');
122
+ return;
123
+ }
124
+ if (!this.PraesenzGroup.anyPresent()) {
125
+ this.log(logLevel_1.LogLevel.Trace, 'Turn off lights as no-one is present.');
126
+ this.LightGroup.switchAll(new command_1.ActuatorSetStateCommand(c, false, 'No one is present --> Turn off lights.'));
127
+ return;
128
+ }
122
129
  }
123
130
  if (!this.settings.lampOffset && !this.settings.roomIsAlwaysDark) {
124
131
  this.log(logLevel_1.LogLevel.Alert, `Beim Aufruf von "setLightTimeBased" im Raum ${this.roomName} liegt kein Lampen Offset vor`);
@@ -129,7 +136,7 @@ class RoomBase {
129
136
  : server_1.TimeCallbackService.dayType(this.settings.lampOffset);
130
137
  if (timeOfDay === timeCallback_1.TimeOfDay.Daylight &&
131
138
  ((this.settings.lightIfNoWindows && (!this.WindowGroup || this.WindowGroup.windows.length === 0)) ||
132
- ((_b = this.WindowGroup) === null || _b === void 0 ? void 0 : _b.windows.some((f) => {
139
+ ((_a = this.WindowGroup) === null || _a === void 0 ? void 0 : _a.windows.some((f) => {
133
140
  return server_1.ShutterService.anyRolloDown(f.getShutter());
134
141
  })))) {
135
142
  timeOfDay = server_1.Utils.nowTime().hours > 16 ? timeCallback_1.TimeOfDay.AfterSunset : timeCallback_1.TimeOfDay.BeforeSunrise;