hoffmation-base 3.0.0-alpha.73 → 3.0.0-alpha.74

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.
@@ -38,13 +38,13 @@ class LedSetLightCommand extends dimmerSetLightCommand_1.DimmerSetLightCommand {
38
38
  static byTimeBased(settings, c) {
39
39
  switch (c.time) {
40
40
  case timeCallback_1.TimeOfDay.Daylight:
41
- return new LedSetLightCommand(c, settings.dayOn, '', c.disableAutomaticCommand, settings.dayBrightness, undefined, settings.dayColor, settings.dayColorTemp);
41
+ return new LedSetLightCommand(c, settings.dayOn, `byTimeBased(${timeCallback_1.TimeOfDay[c.time]})`, c.disableAutomaticCommand, settings.dayBrightness, undefined, settings.dayColor, settings.dayColorTemp);
42
42
  case timeCallback_1.TimeOfDay.BeforeSunrise:
43
- return new LedSetLightCommand(c, settings.dawnOn, '', c.disableAutomaticCommand, settings.dawnBrightness, undefined, settings.dawnColor, settings.dawnColorTemp);
43
+ return new LedSetLightCommand(c, settings.dawnOn, `byTimeBased(${timeCallback_1.TimeOfDay[c.time]})`, c.disableAutomaticCommand, settings.dawnBrightness, undefined, settings.dawnColor, settings.dawnColorTemp);
44
44
  case timeCallback_1.TimeOfDay.AfterSunset:
45
- return new LedSetLightCommand(c, settings.duskOn, '', c.disableAutomaticCommand, settings.duskBrightness, undefined, settings.duskColor, settings.duskColorTemp);
45
+ return new LedSetLightCommand(c, settings.duskOn, `byTimeBased(${timeCallback_1.TimeOfDay[c.time]})`, c.disableAutomaticCommand, settings.duskBrightness, undefined, settings.duskColor, settings.duskColorTemp);
46
46
  case timeCallback_1.TimeOfDay.Night:
47
- return new LedSetLightCommand(c, settings.nightOn, '', c.disableAutomaticCommand, settings.nightBrightness, undefined, settings.nightColor, settings.nightColorTemp);
47
+ return new LedSetLightCommand(c, settings.nightOn, `byTimeBased(${timeCallback_1.TimeOfDay[c.time]})`, c.disableAutomaticCommand, settings.nightBrightness, undefined, settings.nightColor, settings.nightColorTemp);
48
48
  }
49
49
  }
50
50
  }
@@ -141,7 +141,7 @@ class RoomBase {
141
141
  })))) {
142
142
  timeOfDay = server_1.Utils.nowTime().hours > 16 ? timeCallback_1.TimeOfDay.AfterSunset : timeCallback_1.TimeOfDay.BeforeSunrise;
143
143
  }
144
- this.LightGroup.switchTimeConditional(new command_1.LightGroupSwitchTimeConditionalCommand(c, timeOfDay));
144
+ this.LightGroup.switchTimeConditional(new command_1.LightGroupSwitchTimeConditionalCommand(c, timeOfDay, `time: ${timeCallback_1.TimeOfDay[timeOfDay]}`));
145
145
  }
