hoffmation-base 2.23.0 → 3.0.0-alpha.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.
- package/lib/models/command/ShutterSetLevelCommand.d.ts +10 -0
- package/lib/models/command/ShutterSetLevelCommand.js +17 -0
- package/lib/models/command/WindowRestoreDesiredPositionCommand.d.ts +7 -0
- package/lib/models/command/WindowRestoreDesiredPositionCommand.js +12 -0
- package/lib/models/command/WindowSetDesiredPositionCommand.d.ts +8 -0
- package/lib/models/command/WindowSetDesiredPositionCommand.js +13 -0
- package/lib/models/command/WindowSetRolloByWeatherStatusCommand.d.ts +7 -0
- package/lib/models/command/WindowSetRolloByWeatherStatusCommand.js +12 -0
- package/lib/models/command/actuatorSetStateCommand.d.ts +13 -0
- package/lib/models/command/actuatorSetStateCommand.js +22 -0
- package/lib/models/command/actuatorToggleCommand.d.ts +8 -0
- package/lib/models/command/actuatorToggleCommand.js +15 -0
- package/lib/models/command/actuatorWriteStateToDeviceCommand.d.ts +9 -0
- package/lib/models/command/actuatorWriteStateToDeviceCommand.js +16 -0
- package/lib/models/command/baseCommand.d.ts +12 -0
- package/lib/models/command/baseCommand.js +34 -0
- package/lib/models/command/commandSource.d.ts +8 -0
- package/lib/models/command/commandSource.js +12 -0
- package/lib/models/command/commandType.d.ts +23 -0
- package/lib/models/command/commandType.js +27 -0
- package/lib/models/command/dimmerSetLightCommand.d.ts +22 -0
- package/lib/models/command/dimmerSetLightCommand.js +40 -0
- package/lib/models/command/floorSetAllShuttersCommand.d.ts +16 -0
- package/lib/models/command/floorSetAllShuttersCommand.js +21 -0
- package/lib/models/command/index.d.ts +24 -0
- package/lib/models/command/index.js +51 -0
- package/lib/models/command/lampSetLightCommand.d.ts +9 -0
- package/lib/models/command/lampSetLightCommand.js +15 -0
- package/lib/models/command/lampSetTimeBasedCommand.d.ts +18 -0
- package/lib/models/command/lampSetTimeBasedCommand.js +25 -0
- package/lib/models/command/lampToggleLightCommand.d.ts +19 -0
- package/lib/models/command/lampToggleLightCommand.js +24 -0
- package/lib/models/command/ledSetLightCommand.d.ts +25 -0
- package/lib/models/command/ledSetLightCommand.js +41 -0
- package/lib/models/command/lightGroupSwitchTimeConditionalCommand.d.ts +9 -0
- package/lib/models/command/lightGroupSwitchTimeConditionalCommand.js +13 -0
- package/lib/models/command/restoreTargetAutomaticValueCommand.d.ts +8 -0
- package/lib/models/command/restoreTargetAutomaticValueCommand.js +15 -0
- package/lib/models/command/roomRestoreLightCommand.d.ts +7 -0
- package/lib/models/command/roomRestoreLightCommand.js +12 -0
- package/lib/models/command/roomRestoreShutterPositionCommand.d.ts +8 -0
- package/lib/models/command/roomRestoreShutterPositionCommand.js +13 -0
- package/lib/models/command/roomSetLightTimeBasedCommand.d.ts +14 -0
- package/lib/models/command/roomSetLightTimeBasedCommand.js +19 -0
- package/lib/models/command/shutterSunriseUpCommand.d.ts +7 -0
- package/lib/models/command/shutterSunriseUpCommand.js +12 -0
- package/lib/models/command/shutterSunsetDownCommand.d.ts +7 -0
- package/lib/models/command/shutterSunsetDownCommand.js +12 -0
- package/lib/models/command/wledSetLightCommand.d.ts +12 -0
- package/lib/models/command/wledSetLightCommand.js +28 -0
- package/lib/models/index.d.ts +1 -0
- package/lib/models/index.js +1 -0
- package/lib/models/rooms/RoomBase.d.ts +2 -2
- package/lib/models/rooms/RoomBase.js +5 -5
- package/lib/models/rooms/iRoomBase.d.ts +2 -5
- package/lib/server/devices/baseDeviceInterfaces/iActuator.d.ts +5 -6
- package/lib/server/devices/baseDeviceInterfaces/iDimmableLamp.d.ts +3 -8
- package/lib/server/devices/baseDeviceInterfaces/iLamp.d.ts +6 -16
- package/lib/server/devices/baseDeviceInterfaces/iLedRgbCct.d.ts +2 -16
- package/lib/server/devices/baseDeviceInterfaces/iShutter.d.ts +2 -2
- package/lib/server/devices/baseDeviceInterfaces/iTemporaryDisableAutomatic.d.ts +2 -1
- package/lib/server/devices/dachs/dachs.d.ts +5 -4
- package/lib/server/devices/dachs/dachs.js +13 -21
- package/lib/server/devices/groups/Window.d.ts +3 -3
- package/lib/server/devices/groups/Window.js +9 -15
- package/lib/server/devices/groups/lightGroup.d.ts +9 -7
- package/lib/server/devices/groups/lightGroup.js +46 -40
- package/lib/server/devices/groups/presenceGroup.js +2 -2
- package/lib/server/devices/groups/tasterGroup.js +22 -6
- package/lib/server/devices/groups/windowGroup.d.ts +5 -7
- package/lib/server/devices/groups/windowGroup.js +25 -43
- package/lib/server/devices/hmIPDevices/hmIpLampe.d.ts +8 -7
- package/lib/server/devices/hmIPDevices/hmIpLampe.js +19 -31
- package/lib/server/devices/hmIPDevices/hmIpRoll.d.ts +2 -2
- package/lib/server/devices/hmIPDevices/hmIpRoll.js +17 -15
- package/lib/server/devices/sharedFunctions/lampUtils.d.ts +8 -7
- package/lib/server/devices/sharedFunctions/lampUtils.js +47 -27
- package/lib/server/devices/wledDevice.d.ts +9 -8
- package/lib/server/devices/wledDevice.js +37 -52
- package/lib/server/devices/zigbee/BaseDevices/ZigbeeActuator.d.ts +5 -4
- package/lib/server/devices/zigbee/BaseDevices/ZigbeeActuator.js +13 -21
- package/lib/server/devices/zigbee/BaseDevices/zigbeeDimmer.d.ts +8 -12
- package/lib/server/devices/zigbee/BaseDevices/zigbeeDimmer.js +32 -45
- package/lib/server/devices/zigbee/BaseDevices/zigbeeLedRGBCCT.d.ts +3 -3
- package/lib/server/devices/zigbee/BaseDevices/zigbeeLedRGBCCT.js +11 -32
- package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.d.ts +2 -2
- package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.js +9 -7
- package/lib/server/devices/zigbee/zigbeeBlitzShp.js +2 -2
- package/lib/server/devices/zigbee/zigbeeHeimanSmoke.js +1 -1
- package/lib/server/devices/zigbee/zigbeeIlluActuator.d.ts +0 -2
- package/lib/server/devices/zigbee/zigbeeIlluActuator.js +0 -6
- package/lib/server/devices/zigbee/zigbeeIlluLampe.d.ts +4 -4
- package/lib/server/devices/zigbee/zigbeeIlluLampe.js +6 -11
- package/lib/server/devices/zigbee/zigbeeInnr142C.d.ts +0 -4
- package/lib/server/devices/zigbee/zigbeeInnr142C.js +0 -33
- package/lib/server/devices/zigbee/zigbeeUbisysActuator.d.ts +0 -2
- package/lib/server/devices/zigbee/zigbeeUbisysActuator.js +0 -6
- package/lib/server/devices/zigbee/zigbeeUbisysLampe.d.ts +4 -4
- package/lib/server/devices/zigbee/zigbeeUbisysLampe.js +6 -11
- package/lib/server/services/ShutterService.d.ts +2 -7
- package/lib/server/services/ShutterService.js +2 -26
- package/lib/server/services/Telegram/telegram-Commands.js +2 -1
- package/lib/server/services/api/api-service.js +6 -6
- package/lib/server/services/blockAutomaticHandler.d.ts +2 -2
- package/lib/server/services/blockAutomaticHandler.js +5 -3
- package/lib/server/services/govee/own-govee-device.d.ts +8 -7
- package/lib/server/services/govee/own-govee-device.js +36 -47
- package/lib/server/services/room-service/room-service.d.ts +6 -10
- package/lib/server/services/room-service/room-service.js +19 -25
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -14
|
@@ -27,7 +27,7 @@ class HmIpRoll extends hmIpDevice_1.HmIPDevice {
|
|
|
27
27
|
if (val.desiredPosition === -1) {
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
|
-
(_a = this._window) === null || _a === void 0 ? void 0 : _a.setDesiredPosition(val.desiredPosition);
|
|
30
|
+
(_a = this._window) === null || _a === void 0 ? void 0 : _a.setDesiredPosition(new models_2.WindowSetDesiredPositionCommand(models_2.CommandSource.Automatic, val.desiredPosition, 'Found persisted last desired position in DB'));
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
get currentLevel() {
|
|
@@ -76,16 +76,18 @@ class HmIpRoll extends hmIpDevice_1.HmIPDevice {
|
|
|
76
76
|
break;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
setLevel(
|
|
80
|
-
|
|
79
|
+
setLevel(command) {
|
|
80
|
+
this.log(models_2.LogLevel.Debug, command.logMessage);
|
|
81
|
+
let targetLevel = command.level;
|
|
82
|
+
if (!this._firstCommandRecieved && !command.isInitial) {
|
|
81
83
|
this._firstCommandRecieved = true;
|
|
82
84
|
}
|
|
83
|
-
if (this._firstCommandRecieved &&
|
|
84
|
-
this.log(models_2.LogLevel.Debug, `Skipped initial Rollo to ${
|
|
85
|
+
if (this._firstCommandRecieved && command.isInitial) {
|
|
86
|
+
this.log(models_2.LogLevel.Debug, `Skipped initial Rollo to ${targetLevel} as we recieved a command already`);
|
|
85
87
|
return;
|
|
86
88
|
}
|
|
87
|
-
if (this.currentLevel ===
|
|
88
|
-
this.log(models_2.LogLevel.Debug, `Skip Rollo command to Position ${
|
|
89
|
+
if (this.currentLevel === targetLevel && !command.isForceAction) {
|
|
90
|
+
this.log(models_2.LogLevel.Debug, `Skip Rollo command to Position ${targetLevel} as this is the current one`, services_1.LogDebugType.SkipUnchangedRolloPosition);
|
|
89
91
|
return;
|
|
90
92
|
}
|
|
91
93
|
if (this._setLevelSwitchID === '') {
|
|
@@ -96,22 +98,22 @@ class HmIpRoll extends hmIpDevice_1.HmIPDevice {
|
|
|
96
98
|
return;
|
|
97
99
|
}
|
|
98
100
|
if (this._window !== undefined) {
|
|
99
|
-
if (this._window.griffeInPosition(models_1.WindowPosition.offen) > 0 &&
|
|
100
|
-
if (!skipOpenWarning) {
|
|
101
|
+
if (this._window.griffeInPosition(models_1.WindowPosition.offen) > 0 && command.level < 100) {
|
|
102
|
+
if (!command.skipOpenWarning) {
|
|
101
103
|
this.log(models_2.LogLevel.Alert, `Not closing the shutter, as the window is open!`);
|
|
102
104
|
}
|
|
103
105
|
return;
|
|
104
106
|
}
|
|
105
|
-
if (this._window.griffeInPosition(models_1.WindowPosition.kipp) > 0 &&
|
|
106
|
-
|
|
107
|
-
if (!skipOpenWarning) {
|
|
107
|
+
if (this._window.griffeInPosition(models_1.WindowPosition.kipp) > 0 && targetLevel < 50) {
|
|
108
|
+
targetLevel = 50;
|
|
109
|
+
if (!command.skipOpenWarning) {
|
|
108
110
|
this.log(models_2.LogLevel.Alert, `Not closing the shutter, as the window is half open!`);
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
113
|
}
|
|
112
|
-
this._setLevel =
|
|
113
|
-
this.log(models_2.LogLevel.Debug, `Fahre Rollo auf Position ${
|
|
114
|
-
this.setState(this._setLevelSwitchID,
|
|
114
|
+
this._setLevel = targetLevel;
|
|
115
|
+
this.log(models_2.LogLevel.Debug, `Fahre Rollo auf Position ${targetLevel}`);
|
|
116
|
+
this.setState(this._setLevelSwitchID, targetLevel);
|
|
115
117
|
}
|
|
116
118
|
toJSON() {
|
|
117
119
|
return lodash_1.default.omit(super.toJSON(), ['_window']);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { iActuator, iLamp } from '../baseDeviceInterfaces';
|
|
2
|
-
import {
|
|
2
|
+
import { ActuatorSetStateCommand, LampSetTimeBasedCommand, LampToggleLightCommand } from '../../../models';
|
|
3
3
|
export declare class LampUtils {
|
|
4
|
-
static stromStossOn(
|
|
5
|
-
static setTimeBased(device: iLamp,
|
|
6
|
-
static checkUnBlock(device: iActuator,
|
|
7
|
-
static toggleLight(device: iLamp,
|
|
8
|
-
static checkBlockActive(device: iActuator,
|
|
9
|
-
static checkUnchanged(device: iActuator,
|
|
4
|
+
static stromStossOn(actuator: iActuator): void;
|
|
5
|
+
static setTimeBased(device: iLamp, c: LampSetTimeBasedCommand): void;
|
|
6
|
+
static checkUnBlock(device: iActuator, command: ActuatorSetStateCommand): boolean;
|
|
7
|
+
static toggleLight(device: iLamp, c: LampToggleLightCommand): boolean;
|
|
8
|
+
static checkBlockActive(device: iActuator, c: ActuatorSetStateCommand): boolean;
|
|
9
|
+
static checkUnchanged(device: iActuator, c: ActuatorSetStateCommand): boolean;
|
|
10
|
+
static setActuator(device: iActuator, c: ActuatorSetStateCommand): void;
|
|
10
11
|
}
|
|
@@ -4,29 +4,29 @@ exports.LampUtils = void 0;
|
|
|
4
4
|
const services_1 = require("../../services");
|
|
5
5
|
const models_1 = require("../../../models");
|
|
6
6
|
class LampUtils {
|
|
7
|
-
static stromStossOn(
|
|
7
|
+
static stromStossOn(actuator) {
|
|
8
8
|
services_1.Utils.guardedTimeout(() => {
|
|
9
9
|
var _a, _b;
|
|
10
|
-
if ((_b = (_a =
|
|
11
|
-
|
|
10
|
+
if ((_b = (_a = actuator.room) === null || _a === void 0 ? void 0 : _a.PraesenzGroup) === null || _b === void 0 ? void 0 : _b.anyPresent()) {
|
|
11
|
+
actuator.setActuator(new models_1.ActuatorSetStateCommand(models_1.CommandSource.Force, true, 'StromStoss On due to Presence'));
|
|
12
12
|
}
|
|
13
|
-
},
|
|
13
|
+
}, actuator.settings.stromStossResendTime * 1000, this);
|
|
14
14
|
services_1.Utils.guardedTimeout(() => {
|
|
15
|
-
|
|
15
|
+
actuator.setActuator(new models_1.ActuatorSetStateCommand(models_1.CommandSource.Force, false, 'StromStoss Off'));
|
|
16
16
|
}, 3000, this);
|
|
17
17
|
}
|
|
18
|
-
static setTimeBased(device,
|
|
19
|
-
if ((time === models_1.TimeOfDay.Night && device.settings.nightOn) ||
|
|
20
|
-
(time === models_1.TimeOfDay.BeforeSunrise && device.settings.dawnOn) ||
|
|
21
|
-
(time === models_1.TimeOfDay.AfterSunset && device.settings.duskOn)) {
|
|
22
|
-
device.setLight(true, timeout
|
|
18
|
+
static setTimeBased(device, c) {
|
|
19
|
+
if ((c.time === models_1.TimeOfDay.Night && device.settings.nightOn) ||
|
|
20
|
+
(c.time === models_1.TimeOfDay.BeforeSunrise && device.settings.dawnOn) ||
|
|
21
|
+
(c.time === models_1.TimeOfDay.AfterSunset && device.settings.duskOn)) {
|
|
22
|
+
device.setLight(new models_1.LampSetLightCommand(c, true, `SetLight due to TimeBased ${c.time}`, c.timeout));
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
static checkUnBlock(device,
|
|
25
|
+
static checkUnBlock(device, command) {
|
|
26
26
|
let dontBlock = false;
|
|
27
|
-
if (
|
|
27
|
+
if (command.isForceAction &&
|
|
28
28
|
device.settings.resetToAutomaticOnForceOffAfterForceOn &&
|
|
29
|
-
!
|
|
29
|
+
!command.on &&
|
|
30
30
|
device.blockAutomationHandler.automaticBlockActive) {
|
|
31
31
|
dontBlock = true;
|
|
32
32
|
device.log(models_1.LogLevel.Debug, `Reset Automatic Block as we are turning off manually after a force on`);
|
|
@@ -34,34 +34,54 @@ class LampUtils {
|
|
|
34
34
|
}
|
|
35
35
|
return dontBlock;
|
|
36
36
|
}
|
|
37
|
-
static toggleLight(device,
|
|
37
|
+
static toggleLight(device, c) {
|
|
38
38
|
var _a;
|
|
39
39
|
const newVal = device.queuedValue !== null ? !device.queuedValue : !device.lightOn;
|
|
40
|
-
const timeout = newVal &&
|
|
41
|
-
if (newVal && time === undefined && calculateTime && device.room !== undefined) {
|
|
42
|
-
time = services_1.TimeCallbackService.dayType((_a = device.room) === null || _a === void 0 ? void 0 : _a.settings.lampOffset);
|
|
40
|
+
const timeout = newVal && c.isForceAction ? 30 * 60 * 1000 : -1;
|
|
41
|
+
if (newVal && c.time === undefined && c.calculateTime && device.room !== undefined) {
|
|
42
|
+
c.time = services_1.TimeCallbackService.dayType((_a = device.room) === null || _a === void 0 ? void 0 : _a.settings.lampOffset);
|
|
43
43
|
}
|
|
44
|
-
if (newVal && time !== undefined) {
|
|
45
|
-
device.setTimeBased(time,
|
|
44
|
+
if (newVal && c.time !== undefined) {
|
|
45
|
+
device.setTimeBased(new models_1.LampSetTimeBasedCommand(c, c.time, 'SetLight Due to toggle Light', timeout));
|
|
46
46
|
return true;
|
|
47
47
|
}
|
|
48
|
-
device.setLight(newVal,
|
|
48
|
+
device.setLight(new models_1.LampSetLightCommand(c, newVal, 'SetLight Due to toggle Light', timeout));
|
|
49
49
|
return newVal;
|
|
50
50
|
}
|
|
51
|
-
static checkBlockActive(device,
|
|
52
|
-
if (!
|
|
53
|
-
device.log(models_1.LogLevel.Debug, `Skip automatic command to ${
|
|
54
|
-
device.targetAutomaticState =
|
|
51
|
+
static checkBlockActive(device, c) {
|
|
52
|
+
if (!c.isForceAction && device.blockAutomationHandler.automaticBlockActive) {
|
|
53
|
+
device.log(models_1.LogLevel.Debug, `Skip automatic command to ${c.on} as it is locked until ${new Date(device.blockAutomationHandler.automaticBlockedUntil).toLocaleTimeString()}`);
|
|
54
|
+
device.targetAutomaticState = c.on;
|
|
55
55
|
return true;
|
|
56
56
|
}
|
|
57
57
|
return false;
|
|
58
58
|
}
|
|
59
|
-
static checkUnchanged(device,
|
|
60
|
-
if (!
|
|
61
|
-
device.log(models_1.LogLevel.DeepTrace, `Skip light command as it is already ${
|
|
59
|
+
static checkUnchanged(device, c) {
|
|
60
|
+
if (!c.isForceAction && c.on === device.actuatorOn && device.queuedValue === null) {
|
|
61
|
+
device.log(models_1.LogLevel.DeepTrace, `Skip light command as it is already ${c.on}`, services_1.LogDebugType.SkipUnchangedActuatorCommand);
|
|
62
62
|
return true;
|
|
63
63
|
}
|
|
64
64
|
return false;
|
|
65
65
|
}
|
|
66
|
+
static setActuator(device, c) {
|
|
67
|
+
if (LampUtils.checkBlockActive(device, c)) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (LampUtils.checkUnchanged(device, c)) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
device.queuedValue = c.on;
|
|
74
|
+
device.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c.on, c));
|
|
75
|
+
if (device.settings.isStromStoss && c.on) {
|
|
76
|
+
c.timeout = 3000;
|
|
77
|
+
LampUtils.stromStossOn(device);
|
|
78
|
+
}
|
|
79
|
+
if (c.timeout < 0 || !c.on) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (c.timeout > -1 && device.blockAutomationHandler !== undefined) {
|
|
83
|
+
device.blockAutomationHandler.disableAutomatic(c.timeout, models_1.CollisionSolving.overrideIfGreater);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
66
86
|
}
|
|
67
87
|
exports.LampUtils = LampUtils;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IoBrokerBaseDevice } from './IoBrokerBaseDevice';
|
|
2
|
-
import {
|
|
2
|
+
import { ActuatorSetStateCommand, ActuatorToggleCommand, ActuatorWriteStateToDeviceCommand, DimmerSetLightCommand, LampSetTimeBasedCommand, LampToggleLightCommand, RestoreTargetAutomaticValueCommand, WledSetLightCommand, WledSettings } from '../../models';
|
|
3
3
|
import { IoBrokerDeviceInfo } from './IoBrokerDeviceInfo';
|
|
4
4
|
import { iDimmableLamp } from './baseDeviceInterfaces/iDimmableLamp';
|
|
5
5
|
import { BlockAutomaticHandler } from '../services/blockAutomaticHandler';
|
|
@@ -17,13 +17,14 @@ export declare class WledDevice extends IoBrokerBaseDevice implements iDimmableL
|
|
|
17
17
|
constructor(pInfo: IoBrokerDeviceInfo);
|
|
18
18
|
get actuatorOn(): boolean;
|
|
19
19
|
get lightOn(): boolean;
|
|
20
|
-
restoreTargetAutomaticValue(): void;
|
|
20
|
+
restoreTargetAutomaticValue(c: RestoreTargetAutomaticValueCommand): void;
|
|
21
21
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean, _pOverride?: boolean): void;
|
|
22
|
-
setLight(
|
|
23
|
-
setWled(
|
|
24
|
-
setTimeBased(
|
|
22
|
+
setLight(c: DimmerSetLightCommand): void;
|
|
23
|
+
setWled(c: WledSetLightCommand): void;
|
|
24
|
+
setTimeBased(c: LampSetTimeBasedCommand): void;
|
|
25
25
|
persist(): void;
|
|
26
|
-
setActuator(
|
|
27
|
-
toggleActuator(
|
|
28
|
-
toggleLight(
|
|
26
|
+
setActuator(command: ActuatorSetStateCommand): void;
|
|
27
|
+
toggleActuator(c: ActuatorToggleCommand): boolean;
|
|
28
|
+
toggleLight(c: LampToggleLightCommand): boolean;
|
|
29
|
+
writeActuatorStateToDevice(c: ActuatorWriteStateToDeviceCommand): void;
|
|
29
30
|
}
|
|
@@ -27,9 +27,9 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
|
|
|
27
27
|
get lightOn() {
|
|
28
28
|
return this.on;
|
|
29
29
|
}
|
|
30
|
-
restoreTargetAutomaticValue() {
|
|
31
|
-
this.log(models_1.LogLevel.Debug,
|
|
32
|
-
this.
|
|
30
|
+
restoreTargetAutomaticValue(c) {
|
|
31
|
+
this.log(models_1.LogLevel.Debug, c.logMessage);
|
|
32
|
+
this.setLight(new models_1.WledSetLightCommand(c, this.targetAutomaticState, 'Lampen RestoreTargetAutomaticValue'));
|
|
33
33
|
}
|
|
34
34
|
update(idSplit, state, initial = false, _pOverride = false) {
|
|
35
35
|
this.queuedValue = null;
|
|
@@ -43,10 +43,11 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
|
|
|
43
43
|
break;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
setLight(
|
|
47
|
-
this.setWled(
|
|
46
|
+
setLight(c) {
|
|
47
|
+
this.setWled(new models_1.WledSetLightCommand(c, c.on, 'Set Wled due to DimmerSetLightCommand', c.timeout, c.brightness, c.transitionTime, undefined));
|
|
48
48
|
}
|
|
49
|
-
setWled(
|
|
49
|
+
setWled(c) {
|
|
50
|
+
this.log(models_1.LogLevel.Debug, c.logMessage);
|
|
50
51
|
if (this._onID === '') {
|
|
51
52
|
services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `Keine On ID für "${this.info.customName}" bekannt.`);
|
|
52
53
|
return;
|
|
@@ -55,70 +56,54 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
|
|
|
55
56
|
services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `Keine Connection für "${this.info.customName}" bekannt.`);
|
|
56
57
|
return;
|
|
57
58
|
}
|
|
58
|
-
const dontBlock = sharedFunctions_1.LampUtils.checkUnBlock(this,
|
|
59
|
-
if (sharedFunctions_1.LampUtils.checkBlockActive(this,
|
|
59
|
+
const dontBlock = sharedFunctions_1.LampUtils.checkUnBlock(this, c);
|
|
60
|
+
if (sharedFunctions_1.LampUtils.checkBlockActive(this, c)) {
|
|
60
61
|
return;
|
|
61
62
|
}
|
|
62
|
-
if (
|
|
63
|
-
brightness = 10;
|
|
63
|
+
if (c.on && c.brightness !== -1 && this.brightness < 10) {
|
|
64
|
+
c.brightness = 10;
|
|
64
65
|
}
|
|
65
|
-
services_1.ServerLogService.writeLog(models_1.LogLevel.Debug, `WLED Schalten: "${this.info.customName}" An: ${
|
|
66
|
-
this.queuedValue =
|
|
67
|
-
this.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (preset !== undefined) {
|
|
71
|
-
this.setState(this._presetID, preset, undefined, (err) => {
|
|
66
|
+
services_1.ServerLogService.writeLog(models_1.LogLevel.Debug, `WLED Schalten: "${this.info.customName}" An: ${c.on}\tHelligkeit: ${c.brightness}%`);
|
|
67
|
+
this.queuedValue = c.on;
|
|
68
|
+
this.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c.on, c, 'WLED Schalten'));
|
|
69
|
+
if (c.preset !== undefined) {
|
|
70
|
+
this.setState(this._presetID, c.preset, undefined, (err) => {
|
|
72
71
|
services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `WLED schalten ergab Fehler: ${err}`);
|
|
73
72
|
});
|
|
74
73
|
}
|
|
75
|
-
else if (brightness > -1) {
|
|
76
|
-
this.setState(this._brightnessID, brightness, undefined, (err) => {
|
|
74
|
+
else if (c.brightness > -1) {
|
|
75
|
+
this.setState(this._brightnessID, c.brightness, undefined, (err) => {
|
|
77
76
|
services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `Dimmer Helligkeit schalten ergab Fehler: ${err}`);
|
|
78
77
|
});
|
|
79
78
|
}
|
|
80
|
-
if (timeout !== undefined && timeout > -1 && !dontBlock) {
|
|
81
|
-
this.blockAutomationHandler.disableAutomatic(timeout, models_1.CollisionSolving.overrideIfGreater);
|
|
79
|
+
if (c.timeout !== undefined && c.timeout > -1 && !dontBlock) {
|
|
80
|
+
this.blockAutomationHandler.disableAutomatic(c.timeout, models_1.CollisionSolving.overrideIfGreater);
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
|
-
setTimeBased(
|
|
85
|
-
this.log(models_1.LogLevel.Debug, `Wled setTimeBased ${time}`);
|
|
86
|
-
|
|
87
|
-
case models_1.TimeOfDay.Night:
|
|
88
|
-
if (this.settings.nightOn) {
|
|
89
|
-
this.setWled(true, this.settings.nightBrightness, this.settings.nightPreset);
|
|
90
|
-
}
|
|
91
|
-
break;
|
|
92
|
-
case models_1.TimeOfDay.AfterSunset:
|
|
93
|
-
if (this.settings.duskOn) {
|
|
94
|
-
this.setWled(true, this.settings.duskBrightness, this.settings.duskPreset);
|
|
95
|
-
}
|
|
96
|
-
break;
|
|
97
|
-
case models_1.TimeOfDay.BeforeSunrise:
|
|
98
|
-
if (this.settings.dawnOn) {
|
|
99
|
-
this.setWled(true, this.settings.dawnBrightness, this.settings.dawnPreset);
|
|
100
|
-
}
|
|
101
|
-
break;
|
|
102
|
-
case models_1.TimeOfDay.Daylight:
|
|
103
|
-
if (this.settings.dayOn) {
|
|
104
|
-
this.setWled(true, this.settings.dayBrightness, this.settings.dayPreset);
|
|
105
|
-
}
|
|
106
|
-
break;
|
|
107
|
-
}
|
|
83
|
+
setTimeBased(c) {
|
|
84
|
+
this.log(models_1.LogLevel.Debug, `Wled setTimeBased ${c.time}`);
|
|
85
|
+
this.setWled(models_1.WledSetLightCommand.byTimeBased(this.settings, c));
|
|
108
86
|
}
|
|
109
87
|
persist() {
|
|
110
88
|
var _a;
|
|
111
89
|
(_a = services_1.Utils.dbo) === null || _a === void 0 ? void 0 : _a.persistActuator(this);
|
|
112
90
|
}
|
|
113
|
-
setActuator(
|
|
114
|
-
this.
|
|
91
|
+
setActuator(command) {
|
|
92
|
+
this.setWled(new models_1.WledSetLightCommand(command, command.on, 'Set Wled due to ActuatorSetStateCommand'));
|
|
115
93
|
}
|
|
116
|
-
toggleActuator(
|
|
117
|
-
|
|
118
|
-
|
|
94
|
+
toggleActuator(c) {
|
|
95
|
+
const setActuatorCommand = models_1.ActuatorSetStateCommand.byActuatorAndToggleCommand(this, c);
|
|
96
|
+
this.setActuator(setActuatorCommand);
|
|
97
|
+
return setActuatorCommand.on;
|
|
98
|
+
}
|
|
99
|
+
toggleLight(c) {
|
|
100
|
+
return sharedFunctions_1.LampUtils.toggleLight(this, c);
|
|
119
101
|
}
|
|
120
|
-
|
|
121
|
-
|
|
102
|
+
writeActuatorStateToDevice(c) {
|
|
103
|
+
this.log(models_1.LogLevel.Debug, c.logMessage, services_1.LogDebugType.SetActuator);
|
|
104
|
+
this.setState(this._onID, c.stateValue, undefined, (err) => {
|
|
105
|
+
services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `WLED schalten ergab Fehler: ${err}`);
|
|
106
|
+
});
|
|
122
107
|
}
|
|
123
108
|
}
|
|
124
109
|
exports.WledDevice = WledDevice;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActuatorSettings } from '../../../../models';
|
|
1
|
+
import { ActuatorSetStateCommand, ActuatorSettings, ActuatorToggleCommand, ActuatorWriteStateToDeviceCommand, RestoreTargetAutomaticValueCommand } from '../../../../models';
|
|
2
2
|
import { DeviceType } from '../../deviceType';
|
|
3
3
|
import { IoBrokerDeviceInfo } from '../../IoBrokerDeviceInfo';
|
|
4
4
|
import { iActuator } from '../../baseDeviceInterfaces';
|
|
@@ -13,9 +13,10 @@ export declare class ZigbeeActuator extends ZigbeeDevice implements iActuator {
|
|
|
13
13
|
queuedValue: boolean | null;
|
|
14
14
|
get actuatorOn(): boolean;
|
|
15
15
|
constructor(pInfo: IoBrokerDeviceInfo, type: DeviceType, actuatorOnSwitchID: string);
|
|
16
|
-
restoreTargetAutomaticValue(): void;
|
|
16
|
+
restoreTargetAutomaticValue(c: RestoreTargetAutomaticValueCommand): void;
|
|
17
17
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean, handledByChildObject?: boolean): void;
|
|
18
|
-
setActuator(
|
|
18
|
+
setActuator(command: ActuatorSetStateCommand): void;
|
|
19
19
|
persist(): void;
|
|
20
|
-
toggleActuator(
|
|
20
|
+
toggleActuator(command: ActuatorToggleCommand): boolean;
|
|
21
|
+
writeActuatorStateToDevice(c: ActuatorWriteStateToDeviceCommand): void;
|
|
21
22
|
}
|
|
@@ -22,9 +22,9 @@ class ZigbeeActuator extends zigbeeDevice_1.ZigbeeDevice {
|
|
|
22
22
|
this.actuatorOnSwitchID = actuatorOnSwitchID;
|
|
23
23
|
this.blockAutomationHandler = new blockAutomaticHandler_1.BlockAutomaticHandler(this.restoreTargetAutomaticValue.bind(this));
|
|
24
24
|
}
|
|
25
|
-
restoreTargetAutomaticValue() {
|
|
25
|
+
restoreTargetAutomaticValue(c) {
|
|
26
26
|
this.log(models_1.LogLevel.Debug, `Restore Target Automatic value`);
|
|
27
|
-
this.setActuator(this.targetAutomaticState);
|
|
27
|
+
this.setActuator(new models_1.ActuatorSetStateCommand(c, this.targetAutomaticState, 'Restore Target Automatic value'));
|
|
28
28
|
}
|
|
29
29
|
update(idSplit, state, initial = false, handledByChildObject = false) {
|
|
30
30
|
if (!handledByChildObject) {
|
|
@@ -42,36 +42,28 @@ class ZigbeeActuator extends zigbeeDevice_1.ZigbeeDevice {
|
|
|
42
42
|
break;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
setActuator(
|
|
45
|
+
setActuator(command) {
|
|
46
46
|
if (this.actuatorOnSwitchID === '') {
|
|
47
47
|
this.log(models_1.LogLevel.Error, `Keine Switch ID bekannt.`);
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
if (sharedFunctions_1.LampUtils.checkBlockActive(this, force, pValue)) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
if (sharedFunctions_1.LampUtils.checkUnchanged(this, force, pValue)) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
this.log(models_1.LogLevel.Debug, `Set Acutator to "${pValue}"`, services_1.LogDebugType.SetActuator);
|
|
58
|
-
this.setState(this.actuatorOnSwitchID, pValue, undefined, (err) => {
|
|
59
|
-
this.log(models_1.LogLevel.Error, `Switching actuator resulted in error: ${err}`);
|
|
60
|
-
});
|
|
61
|
-
this.queuedValue = pValue;
|
|
62
|
-
if (timeout > -1 && !dontBlock) {
|
|
63
|
-
this.blockAutomationHandler.disableAutomatic(timeout, models_1.CollisionSolving.overrideIfGreater);
|
|
64
|
-
}
|
|
50
|
+
sharedFunctions_1.LampUtils.setActuator(this, command);
|
|
65
51
|
}
|
|
66
52
|
persist() {
|
|
67
53
|
var _a;
|
|
68
54
|
(_a = services_1.Utils.dbo) === null || _a === void 0 ? void 0 : _a.persistActuator(this);
|
|
69
55
|
}
|
|
70
|
-
toggleActuator(
|
|
56
|
+
toggleActuator(command) {
|
|
71
57
|
const newVal = this.queuedValue !== null ? !this.queuedValue : !this._actuatorOn;
|
|
72
|
-
const timeout = newVal &&
|
|
73
|
-
this.setActuator(newVal,
|
|
58
|
+
const timeout = newVal && command.isForceAction ? 30 * 60 * 1000 : -1;
|
|
59
|
+
this.setActuator(new models_1.ActuatorSetStateCommand(command, newVal, 'Due to ZigbeeActuatorToggle', timeout));
|
|
74
60
|
return newVal;
|
|
75
61
|
}
|
|
62
|
+
writeActuatorStateToDevice(c) {
|
|
63
|
+
this.log(models_1.LogLevel.Debug, c.logMessage, services_1.LogDebugType.SetActuator);
|
|
64
|
+
this.setState(this.actuatorOnSwitchID, c.stateValue, undefined, (err) => {
|
|
65
|
+
this.log(models_1.LogLevel.Error, `Lampe schalten ergab Fehler: ${err}`);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
76
68
|
}
|
|
77
69
|
exports.ZigbeeActuator = ZigbeeActuator;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DimmerSettings,
|
|
1
|
+
import { ActuatorSetStateCommand, ActuatorToggleCommand, ActuatorWriteStateToDeviceCommand, DimmerSetLightCommand, DimmerSettings, LampSetTimeBasedCommand, LampToggleLightCommand, RestoreTargetAutomaticValueCommand } from '../../../../models';
|
|
2
2
|
import { DeviceType } from '../../deviceType';
|
|
3
3
|
import { ZigbeeDevice } from './index';
|
|
4
4
|
import { IoBrokerDeviceInfo } from '../../IoBrokerDeviceInfo';
|
|
@@ -25,21 +25,17 @@ export declare abstract class ZigbeeDimmer extends ZigbeeDevice implements iDimm
|
|
|
25
25
|
protected _transitionTime: number;
|
|
26
26
|
get transitionTime(): number;
|
|
27
27
|
get actuatorOn(): boolean;
|
|
28
|
-
restoreTargetAutomaticValue(): void;
|
|
28
|
+
restoreTargetAutomaticValue(c: RestoreTargetAutomaticValueCommand): void;
|
|
29
29
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
30
|
-
setTimeBased(
|
|
31
|
-
setActuator(
|
|
32
|
-
toggleActuator(
|
|
30
|
+
setTimeBased(c: LampSetTimeBasedCommand): void;
|
|
31
|
+
setActuator(c: ActuatorSetStateCommand): void;
|
|
32
|
+
toggleActuator(c: ActuatorToggleCommand): boolean;
|
|
33
33
|
/**
|
|
34
34
|
* @inheritDoc
|
|
35
|
-
* @param pValue The desired value
|
|
36
|
-
* @param timeout If > 0 time at which this should be turned off again
|
|
37
|
-
* @param force if it is an user based action which should override automatic ones
|
|
38
|
-
* @param {number} brightness The desired brightness in percent
|
|
39
|
-
* @param {number} transitionTime The transition time for the brightness, to switch smoothly
|
|
40
35
|
*/
|
|
41
|
-
setLight(
|
|
36
|
+
setLight(c: DimmerSetLightCommand): void;
|
|
42
37
|
persist(): void;
|
|
43
|
-
toggleLight(
|
|
38
|
+
toggleLight(c: LampToggleLightCommand): boolean;
|
|
39
|
+
writeActuatorStateToDevice(c: ActuatorWriteStateToDeviceCommand): void;
|
|
44
40
|
private setBrightnessState;
|
|
45
41
|
}
|
|
@@ -34,9 +34,8 @@ class ZigbeeDimmer extends index_1.ZigbeeDevice {
|
|
|
34
34
|
get actuatorOn() {
|
|
35
35
|
return this.lightOn;
|
|
36
36
|
}
|
|
37
|
-
restoreTargetAutomaticValue() {
|
|
38
|
-
this.
|
|
39
|
-
this.setActuator(this.targetAutomaticState);
|
|
37
|
+
restoreTargetAutomaticValue(c) {
|
|
38
|
+
this.setActuator(new models_1.ActuatorSetStateCommand(c, this.targetAutomaticState, 'Restore targetAutomaticState due to BlockAutomaticHandler'));
|
|
40
39
|
}
|
|
41
40
|
update(idSplit, state, initial = false) {
|
|
42
41
|
this.queuedValue = null;
|
|
@@ -59,37 +58,21 @@ class ZigbeeDimmer extends index_1.ZigbeeDevice {
|
|
|
59
58
|
break;
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
|
-
setTimeBased(
|
|
63
|
-
|
|
64
|
-
case models_1.TimeOfDay.Night:
|
|
65
|
-
this.setLight(true, timeout, force, this.settings.nightBrightness);
|
|
66
|
-
break;
|
|
67
|
-
case models_1.TimeOfDay.AfterSunset:
|
|
68
|
-
this.setLight(true, timeout, force, this.settings.dawnBrightness);
|
|
69
|
-
break;
|
|
70
|
-
case models_1.TimeOfDay.BeforeSunrise:
|
|
71
|
-
this.setLight(true, timeout, force, this.settings.duskBrightness);
|
|
72
|
-
break;
|
|
73
|
-
case models_1.TimeOfDay.Daylight:
|
|
74
|
-
this.setLight(true, timeout, force, this.settings.dayBrightness);
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
61
|
+
setTimeBased(c) {
|
|
62
|
+
this.setLight(models_1.DimmerSetLightCommand.byTimeBased(this.settings, c));
|
|
77
63
|
}
|
|
78
|
-
setActuator(
|
|
79
|
-
this.setLight(
|
|
64
|
+
setActuator(c) {
|
|
65
|
+
this.setLight(new models_1.DimmerSetLightCommand(c, c.on, 'Set dimmer due to set ActuactorCommand', c.timeout));
|
|
80
66
|
}
|
|
81
|
-
toggleActuator(
|
|
82
|
-
|
|
67
|
+
toggleActuator(c) {
|
|
68
|
+
const setActuatorCommand = models_1.ActuatorSetStateCommand.byActuatorAndToggleCommand(this, c);
|
|
69
|
+
this.setActuator(setActuatorCommand);
|
|
70
|
+
return setActuatorCommand.on;
|
|
83
71
|
}
|
|
84
72
|
/**
|
|
85
73
|
* @inheritDoc
|
|
86
|
-
* @param pValue The desired value
|
|
87
|
-
* @param timeout If > 0 time at which this should be turned off again
|
|
88
|
-
* @param force if it is an user based action which should override automatic ones
|
|
89
|
-
* @param {number} brightness The desired brightness in percent
|
|
90
|
-
* @param {number} transitionTime The transition time for the brightness, to switch smoothly
|
|
91
74
|
*/
|
|
92
|
-
setLight(
|
|
75
|
+
setLight(c) {
|
|
93
76
|
var _a;
|
|
94
77
|
if (this._stateIdState === '') {
|
|
95
78
|
this.log(models_1.LogLevel.Error, `Keine State ID bekannt.`);
|
|
@@ -99,34 +82,34 @@ class ZigbeeDimmer extends index_1.ZigbeeDevice {
|
|
|
99
82
|
this.log(models_1.LogLevel.Error, `Keine Connection bekannt.`);
|
|
100
83
|
return;
|
|
101
84
|
}
|
|
102
|
-
if (transitionTime > -1) {
|
|
103
|
-
this.setState(this._stateIdTransitionTime, transitionTime);
|
|
85
|
+
if (c.transitionTime > -1) {
|
|
86
|
+
this.setState(this._stateIdTransitionTime, c.transitionTime);
|
|
104
87
|
}
|
|
105
|
-
const dontBlock = sharedFunctions_1.LampUtils.checkUnBlock(this,
|
|
106
|
-
if (sharedFunctions_1.LampUtils.checkBlockActive(this,
|
|
88
|
+
const dontBlock = sharedFunctions_1.LampUtils.checkUnBlock(this, c);
|
|
89
|
+
if (sharedFunctions_1.LampUtils.checkBlockActive(this, c)) {
|
|
107
90
|
return;
|
|
108
91
|
}
|
|
109
|
-
if (
|
|
110
|
-
brightness = 10;
|
|
92
|
+
if (c.on && c.brightness <= 0 && this.brightness < 10) {
|
|
93
|
+
c.brightness = 10;
|
|
111
94
|
}
|
|
112
|
-
this.log(models_1.LogLevel.Debug, `Set Light Acutator to "${
|
|
113
|
-
if (timeout > -1 && !dontBlock) {
|
|
114
|
-
this.blockAutomationHandler.disableAutomatic(timeout, models_1.CollisionSolving.overrideIfGreater);
|
|
95
|
+
this.log(models_1.LogLevel.Debug, `Set Light Acutator to "${c.on}" with brightness ${c.brightness}`, services_1.LogDebugType.SetActuator);
|
|
96
|
+
if (c.timeout > -1 && !dontBlock) {
|
|
97
|
+
this.blockAutomationHandler.disableAutomatic(c.timeout, models_1.CollisionSolving.overrideIfGreater);
|
|
115
98
|
}
|
|
116
|
-
if (((_a = services_1.SettingsService.settings.ioBroker) === null || _a === void 0 ? void 0 : _a.useZigbee2mqtt) && !
|
|
99
|
+
if (((_a = services_1.SettingsService.settings.ioBroker) === null || _a === void 0 ? void 0 : _a.useZigbee2mqtt) && !c.on) {
|
|
117
100
|
// With zigbee2mqtt to turn on only setting brighness>0 is needed, so we need state only for turning off
|
|
118
|
-
this.
|
|
119
|
-
this.queuedValue =
|
|
101
|
+
this.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c.on, c, 'Set dimmer due to set ActuactorCommand'));
|
|
102
|
+
this.queuedValue = c.on;
|
|
120
103
|
return;
|
|
121
104
|
}
|
|
122
|
-
if (brightness >= this.settings.turnOnThreshhold) {
|
|
123
|
-
this.setBrightnessState(brightness);
|
|
105
|
+
if (c.brightness >= this.settings.turnOnThreshhold) {
|
|
106
|
+
this.setBrightnessState(c.brightness);
|
|
124
107
|
return;
|
|
125
108
|
}
|
|
126
109
|
this.setBrightnessState(this.settings.turnOnThreshhold, () => {
|
|
127
110
|
services_1.Utils.guardedTimeout(() => {
|
|
128
111
|
this.log(models_1.LogLevel.Info, `Delayed reduced brightness on ${this.info.customName}`);
|
|
129
|
-
this.setBrightnessState(brightness);
|
|
112
|
+
this.setBrightnessState(c.brightness);
|
|
130
113
|
}, 1000, this);
|
|
131
114
|
});
|
|
132
115
|
}
|
|
@@ -139,8 +122,12 @@ class ZigbeeDimmer extends index_1.ZigbeeDevice {
|
|
|
139
122
|
(_a = services_1.Utils.dbo) === null || _a === void 0 ? void 0 : _a.persistActuator(this);
|
|
140
123
|
this._lastPersist = now;
|
|
141
124
|
}
|
|
142
|
-
toggleLight(
|
|
143
|
-
return sharedFunctions_1.LampUtils.toggleLight(this,
|
|
125
|
+
toggleLight(c) {
|
|
126
|
+
return sharedFunctions_1.LampUtils.toggleLight(this, c);
|
|
127
|
+
}
|
|
128
|
+
writeActuatorStateToDevice(c) {
|
|
129
|
+
this.log(models_1.LogLevel.Debug, c.logMessage, services_1.LogDebugType.SetActuator);
|
|
130
|
+
this.setState(this._stateIdState, c.stateValue);
|
|
144
131
|
}
|
|
145
132
|
setBrightnessState(brightness, onSuccess) {
|
|
146
133
|
this.setState(this._stateIdBrightness, Math.max(0, Math.min(brightness, 100)), onSuccess);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeviceType } from '../../deviceType';
|
|
2
|
-
import {
|
|
2
|
+
import { LampSetTimeBasedCommand, LedSetLightCommand, LedSettings } from '../../../../models';
|
|
3
3
|
import { IoBrokerDeviceInfo } from '../../IoBrokerDeviceInfo';
|
|
4
4
|
import { iLedRgbCct } from '../../baseDeviceInterfaces/iLedRgbCct';
|
|
5
5
|
import { ZigbeeDimmer } from './zigbeeDimmer';
|
|
@@ -19,9 +19,9 @@ export declare abstract class ZigbeeLedRGBCCT extends ZigbeeDimmer implements iL
|
|
|
19
19
|
/**
|
|
20
20
|
* @inheritDoc
|
|
21
21
|
*/
|
|
22
|
-
setTimeBased(
|
|
22
|
+
setTimeBased(c: LampSetTimeBasedCommand): void;
|
|
23
23
|
/**
|
|
24
24
|
* @inheritDoc
|
|
25
25
|
*/
|
|
26
|
-
setLight(
|
|
26
|
+
setLight(c: LedSetLightCommand): void;
|
|
27
27
|
}
|