hoffmation-base 2.2.6 → 2.3.0

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.
@@ -1,5 +1,5 @@
1
1
  import { TimeCallback } from '../timeCallback';
2
- import { BaseGroup, DeviceCluster, GroupType, HeatGroup, LampenGroup, PresenceGroup, SmokeGroup, SpeakerGroup, TasterGroup, WaterGroup, WindowGroup } from '../../server';
2
+ import { BaseGroup, DeviceCluster, GroupType, HeatGroup, LightGroup, PresenceGroup, SmokeGroup, SpeakerGroup, TasterGroup, WaterGroup, WindowGroup } from '../../server';
3
3
  import { LogLevel } from '../logLevel';
4
4
  import { RoomSettingsController } from './RoomSettings';
5
5
  import { iRoomBase } from './iRoomBase';
@@ -25,7 +25,7 @@ export declare class RoomBase implements iRoomBase, iIdHolder {
25
25
  get deviceCluster(): DeviceCluster;
26
26
  get WindowGroup(): WindowGroup | undefined;
27
27
  get PraesenzGroup(): PresenceGroup | undefined;
28
- get LampenGroup(): LampenGroup | undefined;
28
+ get LightGroup(): LightGroup | undefined;
29
29
  get TasterGroup(): TasterGroup | undefined;
30
30
  get SonosGroup(): SpeakerGroup | undefined;
31
31
  get SmokeGroup(): SmokeGroup | undefined;
@@ -21,11 +21,11 @@ class RoomBase {
21
21
  }
22
22
  get sonnenUntergangLichtCallback() {
23
23
  var _a;
24
- return (_a = this.LampenGroup) === null || _a === void 0 ? void 0 : _a.sonnenUntergangLichtCallback;
24
+ return (_a = this.LightGroup) === null || _a === void 0 ? void 0 : _a.sonnenUntergangLichtCallback;
25
25
  }
26
26
  get sonnenAufgangLichtCallback() {
27
27
  var _a;
28
- return (_a = this.LampenGroup) === null || _a === void 0 ? void 0 : _a.sonnenAufgangLichtCallback;
28
+ return (_a = this.LightGroup) === null || _a === void 0 ? void 0 : _a.sonnenAufgangLichtCallback;
29
29
  }
30
30
  get sunriseShutterCallback() {
31
31
  var _a;
@@ -54,7 +54,7 @@ class RoomBase {
54
54
  get PraesenzGroup() {
55
55
  return this.groupMap.get(server_1.GroupType.Presence);
56
56
  }
57
- get LampenGroup() {
57
+ get LightGroup() {
58
58
  return this.groupMap.get(server_1.GroupType.Light);
59
59
  }
60
60
  get TasterGroup() {
@@ -84,7 +84,7 @@ class RoomBase {
84
84
  this.recalcTimeCallbacks();
85
85
  (_a = this.PraesenzGroup) === null || _a === void 0 ? void 0 : _a.initCallbacks();
86
86
  (_b = this.WindowGroup) === null || _b === void 0 ? void 0 : _b.initialize();
87
- (_c = this.LampenGroup) === null || _c === void 0 ? void 0 : _c.initialize();
87
+ (_c = this.LightGroup) === null || _c === void 0 ? void 0 : _c.initialize();
88
88
  (_d = this.TasterGroup) === null || _d === void 0 ? void 0 : _d.initCallbacks();
89
89
  (_e = this.HeatGroup) === null || _e === void 0 ? void 0 : _e.initialize();
90
90
  }
@@ -95,7 +95,7 @@ class RoomBase {
95
95
  recalcTimeCallbacks() {
96
96
  var _a, _b;
97
97
  (_a = this.WindowGroup) === null || _a === void 0 ? void 0 : _a.recalcTimeCallbacks();
98
- (_b = this.LampenGroup) === null || _b === void 0 ? void 0 : _b.recalcTimeCallbacks();
98
+ (_b = this.LightGroup) === null || _b === void 0 ? void 0 : _b.recalculateTimeCallbacks();
99
99
  }
100
100
  /**
101
101
  * Sets the light based on the current time, rollo Position and room Settings
@@ -103,13 +103,13 @@ class RoomBase {
103
103
  */
104
104
  setLightTimeBased(movementDependant = false) {
105
105
  var _a, _b;
106
- if (!this.LampenGroup) {
106
+ if (!this.LightGroup) {
107
107
  this.log(logLevel_1.LogLevel.Trace, 'Ignore "setLightTimeBased" as we have no lamps');
108
108
  return;
109
109
  }
110
110
  if (movementDependant && this.PraesenzGroup && !((_a = this.PraesenzGroup) === null || _a === void 0 ? void 0 : _a.anyPresent())) {
111
111
  this.log(logLevel_1.LogLevel.Trace, 'Turn off lights as no-one is present.');
112
- this.LampenGroup.switchAll(false);
112
+ this.LightGroup.switchAll(false);
113
113
  return;
114
114
  }
115
115
  if (!this.settings.lampOffset && !this.settings.roomIsAlwaysDark) {
@@ -126,7 +126,7 @@ class RoomBase {
126
126
  })))) {
127
127
  timeOfDay = server_1.Utils.nowTime().hours > 16 ? timeCallback_1.TimeOfDay.AfterSunset : timeCallback_1.TimeOfDay.BeforeSunrise;
128
128
  }
129
- this.LampenGroup.switchTimeConditional(timeOfDay);
129
+ this.LightGroup.switchTimeConditional(timeOfDay);
130
130
  }
131
131
  isNowLightTime() {
132
132
  var _a;
@@ -3,7 +3,7 @@ export * from './Window';
3
3
  export * from './windowGroup';
4
4
  export * from './group-type';
5
5
  export * from './heatGroup';
6
- export * from './lampenGroup';
6
+ export * from './lightGroup';
7
7
  export * from './presenceGroup';
8
8
  export * from './smokeGroup';
9
9
  export * from './speakerGroup';
@@ -19,7 +19,7 @@ __exportStar(require("./Window"), exports);
19
19
  __exportStar(require("./windowGroup"), exports);
20
20
  __exportStar(require("./group-type"), exports);
21
21
  __exportStar(require("./heatGroup"), exports);
22
- __exportStar(require("./lampenGroup"), exports);
22
+ __exportStar(require("./lightGroup"), exports);
23
23
  __exportStar(require("./presenceGroup"), exports);
24
24
  __exportStar(require("./smokeGroup"), exports);
25
25
  __exportStar(require("./speakerGroup"), exports);
@@ -3,15 +3,15 @@ import { iActuator, iLamp } from '../baseDeviceInterfaces';
3
3
  import { TimeCallback, TimeOfDay } from '../../../models';
4
4
  import { WledDevice } from '../wledDevice';
5
5
  import { iLedRgbCct } from '../baseDeviceInterfaces/iLedRgbCct';
6
- export declare class LampenGroup extends BaseGroup {
6
+ export declare class LightGroup extends BaseGroup {
7
7
  sonnenAufgangLichtCallback: TimeCallback | undefined;
8
8
  sonnenUntergangLichtCallback: TimeCallback | undefined;
9
9
  constructor(roomName: string, lampenIds?: string[], steckerIds?: string[], ledIds?: string[], wledIds?: string[]);
10
10
  anyLightsOn(): boolean;
11
- getLampen(): iLamp[];
11
+ getLights(): iLamp[];
12
12
  getLED(): iLedRgbCct[];
13
13
  getWled(): WledDevice[];
14
- getStecker(): iActuator[];
14
+ getOutlets(): iActuator[];
15
15
  handleSunriseOff(): void;
16
16
  switchAll(target: boolean, force?: boolean): void;
17
17
  switchTimeConditional(time: TimeOfDay): void;
@@ -20,8 +20,8 @@ export declare class LampenGroup extends BaseGroup {
20
20
  setAllLED(pValue: boolean, brightness?: number, color?: string, colortemp?: number): void;
21
21
  setAllWled(pValue: boolean, brightness?: number, preset?: number): void;
22
22
  initialize(): void;
23
- recalcTimeCallbacks(): void;
24
- toJSON(): Partial<LampenGroup>;
23
+ recalculateTimeCallbacks(): void;
24
+ toJSON(): Partial<LightGroup>;
25
25
  private reconfigureSunriseTimeCallback;
26
26
  private reconfigureSunsetTimeCallback;
27
27
  }
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.LampenGroup = void 0;
6
+ exports.LightGroup = void 0;
7
7
  const services_1 = require("../../services");
8
8
  const base_group_1 = require("./base-group");
9
9
  const group_type_1 = require("./group-type");
@@ -11,7 +11,7 @@ const device_cluster_type_1 = require("../device-cluster-type");
11
11
  const device_list_1 = require("../device-list");
12
12
  const models_1 = require("../../../models");
13
13
  const lodash_1 = __importDefault(require("lodash"));
14
- class LampenGroup extends base_group_1.BaseGroup {
14
+ class LightGroup extends base_group_1.BaseGroup {
15
15
  constructor(roomName, lampenIds = [], steckerIds = [], ledIds = [], wledIds = []) {
16
16
  super(roomName, group_type_1.GroupType.Light);
17
17
  this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.Lamps, new device_list_1.DeviceList(lampenIds));
@@ -21,8 +21,8 @@ class LampenGroup extends base_group_1.BaseGroup {
21
21
  }
22
22
  anyLightsOn() {
23
23
  let i;
24
- for (i = 0; i < this.getLampen().length; i++) {
25
- if (this.getLampen()[i].lightOn) {
24
+ for (i = 0; i < this.getLights().length; i++) {
25
+ if (this.getLights()[i].lightOn) {
26
26
  return true;
27
27
  }
28
28
  }
@@ -31,8 +31,8 @@ class LampenGroup extends base_group_1.BaseGroup {
31
31
  return true;
32
32
  }
33
33
  }
34
- for (i = 0; i < this.getStecker().length; i++) {
35
- if (this.getStecker()[i].actuatorOn) {
34
+ for (i = 0; i < this.getOutlets().length; i++) {
35
+ if (this.getOutlets()[i].actuatorOn) {
36
36
  return true;
37
37
  }
38
38
  }
@@ -43,7 +43,7 @@ class LampenGroup extends base_group_1.BaseGroup {
43
43
  }
44
44
  return false;
45
45
  }
46
- getLampen() {
46
+ getLights() {
47
47
  return this.deviceCluster.getDevicesByType(device_cluster_type_1.DeviceClusterType.Lamps);
48
48
  }
49
49
  getLED() {
@@ -52,7 +52,7 @@ class LampenGroup extends base_group_1.BaseGroup {
52
52
  getWled() {
53
53
  return this.deviceCluster.getIoBrokerDevicesByType(device_cluster_type_1.DeviceClusterType.WLED);
54
54
  }
55
- getStecker() {
55
+ getOutlets() {
56
56
  return this.deviceCluster.getDevicesByType(device_cluster_type_1.DeviceClusterType.Outlets);
57
57
  }
58
58
  handleSunriseOff() {
@@ -88,7 +88,7 @@ class LampenGroup extends base_group_1.BaseGroup {
88
88
  s.setTimeBased(time);
89
89
  });
90
90
  }
91
- else if (this.getStecker().length > 0) {
91
+ else if (this.getOutlets().length > 0) {
92
92
  this.log(models_1.LogLevel.Trace, `Set outlets time based for time "${models_1.TimeOfDay[time]}"`);
93
93
  resultSteckdosen = darkOutside;
94
94
  }
@@ -100,7 +100,7 @@ class LampenGroup extends base_group_1.BaseGroup {
100
100
  this.setAllStecker(resultSteckdosen, time);
101
101
  }
102
102
  setAllLampen(pValue, time, force = false, timeout) {
103
- this.getLampen().forEach((s) => {
103
+ this.getLights().forEach((s) => {
104
104
  if (!pValue ||
105
105
  time === undefined ||
106
106
  (time === models_1.TimeOfDay.Night && s.settings.nightOn) ||
@@ -117,7 +117,7 @@ class LampenGroup extends base_group_1.BaseGroup {
117
117
  });
118
118
  }
119
119
  setAllStecker(pValue, time, force = false) {
120
- this.getStecker().forEach((s) => {
120
+ this.getOutlets().forEach((s) => {
121
121
  if (!pValue ||
122
122
  time === undefined ||
123
123
  (time === models_1.TimeOfDay.Night && s.settings.nightOn) ||
@@ -139,9 +139,9 @@ class LampenGroup extends base_group_1.BaseGroup {
139
139
  });
140
140
  }
141
141
  initialize() {
142
- this.recalcTimeCallbacks();
142
+ this.recalculateTimeCallbacks();
143
143
  }
144
- recalcTimeCallbacks() {
144
+ recalculateTimeCallbacks() {
145
145
  this.reconfigureSunriseTimeCallback();
146
146
  this.reconfigureSunsetTimeCallback();
147
147
  }
@@ -200,4 +200,4 @@ class LampenGroup extends base_group_1.BaseGroup {
200
200
  }
201
201
  }
202
202
  }
203
- exports.LampenGroup = LampenGroup;
203
+ exports.LightGroup = LightGroup;
@@ -35,7 +35,7 @@ class PresenceGroup extends base_group_1.BaseGroup {
35
35
  });
36
36
  this.addLastLeftCallback(() => {
37
37
  var _a;
38
- (_a = this.getRoom().LampenGroup) === null || _a === void 0 ? void 0 : _a.switchAll(false);
38
+ (_a = this.getRoom().LightGroup) === null || _a === void 0 ? void 0 : _a.switchAll(false);
39
39
  });
40
40
  this.addFirstEnterCallback(() => {
41
41
  if (!this.getRoom().settings.lampenBeiBewegung) {
@@ -39,11 +39,11 @@ class TasterGroup extends base_group_1.BaseGroup {
39
39
  }, `All Rollos in this room to middle`);
40
40
  (_e = t.buttonMidLeft) === null || _e === void 0 ? void 0 : _e.addCb(button_1.ButtonPressType.long, (pValue) => {
41
41
  var _a;
42
- pValue && ((_a = this.getRoom().LampenGroup) === null || _a === void 0 ? void 0 : _a.switchAll(true, true));
42
+ pValue && ((_a = this.getRoom().LightGroup) === null || _a === void 0 ? void 0 : _a.switchAll(true, true));
43
43
  }, `Turn all Lights in this room on`);
44
44
  (_f = t.buttonMidRight) === null || _f === void 0 ? void 0 : _f.addCb(button_1.ButtonPressType.long, (pValue) => {
45
45
  var _a;
46
- pValue && ((_a = this.getRoom().LampenGroup) === null || _a === void 0 ? void 0 : _a.switchAll(false, true));
46
+ pValue && ((_a = this.getRoom().LightGroup) === null || _a === void 0 ? void 0 : _a.switchAll(false, true));
47
47
  }, `Turn all Lights in this room off`);
48
48
  if (((_g = services_1.SettingsService.settings.sonos) === null || _g === void 0 ? void 0 : _g.buttonBotRightForRadio) === true) {
49
49
  const sonosGroup = this.getRoom().SonosGroup;
@@ -113,7 +113,7 @@ class WindowGroup extends base_group_1.BaseGroup {
113
113
  this.allRolloToLevel(0, true);
114
114
  const room = this.getRoom();
115
115
  if (((_a = room.PraesenzGroup) === null || _a === void 0 ? void 0 : _a.anyPresent()) && room.settings.lampOffset) {
116
- (_b = room.LampenGroup) === null || _b === void 0 ? void 0 : _b.switchTimeConditional(services_1.TimeCallbackService.dayType(room.settings.lampOffset));
116
+ (_b = room.LightGroup) === null || _b === void 0 ? void 0 : _b.switchTimeConditional(services_1.TimeCallbackService.dayType(room.settings.lampOffset));
117
117
  }
118
118
  }
119
119
  reconfigureSunsetShutterCallback() {
@@ -39,10 +39,10 @@ class RoomService {
39
39
  log_service_1.ServerLogService.writeLog(models_1.LogLevel.Info, `Schalte alle Lampen in Etage ${floor} auf den Wert ${status}`);
40
40
  const rooms = floor > -1 ? this.getAllRoomsOfFloor(floor) : this.Rooms.entries();
41
41
  for (const [_name, room] of rooms) {
42
- (_a = room.LampenGroup) === null || _a === void 0 ? void 0 : _a.setAllLampen(status, -1, true, timeout);
43
- (_b = room.LampenGroup) === null || _b === void 0 ? void 0 : _b.setAllLED(status);
44
- (_c = room.LampenGroup) === null || _c === void 0 ? void 0 : _c.setAllStecker(status, -1, true);
45
- (_d = room.LampenGroup) === null || _d === void 0 ? void 0 : _d.setAllWled(status);
42
+ (_a = room.LightGroup) === null || _a === void 0 ? void 0 : _a.setAllLampen(status, -1, true, timeout);
43
+ (_b = room.LightGroup) === null || _b === void 0 ? void 0 : _b.setAllLED(status);
44
+ (_c = room.LightGroup) === null || _c === void 0 ? void 0 : _c.setAllStecker(status, -1, true);
45
+ (_d = room.LightGroup) === null || _d === void 0 ? void 0 : _d.setAllWled(status);
46
46
  }
47
47
  }
48
48
  static clearAllAlarms() {