146
146
  isNowLightTime() {
147
147
  var _a;
@@ -61,7 +61,7 @@ class LightGroup extends base_group_1.BaseGroup {
61
61
  let resultLampen = false;
62
62
  let resultSteckdosen = false;
63
63
  let activatedGroups = 0;
64
- const command = new models_1.LampSetTimeBasedCommand(c, c.time, 'LightGroup switchTimeConditional');
64
+ const command = new models_1.LampSetTimeBasedCommand(c, c.time);
65
65
  if (this.getWled().length > 0) {
66
66
  activatedGroups++;
67
67
  this.log(models_1.LogLevel.Debug, `Set Wled time based for time "${models_1.TimeOfDay[c.time]}"`);
@@ -196,7 +196,7 @@ class LightGroup extends base_group_1.BaseGroup {
196
196
  var _a;
197
197
  this.log(models_1.LogLevel.Info, 'Ambientenbeleuchtung um Mitternacht abschalten.');
198
198
  this._ambientLightOn = false;
199
- if (((_a = this.getRoom().PraesenzGroup) === null || _a === void 0 ? void 0 : _a.anyPresent()) !== true) {
199
+ if (((_a = this.getRoom().PraesenzGroup) === null || _a === void 0 ? void 0 : _a.anyPresent(true)) !== true) {
200
200
  this.switchAll(new models_1.ActuatorSetStateCommand(models_1.CommandSource.Automatic, false, 'Ambient Light End Callback'));
201
201
  }
202
202
  }, services_1.Utils.timeTilMidnight, this);
@@ -8,12 +8,13 @@ export declare class PresenceGroup extends BaseGroup {
8
8
  private _firstEnterCbs;
9
9
  private _anyMovementCbs;
10
10
  constructor(roomName: string, motionSensorIds: string[]);
11
+ private get lastLeftDelayActive();
11
12
  getMotionDetector(): Array<iMotionSensor>;
12
13
  initCallbacks(): void;
13
14
  presentAmount(): number;
14
15
  addLastLeftCallback(cb: (action: PresenceGroupLastLeftAction) => void): void;
15
16
  addAnyMovementCallback(cb: (action: PresenceGroupAnyMovementAction) => void): void;
16
- anyPresent(): boolean;
17
+ anyPresent(includeMovementResetDelayCheck?: boolean): boolean;
17
18
  private fireFistEnterCBs;
18
19
  addFirstEnterCallback(cb: (action: PresenceGroupFirstEnterAction) => void): void;
19
20
  private motionSensorOnAnyMovement;
@@ -17,6 +17,9 @@ class PresenceGroup extends base_group_1.BaseGroup {
17
17
  this._anyMovementCbs = [];
18
18
  this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.MotionDetection, new device_list_1.DeviceList(motionSensorIds));
19
19
  }
20
+ get lastLeftDelayActive() {
21
+ return this._lastLeftTimeout !== null;
22
+ }
20
23
  getMotionDetector() {
21
24
  return this.deviceCluster.getDevicesByType(device_cluster_type_1.DeviceClusterType.MotionDetection);
22
25
  }
@@ -62,7 +65,10 @@ class PresenceGroup extends base_group_1.BaseGroup {
62
65
  addAnyMovementCallback(cb) {
63
66
  this._anyMovementCbs.push(cb);
64
67
  }
65
- anyPresent() {
68
+ anyPresent(includeMovementResetDelayCheck = false) {
69
+ if (includeMovementResetDelayCheck && this.lastLeftDelayActive) {
70
+ return true;
71
+ }
66
72
  return this.getMotionDetector().find((b) => b.movementDetected) !== undefined;
67
73
  }
68
74
  fireFistEnterCBs(action) {
@@ -9,7 +9,7 @@ class LampUtils {
9
9
  LampUtils.stromStossContinueTimeouts.set(actuator.id, services_1.Utils.guardedTimeout(() => {
10
10
  var _a, _b;
11
11
  LampUtils.stromStossContinueTimeouts.delete(actuator.id);
12
- if ((_b = (_a = actuator.room) === null || _a === void 0 ? void 0 : _a.PraesenzGroup) === null || _b === void 0 ? void 0 : _b.anyPresent()) {
12
+ if ((_b = (_a = actuator.room) === null || _a === void 0 ? void 0 : _a.PraesenzGroup) === null || _b === void 0 ? void 0 : _b.anyPresent(true)) {
13
13
  actuator.setActuator(new models_1.ActuatorSetStateCommand(models_1.CommandSource.Automatic, true, 'StromStoss On due to Presence', null));
14
14
  }
15
15
  }, actuator.settings.stromStossResendTime * 1000, this));
@@ -1,9 +1,8 @@
1
- import { DeviceInfo, DeviceType, iAcDevice, iExcessEnergyConsumer, iRoomDevice, iTemporaryDisableAutomatic } from '../../devices';
1
+ import { DeviceCapability, DeviceInfo, DeviceType, iAcDevice, iExcessEnergyConsumer, iRoomDevice, iTemporaryDisableAutomatic } from '../../devices';
2
2
  import { AcSettings, ExcessEnergyConsumerSettings, LogLevel, RoomBase } from '../../../models';
3
3
  import { LogDebugType } from '../log-service';
4
4
  import { AcMode } from './ac-mode';
5
5
  import { AcDeviceType } from './acDeviceType';
6
- import { DeviceCapability } from '../../devices/DeviceCapability';
7
6
  import { BlockAutomaticHandler } from '../blockAutomaticHandler';
8
7
  export declare abstract class AcDevice implements iExcessEnergyConsumer, iRoomDevice, iAcDevice, iTemporaryDisableAutomatic {
9
8
  ip: string;
@@ -10,7 +10,6 @@ const utils_1 = require("../utils");
10
10
  const log_service_1 = require("../log-service");
11
11
  const ac_mode_1 = require("./ac-mode");
12
12
  const lodash_1 = __importDefault(require("lodash"));
13
- const DeviceCapability_1 = require("../../devices/DeviceCapability");
14
13
  const settings_service_1 = require("../settings-service");
15
14
  const config_1 = require("../../config");
16
15
  const blockAutomaticHandler_1 = require("../blockAutomaticHandler");
@@ -25,7 +24,7 @@ class AcDevice {
25
24
  if (settings_service_1.SettingsService.heatMode !== config_1.HeatingMode.Summer) {
26
25
  return false;
27
26
  }
28
- if (this.settings.noCoolingOnMovement && ((_b = (_a = this.room) === null || _a === void 0 ? void 0 : _a.PraesenzGroup) === null || _b === void 0 ? void 0 : _b.anyPresent())) {
27
+ if (this.settings.noCoolingOnMovement && ((_b = (_a = this.room) === null || _a === void 0 ? void 0 : _a.PraesenzGroup) === null || _b === void 0 ? void 0 : _b.anyPresent(true))) {
29
28
  return false;
30
29
  }
31
30
  if (weather_1.WeatherService.active &&
@@ -78,7 +77,7 @@ class AcDevice {
78
77
  /** @inheritDoc */
79
78
  this.settings = new models_1.AcSettings();
80
79
  /** @inheritDoc */
81
- this.deviceCapabilities = [DeviceCapability_1.DeviceCapability.ac, DeviceCapability_1.DeviceCapability.blockAutomatic];
80
+ this.deviceCapabilities = [devices_1.DeviceCapability.ac, devices_1.DeviceCapability.blockAutomatic];
82
81
  this._activatedByExcessEnergy = false;
83
82
  this._desiredTemperatur = devices_1.UNDEFINED_TEMP_VALUE;
84
83
  this._mode = ac_mode_1.AcMode.Off;