hoffmation-base 3.0.0-alpha.17 → 3.0.0-alpha.18
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.
|
@@ -67,18 +67,21 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
|
|
|
67
67
|
c.brightness = 10;
|
|
68
68
|
}
|
|
69
69
|
this.queuedValue = c.on;
|
|
70
|
-
if (c.
|
|
71
|
-
|
|
70
|
+
if (!c.on) {
|
|
71
|
+
this.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c, c.on, 'WLED ausschalten'));
|
|
72
|
+
}
|
|
73
|
+
else if (c.preset !== undefined) {
|
|
74
|
+
// This also turns the device on
|
|
72
75
|
this.setState(this._presetID, c.preset, undefined, (err) => {
|
|
73
76
|
services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `WLED schalten ergab Fehler: ${err}`);
|
|
74
77
|
});
|
|
75
78
|
}
|
|
76
79
|
else if (c.brightness > -1) {
|
|
80
|
+
// This also turns the device on
|
|
77
81
|
this.setState(this._brightnessID, c.brightness, undefined, (err) => {
|
|
78
82
|
services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `Dimmer Helligkeit schalten ergab Fehler: ${err}`);
|
|
79
83
|
});
|
|
80
84
|
}
|
|
81
|
-
this.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c, c.on, 'WLED Schalten'));
|
|
82
85
|
if (c.timeout !== undefined && c.timeout > -1 && !dontBlock) {
|
|
83
86
|
this.blockAutomationHandler.disableAutomatic(c.timeout, models_1.CollisionSolving.overrideIfGreater);
|
|
84
87
|
}
|