hoffmation-base 2.22.7 → 2.22.9
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.
- package/lib/models/rooms/RoomSettings/RoomSettingsController.d.ts +1 -0
- package/lib/models/rooms/RoomSettings/RoomSettingsController.js +3 -0
- package/lib/models/rooms/RoomSettings/iRoomDefaultSettings.d.ts +1 -0
- package/lib/models/rooms/RoomSettings/roomSettings.d.ts +1 -0
- package/lib/models/rooms/RoomSettings/roomSettings.js +4 -1
- package/lib/server/devices/groups/lightGroup.js +1 -1
- package/lib/server/services/api/api-service.js +20 -0
- package/lib/server/services/settings-service.js +1 -0
- package/lib/server/services/utils/utils.js +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
|
@@ -26,6 +26,7 @@ export declare class RoomSettingsController implements iRoomDefaultSettings {
|
|
|
26
26
|
get sonnenAufgangLampenDelay(): number;
|
|
27
27
|
get roomIsAlwaysDark(): boolean;
|
|
28
28
|
get radioUrl(): string;
|
|
29
|
+
get includeLampsInNormalMovementLightning(): boolean;
|
|
29
30
|
get room(): RoomBase | undefined;
|
|
30
31
|
toJSON(): Partial<RoomSettingsController>;
|
|
31
32
|
private onSettingChange;
|
|
@@ -77,6 +77,9 @@ class RoomSettingsController {
|
|
|
77
77
|
get radioUrl() {
|
|
78
78
|
return this._settingsContainer.radioUrl;
|
|
79
79
|
}
|
|
80
|
+
get includeLampsInNormalMovementLightning() {
|
|
81
|
+
return this._settingsContainer.includeLampsInNormalMovementLightning;
|
|
82
|
+
}
|
|
80
83
|
get room() {
|
|
81
84
|
if (!this.roomName) {
|
|
82
85
|
return undefined;
|
|
@@ -18,5 +18,6 @@ export declare class RoomSettings extends ObjectSettings {
|
|
|
18
18
|
sonnenUntergangRolloDelay: number;
|
|
19
19
|
sonnenUntergangLampenDelay: number;
|
|
20
20
|
sonnenUntergangRollos: boolean;
|
|
21
|
+
includeLampsInNormalMovementLightning: boolean;
|
|
21
22
|
fromPartialObject(_obj: Partial<RoomSettings>): void;
|
|
22
23
|
}
|
|
@@ -24,9 +24,10 @@ class RoomSettings extends objectSettings_1.ObjectSettings {
|
|
|
24
24
|
this.sonnenUntergangRolloDelay = server_1.SettingsService.settings.roomDefault.sonnenUntergangRolloDelay;
|
|
25
25
|
this.sonnenUntergangLampenDelay = server_1.SettingsService.settings.roomDefault.sonnenUntergangLampenDelay;
|
|
26
26
|
this.sonnenUntergangRollos = server_1.SettingsService.settings.roomDefault.sonnenUntergangRollos;
|
|
27
|
+
this.includeLampsInNormalMovementLightning = server_1.SettingsService.settings.roomDefault.includeLampsInNormalMovementLightning;
|
|
27
28
|
}
|
|
28
29
|
fromPartialObject(_obj) {
|
|
29
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
30
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
30
31
|
this.ambientLightAfterSunset = (_a = _obj.ambientLightAfterSunset) !== null && _a !== void 0 ? _a : this.ambientLightAfterSunset;
|
|
31
32
|
this.lichtSonnenAufgangAus = (_b = _obj.lichtSonnenAufgangAus) !== null && _b !== void 0 ? _b : this.lichtSonnenAufgangAus;
|
|
32
33
|
this.radioUrl = (_c = _obj.radioUrl) !== null && _c !== void 0 ? _c : this.radioUrl;
|
|
@@ -45,6 +46,8 @@ class RoomSettings extends objectSettings_1.ObjectSettings {
|
|
|
45
46
|
this.sonnenUntergangRolloDelay = (_q = _obj.sonnenUntergangRolloDelay) !== null && _q !== void 0 ? _q : this.sonnenUntergangRolloDelay;
|
|
46
47
|
this.sonnenUntergangLampenDelay = (_r = _obj.sonnenUntergangLampenDelay) !== null && _r !== void 0 ? _r : this.sonnenUntergangLampenDelay;
|
|
47
48
|
this.sonnenUntergangRollos = (_s = _obj.sonnenUntergangRollos) !== null && _s !== void 0 ? _s : this.sonnenUntergangRollos;
|
|
49
|
+
this.includeLampsInNormalMovementLightning =
|
|
50
|
+
(_t = _obj.includeLampsInNormalMovementLightning) !== null && _t !== void 0 ? _t : this.includeLampsInNormalMovementLightning;
|
|
48
51
|
super.fromPartialObject(_obj);
|
|
49
52
|
}
|
|
50
53
|
}
|
|
@@ -100,7 +100,7 @@ class LightGroup extends base_group_1.BaseGroup {
|
|
|
100
100
|
this.log(models_1.LogLevel.Trace, `Set outlets time based for time "${models_1.TimeOfDay[time]}"`);
|
|
101
101
|
resultSteckdosen = darkOutside;
|
|
102
102
|
}
|
|
103
|
-
if (activatedGroups === 0) {
|
|
103
|
+
if (activatedGroups === 0 || this.getRoom().settings.includeLampsInNormalMovementLightning) {
|
|
104
104
|
this.log(models_1.LogLevel.Trace, `Set Lamps time based for time "${models_1.TimeOfDay[time]}"`);
|
|
105
105
|
resultLampen = darkOutside;
|
|
106
106
|
}
|
|
@@ -23,6 +23,7 @@ class API {
|
|
|
23
23
|
if (!d.deviceCapabilities.includes(DeviceCapability_1.DeviceCapability.scene)) {
|
|
24
24
|
return new Error(`Device with ID ${deviceId} is no scene`);
|
|
25
25
|
}
|
|
26
|
+
d.log(models_1.LogLevel.Info, `API Call to end this.`);
|
|
26
27
|
d.endScene();
|
|
27
28
|
return null;
|
|
28
29
|
}
|
|
@@ -92,6 +93,7 @@ class API {
|
|
|
92
93
|
desiredMode = settings_service_1.SettingsService.heatMode == config_1.HeatingMode.Winter ? ac_1.AcMode.Heating : ac_1.AcMode.Cooling;
|
|
93
94
|
}
|
|
94
95
|
}
|
|
96
|
+
d.log(models_1.LogLevel.Info, `API Call to set AC to ${desiredState} with mode ${desiredMode} for ${forceTime}ms`);
|
|
95
97
|
d.setState(desiredMode, desiredTemperature, forceTime);
|
|
96
98
|
return true;
|
|
97
99
|
}
|
|
@@ -101,6 +103,7 @@ class API {
|
|
|
101
103
|
*/
|
|
102
104
|
static setAllAc(desiredState) {
|
|
103
105
|
ac_1.DaikinService.setAll(desiredState, true);
|
|
106
|
+
log_service_1.ServerLogService.writeLog(models_1.LogLevel.Info, `API Call to set all AC´s to ${desiredState}`);
|
|
104
107
|
}
|
|
105
108
|
/**
|
|
106
109
|
* Changes the status of a given Lamp
|
|
@@ -117,6 +120,7 @@ class API {
|
|
|
117
120
|
if (!d.deviceCapabilities.includes(DeviceCapability_1.DeviceCapability.lamp)) {
|
|
118
121
|
return new Error(`Device with ID ${deviceId} is no Lamp`);
|
|
119
122
|
}
|
|
123
|
+
d.log(models_1.LogLevel.Info, `API Call to set Lamp to ${state} for ${timeout}ms`);
|
|
120
124
|
d.setLight(state, timeout, true);
|
|
121
125
|
return null;
|
|
122
126
|
}
|
|
@@ -135,6 +139,7 @@ class API {
|
|
|
135
139
|
if (!d.deviceCapabilities.includes(DeviceCapability_1.DeviceCapability.actuator)) {
|
|
136
140
|
return new Error(`Device with ID ${deviceId} is no actuator`);
|
|
137
141
|
}
|
|
142
|
+
d.log(models_1.LogLevel.Info, `API Call to set Actuator to ${state} for ${timeout}ms`);
|
|
138
143
|
d.setActuator(state, timeout, true);
|
|
139
144
|
return null;
|
|
140
145
|
}
|
|
@@ -155,6 +160,7 @@ class API {
|
|
|
155
160
|
if (!d.deviceCapabilities.includes(DeviceCapability_1.DeviceCapability.dimmablelamp)) {
|
|
156
161
|
return new Error(`Device with ID ${deviceId} is no dimmablelamp`);
|
|
157
162
|
}
|
|
163
|
+
d.log(models_1.LogLevel.Info, `API Call to set Dimmer to ${state} with brightness ${brightness} for ${timeout}ms`);
|
|
158
164
|
d.setLight(state, timeout, true, brightness, transitionTime);
|
|
159
165
|
return null;
|
|
160
166
|
}
|
|
@@ -177,6 +183,7 @@ class API {
|
|
|
177
183
|
if (!d.deviceCapabilities.includes(DeviceCapability_1.DeviceCapability.ledLamp)) {
|
|
178
184
|
return new Error(`Device with ID ${deviceId} is no dimmablelamp`);
|
|
179
185
|
}
|
|
186
|
+
d.log(models_1.LogLevel.Info, `API Call to set LED to ${state} with brightness ${brightness} and color ${color} for ${timeout}ms`);
|
|
180
187
|
d.setLight(state, timeout, true, brightness, transitionTime, color, colorTemp);
|
|
181
188
|
return null;
|
|
182
189
|
}
|
|
@@ -202,6 +209,7 @@ class API {
|
|
|
202
209
|
else {
|
|
203
210
|
d.setLevel(level, false);
|
|
204
211
|
}
|
|
212
|
+
d.log(models_1.LogLevel.Info, `API Call to set Shutter to ${level}`);
|
|
205
213
|
return null;
|
|
206
214
|
}
|
|
207
215
|
static speakOnDevice(deviceId, message, volume = 30) {
|
|
@@ -212,6 +220,7 @@ class API {
|
|
|
212
220
|
if (!d.deviceCapabilities.includes(DeviceCapability_1.DeviceCapability.speaker)) {
|
|
213
221
|
return new Error(`Device with ID ${deviceId} is no speaker`);
|
|
214
222
|
}
|
|
223
|
+
d.log(models_1.LogLevel.Info, `API Call to speak "${message}" on device with volume ${volume}`);
|
|
215
224
|
d.speakOnDevice(message, volume);
|
|
216
225
|
return null;
|
|
217
226
|
}
|
|
@@ -229,6 +238,7 @@ class API {
|
|
|
229
238
|
if (!d.deviceCapabilities.includes(DeviceCapability_1.DeviceCapability.scene)) {
|
|
230
239
|
return new Error(`Device with ID ${deviceId} is no scene`);
|
|
231
240
|
}
|
|
241
|
+
d.log(models_1.LogLevel.Info, `API Call to start this.`);
|
|
232
242
|
d.startScene(turnOffTimeout);
|
|
233
243
|
return null;
|
|
234
244
|
}
|
|
@@ -241,9 +251,11 @@ class API {
|
|
|
241
251
|
return new Error(`Device with ID ${deviceId} is no Garage Door Opener`);
|
|
242
252
|
}
|
|
243
253
|
if (open) {
|
|
254
|
+
d.log(models_1.LogLevel.Info, `API Call to open Garage Door`);
|
|
244
255
|
d.open();
|
|
245
256
|
}
|
|
246
257
|
else {
|
|
258
|
+
d.log(models_1.LogLevel.Info, `API Call to close Garage Door`);
|
|
247
259
|
d.close();
|
|
248
260
|
}
|
|
249
261
|
return null;
|
|
@@ -262,6 +274,7 @@ class API {
|
|
|
262
274
|
if (d.settings === undefined) {
|
|
263
275
|
return new Error(`Device with ID ${deviceId} has no settings`);
|
|
264
276
|
}
|
|
277
|
+
d.log(models_1.LogLevel.Info, `API Call to change settings to ${JSON.stringify(settings)})}`);
|
|
265
278
|
d.settings.fromPartialObject(settings);
|
|
266
279
|
d.settings.persist(d);
|
|
267
280
|
return null;
|
|
@@ -274,6 +287,7 @@ class API {
|
|
|
274
287
|
if (g.settings === undefined) {
|
|
275
288
|
return new Error(`Group with ID ${groupId} has no settings`);
|
|
276
289
|
}
|
|
290
|
+
g.log(models_1.LogLevel.Info, `API Call to change settings to ${JSON.stringify(settings)})}`);
|
|
277
291
|
g.settings.fromPartialObject(settings);
|
|
278
292
|
g.settings.persist(g);
|
|
279
293
|
return null;
|
|
@@ -289,6 +303,7 @@ class API {
|
|
|
289
303
|
if (r === undefined) {
|
|
290
304
|
return new Error(`Room with ID ${roomName} not found`);
|
|
291
305
|
}
|
|
306
|
+
r.log(models_1.LogLevel.Info, `API Call to change settings to ${JSON.stringify(settings)})}`);
|
|
292
307
|
r.settings.settingsContainer.fromPartialObject(settings);
|
|
293
308
|
r.settings.settingsContainer.persist(r);
|
|
294
309
|
return null;
|
|
@@ -305,11 +320,13 @@ class API {
|
|
|
305
320
|
}
|
|
306
321
|
static persistAllDeviceSettings() {
|
|
307
322
|
var _a;
|
|
323
|
+
log_service_1.ServerLogService.writeLog(models_1.LogLevel.Info, `API Call to persist all device settings`);
|
|
308
324
|
for (const device of Object.values(devices_1.Devices.alLDevices)) {
|
|
309
325
|
(_a = device.settings) === null || _a === void 0 ? void 0 : _a.persist(device);
|
|
310
326
|
}
|
|
311
327
|
}
|
|
312
328
|
static loadAllDeviceSettingsFromDb() {
|
|
329
|
+
log_service_1.ServerLogService.writeLog(models_1.LogLevel.Info, `API Call to load all device settings`);
|
|
313
330
|
for (const device of Object.values(devices_1.Devices.alLDevices)) {
|
|
314
331
|
device.loadDeviceSettings();
|
|
315
332
|
}
|
|
@@ -327,6 +344,7 @@ class API {
|
|
|
327
344
|
if (!d.deviceCapabilities.includes(DeviceCapability_1.DeviceCapability.blockAutomatic)) {
|
|
328
345
|
return new Error(`Device with ID ${deviceId} is not capable of blocking automatic`);
|
|
329
346
|
}
|
|
347
|
+
d.log(models_1.LogLevel.Info, `API Call to lift automatic block`);
|
|
330
348
|
d.blockAutomationHandler.liftAutomaticBlock();
|
|
331
349
|
return null;
|
|
332
350
|
}
|
|
@@ -345,6 +363,7 @@ class API {
|
|
|
345
363
|
if (!d.deviceCapabilities.includes(DeviceCapability_1.DeviceCapability.blockAutomatic)) {
|
|
346
364
|
return new Error(`Device with ID ${deviceId} is not capable of blocking automatic`);
|
|
347
365
|
}
|
|
366
|
+
d.log(models_1.LogLevel.Info, `API Call to block automatic for ${duration}ms with ${onCollision} on collision`);
|
|
348
367
|
d.blockAutomationHandler.disableAutomatic(duration, onCollision);
|
|
349
368
|
return null;
|
|
350
369
|
}
|
|
@@ -356,6 +375,7 @@ class API {
|
|
|
356
375
|
if (!d.deviceCapabilities.includes(DeviceCapability_1.DeviceCapability.buttonSwitch)) {
|
|
357
376
|
return new Error(`Device with ID ${deviceId} is no switch`);
|
|
358
377
|
}
|
|
378
|
+
d.log(models_1.LogLevel.Info, `API Call to press button ${position} with ${pressType}`);
|
|
359
379
|
return d.pressButton(position, pressType);
|
|
360
380
|
}
|
|
361
381
|
}
|
|
@@ -126,6 +126,7 @@ class Utils {
|
|
|
126
126
|
sonnenUntergangRolloAdditionalOffsetPerCloudiness: 0.25,
|
|
127
127
|
lightIfNoWindows: false,
|
|
128
128
|
ambientLightAfterSunset: false,
|
|
129
|
+
includeLampsInNormalMovementLightning: false,
|
|
129
130
|
},
|
|
130
131
|
});
|
|
131
132
|
Translation_1.Res.initialize(settings_service_1.SettingsService.settings.translationSettings);
|