hoffmation-base 2.19.4 → 2.19.5
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.
|
@@ -13,6 +13,7 @@ export declare class LightGroup extends BaseGroup {
|
|
|
13
13
|
getLED(): iLedRgbCct[];
|
|
14
14
|
getWled(): WledDevice[];
|
|
15
15
|
getOutlets(): iActuator[];
|
|
16
|
+
getAllAsActuator(): iActuator[];
|
|
16
17
|
handleSunriseOff(): void;
|
|
17
18
|
switchAll(target: boolean, force?: boolean): void;
|
|
18
19
|
switchTimeConditional(time: TimeOfDay): void;
|
|
@@ -52,6 +52,14 @@ class LightGroup extends base_group_1.BaseGroup {
|
|
|
52
52
|
getOutlets() {
|
|
53
53
|
return this.deviceCluster.getDevicesByType(device_cluster_type_1.DeviceClusterType.Outlets);
|
|
54
54
|
}
|
|
55
|
+
getAllAsActuator() {
|
|
56
|
+
const result = [];
|
|
57
|
+
result.push(...this.getLights());
|
|
58
|
+
result.push(...this.getOutlets());
|
|
59
|
+
result.push(...this.getLED());
|
|
60
|
+
result.push(...this.getWled());
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
55
63
|
handleSunriseOff() {
|
|
56
64
|
if (!this.anyLightsOn()) {
|
|
57
65
|
return;
|
|
@@ -60,17 +68,12 @@ class LightGroup extends base_group_1.BaseGroup {
|
|
|
60
68
|
this.switchAll(false);
|
|
61
69
|
}
|
|
62
70
|
switchAll(target, force = false) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
this.getLED().forEach((s) => {
|
|
70
|
-
s.setLight(target);
|
|
71
|
-
});
|
|
72
|
-
this.getWled().forEach((wled) => {
|
|
73
|
-
wled.setLight(target);
|
|
71
|
+
this.getAllAsActuator().forEach((a) => {
|
|
72
|
+
if (a.settings.includeInAmbientLight && !force && !target && this._ambientLightOn) {
|
|
73
|
+
a.log(models_1.LogLevel.Info, `Ambient light mode is active --> Skip non force light off command in ${this.roomName}`);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
a.setActuator(target, undefined, force);
|
|
74
77
|
});
|
|
75
78
|
}
|
|
76
79
|
switchTimeConditional(time) {
|
|
@@ -193,24 +196,9 @@ class LightGroup extends base_group_1.BaseGroup {
|
|
|
193
196
|
ambientLightStartCallback() {
|
|
194
197
|
this._ambientLightOn = true;
|
|
195
198
|
this.log(models_1.LogLevel.Info, `Draußen wird es dunkel --> Aktiviere Ambientenbeleuchtung`);
|
|
196
|
-
this.
|
|
197
|
-
if (
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
this.getOutlets().forEach((o) => {
|
|
202
|
-
if (o.settings.includeInAmbientLight) {
|
|
203
|
-
o.setActuator(true);
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
this.getLED().forEach((s) => {
|
|
207
|
-
if (s.settings.includeInAmbientLight) {
|
|
208
|
-
s.setLight(true, -1, false);
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
this.getWled().forEach((wled) => {
|
|
212
|
-
if (wled.settings.includeInAmbientLight) {
|
|
213
|
-
wled.setLight(true);
|
|
199
|
+
this.getAllAsActuator().forEach((a) => {
|
|
200
|
+
if (a.settings.includeInAmbientLight) {
|
|
201
|
+
a.setActuator(true);
|
|
214
202
|
}
|
|
215
203
|
});
|
|
216
204
|
services_1.Utils.guardedTimeout(() => {
|