hoffmation-base 3.0.0-alpha.11 → 3.0.0-alpha.12
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.
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ActuatorWriteStateToDeviceCommand = void 0;
|
|
4
4
|
const baseCommand_1 = require("./baseCommand");
|
|
5
5
|
const commandType_1 = require("./commandType");
|
|
6
|
+
const actuatorSetStateCommand_1 = require("./actuatorSetStateCommand");
|
|
6
7
|
class ActuatorWriteStateToDeviceCommand extends baseCommand_1.BaseCommand {
|
|
7
8
|
constructor(source, stateValue, reason = '') {
|
|
8
9
|
super(source, reason);
|
|
@@ -10,6 +11,9 @@ class ActuatorWriteStateToDeviceCommand extends baseCommand_1.BaseCommand {
|
|
|
10
11
|
this._commandType = commandType_1.CommandType.ActuatorWriteStateToDeviceCommand;
|
|
11
12
|
}
|
|
12
13
|
get logMessage() {
|
|
14
|
+
if (this.source instanceof actuatorSetStateCommand_1.ActuatorSetStateCommand) {
|
|
15
|
+
return `Actuator Write StateToDevice original Log-message: ${this.source.logMessage}`;
|
|
16
|
+
}
|
|
13
17
|
return `Actuator writeStateToDevice(${this.stateValue}) for reason: ${this.reasonTrace}`;
|
|
14
18
|
}
|
|
15
19
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseGroup } from './base-group';
|
|
2
2
|
import { iActuator, iLamp } from '../baseDeviceInterfaces';
|
|
3
|
-
import { ActuatorSetStateCommand, LampSetLightCommand, LampSetTimeBasedCommand, LedSetLightCommand, LightGroupSwitchTimeConditionalCommand, TimeCallback,
|
|
3
|
+
import { ActuatorSetStateCommand, LampSetLightCommand, LampSetTimeBasedCommand, LedSetLightCommand, LightGroupSwitchTimeConditionalCommand, TimeCallback, WledSetLightCommand } from '../../../models';
|
|
4
4
|
import { WledDevice } from '../wledDevice';
|
|
5
5
|
import { iLedRgbCct } from '../baseDeviceInterfaces/iLedRgbCct';
|
|
6
6
|
export declare class LightGroup extends BaseGroup {
|
|
@@ -20,7 +20,7 @@ export declare class LightGroup extends BaseGroup {
|
|
|
20
20
|
setAllLampen(c: LampSetLightCommand): void;
|
|
21
21
|
setAllLampenTimeBased(c: LampSetTimeBasedCommand): void;
|
|
22
22
|
setAllOutlets(c: ActuatorSetStateCommand): void;
|
|
23
|
-
setAllActuatorsTimeBased(
|
|
23
|
+
setAllActuatorsTimeBased(c: LampSetTimeBasedCommand): void;
|
|
24
24
|
setAllLED(c: LedSetLightCommand): void;
|
|
25
25
|
setAllWled(c: WledSetLightCommand): void;
|
|
26
26
|
initialize(): void;
|
|
@@ -106,16 +106,16 @@ class LightGroup extends base_group_1.BaseGroup {
|
|
|
106
106
|
resultLampen = darkOutside;
|
|
107
107
|
}
|
|
108
108
|
if (resultLampen) {
|
|
109
|
-
this.setAllLampenTimeBased(new models_1.LampSetTimeBasedCommand(c, c.time
|
|
109
|
+
this.setAllLampenTimeBased(new models_1.LampSetTimeBasedCommand(c, c.time));
|
|
110
110
|
}
|
|
111
111
|
else {
|
|
112
|
-
this.setAllLampen(new models_1.LampSetLightCommand(c, false
|
|
112
|
+
this.setAllLampen(new models_1.LampSetLightCommand(c, false));
|
|
113
113
|
}
|
|
114
114
|
if (resultSteckdosen) {
|
|
115
|
-
this.setAllActuatorsTimeBased(c.time);
|
|
115
|
+
this.setAllActuatorsTimeBased(new models_1.LampSetTimeBasedCommand(c, c.time));
|
|
116
116
|
}
|
|
117
117
|
else {
|
|
118
|
-
this.setAllOutlets(new models_1.ActuatorSetStateCommand(c, false
|
|
118
|
+
this.setAllOutlets(new models_1.ActuatorSetStateCommand(c, false));
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
setAllLampen(c) {
|
|
@@ -133,12 +133,12 @@ class LightGroup extends base_group_1.BaseGroup {
|
|
|
133
133
|
s.setActuator(c);
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
|
-
setAllActuatorsTimeBased(
|
|
136
|
+
setAllActuatorsTimeBased(c) {
|
|
137
137
|
this.getOutlets().forEach((s) => {
|
|
138
|
-
if ((time === models_1.TimeOfDay.Night && s.settings.nightOn) ||
|
|
139
|
-
(time === models_1.TimeOfDay.BeforeSunrise && s.settings.dawnOn) ||
|
|
140
|
-
(time === models_1.TimeOfDay.AfterSunset && s.settings.duskOn)) {
|
|
141
|
-
s.setActuator(new models_1.ActuatorSetStateCommand(
|
|
138
|
+
if ((c.time === models_1.TimeOfDay.Night && s.settings.nightOn) ||
|
|
139
|
+
(c.time === models_1.TimeOfDay.BeforeSunrise && s.settings.dawnOn) ||
|
|
140
|
+
(c.time === models_1.TimeOfDay.AfterSunset && s.settings.duskOn)) {
|
|
141
|
+
s.setActuator(new models_1.ActuatorSetStateCommand(c, true, `LightGroup setAllActuatorsTimeBased`, c.timeout));
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
144
|
}
|