hoffmation-base 3.0.0-alpha.2 → 3.0.0-alpha.21
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/liquid-pid.d.ts +2 -5
- package/lib/liquid-pid.js +2 -5
- package/lib/models/command/ShutterSetLevelCommand.d.ts +7 -0
- package/lib/models/command/ShutterSetLevelCommand.js +8 -1
- package/lib/models/command/WindowRestoreDesiredPositionCommand.d.ts +5 -0
- package/lib/models/command/WindowRestoreDesiredPositionCommand.js +5 -0
- package/lib/models/command/WindowSetDesiredPositionCommand.d.ts +6 -0
- package/lib/models/command/WindowSetDesiredPositionCommand.js +6 -0
- package/lib/models/command/WindowSetRolloByWeatherStatusCommand.d.ts +5 -0
- package/lib/models/command/WindowSetRolloByWeatherStatusCommand.js +5 -0
- package/lib/models/command/actuatorSetStateCommand.d.ts +7 -0
- package/lib/models/command/actuatorSetStateCommand.js +9 -2
- package/lib/models/command/actuatorToggleCommand.d.ts +5 -0
- package/lib/models/command/actuatorToggleCommand.js +6 -1
- package/lib/models/command/actuatorWriteStateToDeviceCommand.d.ts +7 -1
- package/lib/models/command/actuatorWriteStateToDeviceCommand.js +12 -2
- package/lib/models/command/baseCommand.d.ts +14 -1
- package/lib/models/command/baseCommand.js +40 -6
- package/lib/models/command/blockAutomaticCommand.d.ts +17 -0
- package/lib/models/command/blockAutomaticCommand.js +22 -0
- package/lib/models/command/blockAutomaticLiftBlockCommand.d.ts +12 -0
- package/lib/models/command/blockAutomaticLiftBlockCommand.js +17 -0
- package/lib/models/command/blockAutomaticUntilCommand.d.ts +17 -0
- package/lib/models/command/blockAutomaticUntilCommand.js +22 -0
- package/lib/models/command/commandSource.d.ts +19 -0
- package/lib/models/command/commandSource.js +20 -0
- package/lib/models/command/commandType.d.ts +3 -0
- package/lib/models/command/commandType.js +3 -0
- package/lib/models/command/dimmerSetLightCommand.d.ts +7 -6
- package/lib/models/command/dimmerSetLightCommand.js +13 -11
- package/lib/models/command/floorSetAllShuttersCommand.d.ts +4 -4
- package/lib/models/command/floorSetAllShuttersCommand.js +4 -4
- package/lib/models/command/index.d.ts +3 -0
- package/lib/models/command/index.js +7 -1
- package/lib/models/command/lampSetLightCommand.d.ts +7 -0
- package/lib/models/command/lampSetLightCommand.js +8 -1
- package/lib/models/command/lampSetTimeBasedCommand.d.ts +4 -4
- package/lib/models/command/lampSetTimeBasedCommand.js +5 -5
- package/lib/models/command/lampToggleLightCommand.d.ts +5 -5
- package/lib/models/command/lampToggleLightCommand.js +6 -6
- package/lib/models/command/ledSetLightCommand.d.ts +15 -9
- package/lib/models/command/ledSetLightCommand.js +16 -10
- package/lib/models/command/lightGroupSwitchTimeConditionalCommand.d.ts +6 -0
- package/lib/models/command/lightGroupSwitchTimeConditionalCommand.js +6 -0
- package/lib/models/command/restoreTargetAutomaticValueCommand.d.ts +5 -0
- package/lib/models/command/restoreTargetAutomaticValueCommand.js +6 -1
- package/lib/models/command/roomRestoreLightCommand.d.ts +5 -0
- package/lib/models/command/roomRestoreLightCommand.js +5 -0
- package/lib/models/command/roomRestoreShutterPositionCommand.d.ts +6 -0
- package/lib/models/command/roomRestoreShutterPositionCommand.js +6 -0
- package/lib/models/command/roomSetLightTimeBasedCommand.d.ts +3 -3
- package/lib/models/command/roomSetLightTimeBasedCommand.js +3 -3
- package/lib/models/command/shutterSunriseUpCommand.d.ts +5 -0
- package/lib/models/command/shutterSunriseUpCommand.js +5 -0
- package/lib/models/command/shutterSunsetDownCommand.d.ts +5 -0
- package/lib/models/command/shutterSunsetDownCommand.js +5 -0
- package/lib/models/command/wledSetLightCommand.d.ts +11 -0
- package/lib/models/command/wledSetLightCommand.js +13 -0
- package/lib/models/connectionCallbacks.d.ts +4 -4
- package/lib/models/deviceConfig.d.ts +2 -2
- package/lib/models/deviceSettings/acSettings.d.ts +6 -5
- package/lib/models/deviceSettings/acSettings.js +10 -8
- package/lib/models/deviceSettings/actuatorSettings.d.ts +13 -4
- package/lib/models/deviceSettings/actuatorSettings.js +19 -9
- package/lib/models/deviceSettings/garageDoorOpenerSettings.d.ts +0 -1
- package/lib/models/deviceSettings/garageDoorOpenerSettings.js +0 -1
- package/lib/models/deviceSettings/heaterSettings.d.ts +0 -6
- package/lib/models/deviceSettings/heaterSettings.js +0 -6
- package/lib/models/deviceSettings/ledSettings.js +10 -18
- package/lib/models/deviceSettings/motionSensorSettings.d.ts +0 -1
- package/lib/models/deviceSettings/motionSensorSettings.js +0 -1
- package/lib/models/deviceSettings/shutterSettings.d.ts +0 -3
- package/lib/models/deviceSettings/shutterSettings.js +0 -3
- package/lib/models/deviceSettings/wledSettings.js +5 -13
- package/lib/models/groupSettings/heatGroupSettings.d.ts +3 -1
- package/lib/models/groupSettings/heatGroupSettings.js +3 -1
- package/lib/models/iIdHolder.d.ts +6 -0
- package/lib/models/objectSettings.d.ts +2 -2
- package/lib/models/objectSettings.js +2 -2
- package/lib/models/rooms/RoomBase.d.ts +2 -1
- package/lib/models/rooms/RoomBase.js +4 -3
- package/lib/models/rooms/iRoomBase.d.ts +17 -0
- package/lib/models/rooms/iRoomImportEnforcer.d.ts +4 -0
- package/lib/server/devices/Griffe.js +0 -1
- package/lib/server/devices/IoBrokerBaseDevice.d.ts +11 -16
- package/lib/server/devices/IoBrokerBaseDevice.js +21 -17
- package/lib/server/devices/IoBrokerDeviceInfo.d.ts +2 -2
- package/lib/server/devices/IoBrokerDeviceInfo.js +6 -4
- package/lib/server/devices/baseDeviceInterfaces/iAcDevice.d.ts +30 -3
- package/lib/server/devices/baseDeviceInterfaces/iActuator.d.ts +16 -0
- package/lib/server/devices/baseDeviceInterfaces/iBaseDevice.d.ts +25 -0
- package/lib/server/devices/baseDeviceInterfaces/iBatteryDevice.d.ts +10 -1
- package/lib/server/devices/baseDeviceInterfaces/iBluetoothDetector.d.ts +5 -5
- package/lib/server/devices/baseDeviceInterfaces/iButtonSwitch.d.ts +13 -0
- package/lib/server/devices/baseDeviceInterfaces/iCameraDevice.d.ts +10 -0
- package/lib/server/devices/baseDeviceInterfaces/iDimmableLamp.d.ts +9 -2
- package/lib/server/devices/baseDeviceInterfaces/iEnergyManager.d.ts +13 -2
- package/lib/server/devices/baseDeviceInterfaces/iExcessEnergyConsumer.d.ts +16 -2
- package/lib/server/devices/baseDeviceInterfaces/iGarageDoorOpener.d.ts +10 -0
- package/lib/server/devices/baseDeviceInterfaces/iHandleSensor.d.ts +12 -0
- package/lib/server/devices/baseDeviceInterfaces/iHeater.d.ts +12 -2
- package/lib/server/devices/baseDeviceInterfaces/iHumiditySensor.d.ts +7 -0
- package/lib/server/devices/baseDeviceInterfaces/iLamp.d.ts +4 -0
- package/lib/server/devices/baseDeviceInterfaces/iLedRgbCct.d.ts +5 -0
- package/lib/server/devices/baseDeviceInterfaces/iMotionSensor.d.ts +7 -1
- package/lib/server/devices/baseDeviceInterfaces/iScene.d.ts +7 -0
- package/lib/server/devices/baseDeviceInterfaces/iShutter.d.ts +7 -0
- package/lib/server/devices/baseDeviceInterfaces/iSmokeDetectorDevice.d.ts +7 -0
- package/lib/server/devices/baseDeviceInterfaces/iSpeaker.d.ts +25 -0
- package/lib/server/devices/baseDeviceInterfaces/iTemperatureSensor.d.ts +11 -0
- package/lib/server/devices/baseDeviceInterfaces/iTemporaryDisableAutomatic.d.ts +7 -0
- package/lib/server/devices/baseDeviceInterfaces/iTvDevice.d.ts +12 -0
- package/lib/server/devices/baseDeviceInterfaces/iVibrationSensor.d.ts +0 -1
- package/lib/server/devices/blueIris/cameraDevice.d.ts +2 -3
- package/lib/server/devices/blueIris/cameraDevice.js +2 -3
- package/lib/server/devices/dachs/interfaces/KeyListEntity.d.ts +0 -8
- package/lib/server/devices/dachs/interfaces/KeyListEntity.js +0 -8
- package/lib/server/devices/dachs/lib/dachsHttpClient.d.ts +1 -1
- package/lib/server/devices/groups/Window.d.ts +1 -0
- package/lib/server/devices/groups/Window.js +1 -0
- package/lib/server/devices/groups/heatGroup.d.ts +7 -6
- package/lib/server/devices/groups/heatGroup.js +8 -9
- package/lib/server/devices/groups/lightGroup.d.ts +2 -2
- package/lib/server/devices/groups/lightGroup.js +11 -10
- package/lib/server/devices/groups/presenceGroup.d.ts +0 -1
- package/lib/server/devices/groups/presenceGroup.js +0 -1
- package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.d.ts +0 -1
- package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.js +0 -6
- package/lib/server/devices/hmIPDevices/hmIpLampe.js +1 -2
- package/lib/server/devices/hmIPDevices/hmIpRoll.js +2 -2
- package/lib/server/devices/iDeviceUpdater.d.ts +11 -0
- package/lib/server/devices/jsObject/jsObjectEnergyManager.d.ts +1 -1
- package/lib/server/devices/jsObject/jsObjectEnergyManager.js +1 -1
- package/lib/server/devices/sharedFunctions/lampUtils.d.ts +1 -0
- package/lib/server/devices/sharedFunctions/lampUtils.js +32 -15
- package/lib/server/devices/wledDevice.d.ts +1 -0
- package/lib/server/devices/wledDevice.js +13 -8
- package/lib/server/devices/zigbee/BaseDevices/ZigbeeActuator.js +1 -2
- package/lib/server/devices/zigbee/BaseDevices/zigbeeDevice.d.ts +0 -2
- package/lib/server/devices/zigbee/BaseDevices/zigbeeDevice.js +9 -18
- package/lib/server/devices/zigbee/BaseDevices/zigbeeDimmer.js +8 -8
- package/lib/server/devices/zigbee/BaseDevices/zigbeeLedRGBCCT.d.ts +2 -1
- package/lib/server/devices/zigbee/BaseDevices/zigbeeLedRGBCCT.js +6 -4
- package/lib/server/devices/zigbee/BaseDevices/zigbeeMotionSensor.d.ts +1 -1
- package/lib/server/devices/zigbee/BaseDevices/zigbeeMotionSensor.js +1 -1
- package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.js +3 -3
- package/lib/server/devices/zigbee/BaseDevices/zigbeeSwitch.d.ts +1 -1
- package/lib/server/devices/zigbee/zigbeeAquaraVibra.d.ts +1 -1
- package/lib/server/devices/zigbee/zigbeeEuroHeater.d.ts +2 -3
- package/lib/server/devices/zigbee/zigbeeEuroHeater.js +2 -3
- package/lib/server/ioBroker/connection.d.ts +20 -20
- package/lib/server/ioBroker/connection.js +29 -21
- package/lib/server/ioBroker/socketIOConnectOptions.d.ts +2 -2
- package/lib/server/ioBroker/socketIOVisCommand.d.ts +5 -1
- package/lib/server/services/Sonos/polly-service.js +1 -2
- package/lib/server/services/Translation/res.d.ts +34 -19
- package/lib/server/services/Translation/res.js +34 -19
- package/lib/server/services/ac/ac-device.d.ts +0 -5
- package/lib/server/services/ac/ac-device.js +17 -18
- package/lib/server/services/ac/daikin-service.js +2 -1
- package/lib/server/services/ac/own-daikin-device.js +12 -4
- package/lib/server/services/api/api-service.d.ts +117 -52
- package/lib/server/services/api/api-service.js +160 -68
- package/lib/server/services/blockAutomaticHandler.d.ts +6 -8
- package/lib/server/services/blockAutomaticHandler.js +15 -13
- package/lib/server/services/dbo/iPersist.d.ts +96 -0
- package/lib/server/services/govee/own-govee-device.js +4 -7
- package/lib/server/services/https-service.d.ts +3 -2
- package/lib/server/services/https-service.js +3 -2
- package/lib/server/services/log-service/log-service.d.ts +2 -2
- package/lib/server/services/log-service/log-service.js +2 -2
- package/lib/server/services/news-service.d.ts +5 -6
- package/lib/server/services/news-service.js +5 -6
- package/lib/server/services/room-service/room-service.d.ts +3 -2
- package/lib/server/services/room-service/room-service.js +4 -3
- package/lib/server/services/settings-service.d.ts +3 -2
- package/lib/server/services/settings-service.js +3 -2
- package/lib/server/services/utils/iDisposeable.d.ts +3 -0
- package/lib/server/services/victron/victron-device.d.ts +2 -2
- package/lib/server/services/victron/victron-device.js +2 -2
- package/lib/server/services/weather/weather-current.d.ts +0 -2
- package/lib/server/services/weather/weather-service.d.ts +4 -1
- package/lib/server/services/weather/weather-service.js +4 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -5
|
@@ -9,7 +9,7 @@ import { DachsClientOptions, iFlattenedCompleteResponse, KeyListEntityResponse }
|
|
|
9
9
|
*/
|
|
10
10
|
export declare class DachsHttpClient {
|
|
11
11
|
private options;
|
|
12
|
-
private url;
|
|
12
|
+
private readonly url;
|
|
13
13
|
private axiosInstance;
|
|
14
14
|
constructor(options: DachsClientOptions);
|
|
15
15
|
/**
|
|
@@ -13,6 +13,7 @@ export declare class Window extends BaseGroup {
|
|
|
13
13
|
constructor(roomName: string, handleIds?: string[], vibrationIds?: string[], shutterIds?: string[], magnetIds?: string[]);
|
|
14
14
|
/**
|
|
15
15
|
* sets the desired Pos and moves rollo to this level
|
|
16
|
+
* @param c - The command to execute
|
|
16
17
|
*/
|
|
17
18
|
setDesiredPosition(c: WindowSetDesiredPositionCommand): void;
|
|
18
19
|
getHandle(): HmIpGriff[];
|
|
@@ -7,13 +7,13 @@ export declare class HeatGroup extends BaseGroup {
|
|
|
7
7
|
settings: HeatGroupSettings;
|
|
8
8
|
constructor(roomName: string, heaterIds: string[], tempSensorIds: string[], humiditySensorIds: string[], acIds: string[]);
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
* @returns
|
|
10
|
+
* Calculates the combined humidity Level in this room
|
|
11
|
+
* @returns The humidity in percent
|
|
12
12
|
*/
|
|
13
13
|
get humidity(): number;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
* @returns
|
|
15
|
+
* Calculates the temperature based on all available sensors.
|
|
16
|
+
* @returns The temperature in °C
|
|
17
17
|
*/
|
|
18
18
|
get temperature(): number;
|
|
19
19
|
get desiredTemp(): number;
|
|
@@ -25,8 +25,9 @@ export declare class HeatGroup extends BaseGroup {
|
|
|
25
25
|
initialize(): void;
|
|
26
26
|
/**
|
|
27
27
|
* Sets all ACs to new desired Value
|
|
28
|
-
*
|
|
29
|
-
* @param
|
|
28
|
+
* TODO: Migrate to new Command System
|
|
29
|
+
* @param newDesiredState - The new desired (on/off) state
|
|
30
|
+
* @param force - Whether this was a manual trigger, thus blocking automatic changes for 1 hour
|
|
30
31
|
*/
|
|
31
32
|
setAc(newDesiredState: boolean, force?: boolean): void;
|
|
32
33
|
deleteAutomaticPoint(name: string): void;
|
|
@@ -19,8 +19,8 @@ class HeatGroup extends base_group_1.BaseGroup {
|
|
|
19
19
|
this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.Ac, new device_list_1.DeviceList(acIds));
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
* @returns
|
|
22
|
+
* Calculates the combined humidity Level in this room
|
|
23
|
+
* @returns The humidity in percent
|
|
24
24
|
*/
|
|
25
25
|
get humidity() {
|
|
26
26
|
let humidity = baseDeviceInterfaces_1.UNDEFINED_HUMIDITY_VALUE;
|
|
@@ -40,8 +40,8 @@ class HeatGroup extends base_group_1.BaseGroup {
|
|
|
40
40
|
return humidity;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
* @returns
|
|
43
|
+
* Calculates the temperature based on all available sensors.
|
|
44
|
+
* @returns The temperature in °C
|
|
45
45
|
*/
|
|
46
46
|
get temperature() {
|
|
47
47
|
let temp = baseDeviceInterfaces_1.UNDEFINED_TEMP_VALUE;
|
|
@@ -127,8 +127,9 @@ class HeatGroup extends base_group_1.BaseGroup {
|
|
|
127
127
|
}
|
|
128
128
|
/**
|
|
129
129
|
* Sets all ACs to new desired Value
|
|
130
|
-
*
|
|
131
|
-
* @param
|
|
130
|
+
* TODO: Migrate to new Command System
|
|
131
|
+
* @param newDesiredState - The new desired (on/off) state
|
|
132
|
+
* @param force - Whether this was a manual trigger, thus blocking automatic changes for 1 hour
|
|
132
133
|
*/
|
|
133
134
|
setAc(newDesiredState, force = false) {
|
|
134
135
|
const devs = this.getOwnAcDevices();
|
|
@@ -139,9 +140,7 @@ class HeatGroup extends base_group_1.BaseGroup {
|
|
|
139
140
|
continue;
|
|
140
141
|
}
|
|
141
142
|
dev.turnOff();
|
|
142
|
-
|
|
143
|
-
dev.deactivateAutomaticChange(60 * 60 * 1000);
|
|
144
|
-
}
|
|
143
|
+
dev.blockAutomationHandler.disableAutomatic(new models_1.BlockAutomaticCommand(force ? models_1.CommandSource.Force : models_1.CommandSource.Unknown, 60 * 60 * 1000));
|
|
145
144
|
}
|
|
146
145
|
}
|
|
147
146
|
deleteAutomaticPoint(name) {
|
|
@@ -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;
|
|
@@ -70,7 +70,7 @@ class LightGroup extends base_group_1.BaseGroup {
|
|
|
70
70
|
switchAll(c) {
|
|
71
71
|
this.getAllAsActuator().forEach((a) => {
|
|
72
72
|
if (a.settings.includeInAmbientLight && !c.isForceAction && !c.on && this._ambientLightOn) {
|
|
73
|
-
a.log(models_1.LogLevel.Info, `Ambient light mode is active --> Skip non force light off command in ${this.roomName}`);
|
|
73
|
+
a.log(models_1.LogLevel.Info, `Ambient light mode is active --> Skip non force light off command in ${this.roomName}; command: ${c.logMessage}`);
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
a.setActuator(c);
|
|
@@ -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(
|
|
109
|
+
this.setAllLampenTimeBased(new models_1.LampSetTimeBasedCommand(c, c.time));
|
|
110
110
|
}
|
|
111
111
|
else {
|
|
112
|
-
this.setAllLampen(new models_1.LampSetLightCommand(
|
|
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(
|
|
118
|
+
this.setAllOutlets(new models_1.ActuatorSetStateCommand(c, false));
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
setAllLampen(c) {
|
|
@@ -133,12 +133,13 @@ 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.
|
|
139
|
-
(time === models_1.TimeOfDay.
|
|
140
|
-
(time === models_1.TimeOfDay.
|
|
141
|
-
|
|
138
|
+
if ((c.time === models_1.TimeOfDay.Daylight && s.settings.dayOn) ||
|
|
139
|
+
(c.time === models_1.TimeOfDay.Night && s.settings.nightOn) ||
|
|
140
|
+
(c.time === models_1.TimeOfDay.BeforeSunrise && s.settings.dawnOn) ||
|
|
141
|
+
(c.time === models_1.TimeOfDay.AfterSunset && s.settings.duskOn)) {
|
|
142
|
+
s.setActuator(new models_1.ActuatorSetStateCommand(c, true, `LightGroup setAllActuatorsTimeBased`, c.timeout));
|
|
142
143
|
}
|
|
143
144
|
});
|
|
144
145
|
}
|
|
@@ -15,7 +15,6 @@ export declare class PresenceGroup extends BaseGroup {
|
|
|
15
15
|
private motionSensorOnLastLeft;
|
|
16
16
|
/**
|
|
17
17
|
* In case of an existing delayed last left callback timeout, this removes it.
|
|
18
|
-
* @private
|
|
19
18
|
*/
|
|
20
19
|
private resetLastLeftTimeout;
|
|
21
20
|
private motionSensorOnFirstEnter;
|
|
@@ -38,7 +38,6 @@ export declare class HmIpHeizgruppe extends HmIPDevice implements iTemperatureSe
|
|
|
38
38
|
addHumidityCallback(pCallback: (pValue: number) => void): void;
|
|
39
39
|
getBelongingHeizungen(): iHeater[];
|
|
40
40
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
41
|
-
stopAutomaticCheck(): void;
|
|
42
41
|
checkAutomaticChange(): void;
|
|
43
42
|
addTempChangeCallback(pCallback: (pValue: number) => void): void;
|
|
44
43
|
onTemperaturChange(newTemperatur: number): void;
|
|
@@ -119,12 +119,6 @@ class HmIpHeizgruppe extends hmIpDevice_1.HmIPDevice {
|
|
|
119
119
|
break;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
stopAutomaticCheck() {
|
|
123
|
-
if (this._iAutomaticInterval !== undefined) {
|
|
124
|
-
clearInterval(this._iAutomaticInterval);
|
|
125
|
-
this._iAutomaticInterval = undefined;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
122
|
checkAutomaticChange() {
|
|
129
123
|
var _a, _b, _c, _d;
|
|
130
124
|
if (!this._initialSeasonCheckDone) {
|
|
@@ -25,8 +25,7 @@ class HmIpLampe extends hmIpDevice_1.HmIPDevice {
|
|
|
25
25
|
return this.lightOn;
|
|
26
26
|
}
|
|
27
27
|
restoreTargetAutomaticValue(c) {
|
|
28
|
-
this.
|
|
29
|
-
this.setLight(new models_1.LampSetLightCommand(c, this.targetAutomaticState, 'Lampen RestoreTargetAutomaticValue'));
|
|
28
|
+
this.setLight(new models_1.LampSetLightCommand(c, this.targetAutomaticState));
|
|
30
29
|
}
|
|
31
30
|
update(idSplit, state, initial = false) {
|
|
32
31
|
this.log(models_1.LogLevel.DeepTrace, `Lampen Update : ID: ${idSplit.join('.')} JSON: ${JSON.stringify(state)}`);
|
|
@@ -77,7 +77,6 @@ class HmIpRoll extends hmIpDevice_1.HmIPDevice {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
setLevel(command) {
|
|
80
|
-
this.log(models_2.LogLevel.Debug, command.logMessage);
|
|
81
80
|
let targetLevel = command.level;
|
|
82
81
|
if (!this._firstCommandRecieved && !command.isInitial) {
|
|
83
82
|
this._firstCommandRecieved = true;
|
|
@@ -87,7 +86,7 @@ class HmIpRoll extends hmIpDevice_1.HmIPDevice {
|
|
|
87
86
|
return;
|
|
88
87
|
}
|
|
89
88
|
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
|
+
this.log(models_2.LogLevel.Debug, `Skip Rollo command to Position ${targetLevel} as this is the current one, commandLog: ${command.logMessage}`, services_1.LogDebugType.SkipUnchangedRolloPosition);
|
|
91
90
|
return;
|
|
92
91
|
}
|
|
93
92
|
if (this._setLevelSwitchID === '') {
|
|
@@ -97,6 +96,7 @@ class HmIpRoll extends hmIpDevice_1.HmIPDevice {
|
|
|
97
96
|
if (!this.checkIoConnection(true)) {
|
|
98
97
|
return;
|
|
99
98
|
}
|
|
99
|
+
this.log(models_2.LogLevel.Debug, command.logMessage);
|
|
100
100
|
if (this._window !== undefined) {
|
|
101
101
|
if (this._window.griffeInPosition(models_1.WindowPosition.offen) > 0 && command.level < 100) {
|
|
102
102
|
if (!command.skipOpenWarning) {
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
export interface IDeviceUpdater {
|
|
2
|
+
/**
|
|
3
|
+
* Updates the state of a device
|
|
4
|
+
* @param id - The id of the device
|
|
5
|
+
* @param state - The new state
|
|
6
|
+
* @param initial - Whether this is an initial state update
|
|
7
|
+
*/
|
|
2
8
|
updateState(id: string, state: ioBroker.State, initial?: boolean): void;
|
|
9
|
+
/**
|
|
10
|
+
* Updates the given object
|
|
11
|
+
* @param pId - The id of the object
|
|
12
|
+
* @param pObj - The new object
|
|
13
|
+
*/
|
|
3
14
|
updateObject(pId: string, pObj: ioBroker.Object): void;
|
|
4
15
|
}
|
|
@@ -38,7 +38,7 @@ export declare class JsObjectEnergyManager extends IoBrokerBaseDevice implements
|
|
|
38
38
|
* | drawing | 0W | 100W | 1000W |
|
|
39
39
|
* | selfConsume | 900W | 1000W | 0W |
|
|
40
40
|
* ________________________________________
|
|
41
|
-
|
|
41
|
+
*/
|
|
42
42
|
get excessEnergyConsumerConsumption(): number;
|
|
43
43
|
private _phaseAState;
|
|
44
44
|
get phaseAState(): PhaseState;
|
|
@@ -72,7 +72,7 @@ class JsObjectEnergyManager extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
|
|
|
72
72
|
* | drawing | 0W | 100W | 1000W |
|
|
73
73
|
* | selfConsume | 900W | 1000W | 0W |
|
|
74
74
|
* ________________________________________
|
|
75
|
-
|
|
75
|
+
*/
|
|
76
76
|
get excessEnergyConsumerConsumption() {
|
|
77
77
|
return this._excessEnergyConsumerConsumption;
|
|
78
78
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { iActuator, iLamp } from '../baseDeviceInterfaces';
|
|
2
2
|
import { ActuatorSetStateCommand, LampSetTimeBasedCommand, LampToggleLightCommand } from '../../../models';
|
|
3
3
|
export declare class LampUtils {
|
|
4
|
+
private static stromStossContinueTimeouts;
|
|
4
5
|
static stromStossOn(actuator: iActuator): void;
|
|
5
6
|
static setTimeBased(device: iLamp, c: LampSetTimeBasedCommand): void;
|
|
6
7
|
static checkUnBlock(device: iActuator, command: ActuatorSetStateCommand): boolean;
|
|
@@ -5,21 +5,26 @@ const services_1 = require("../../services");
|
|
|
5
5
|
const models_1 = require("../../../models");
|
|
6
6
|
class LampUtils {
|
|
7
7
|
static stromStossOn(actuator) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
if (!LampUtils.stromStossContinueTimeouts.has(actuator.id)) {
|
|
9
|
+
LampUtils.stromStossContinueTimeouts.set(actuator.id, services_1.Utils.guardedTimeout(() => {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
LampUtils.stromStossContinueTimeouts.delete(actuator.id);
|
|
12
|
+
if ((_b = (_a = actuator.room) === null || _a === void 0 ? void 0 : _a.PraesenzGroup) === null || _b === void 0 ? void 0 : _b.anyPresent()) {
|
|
13
|
+
actuator.setActuator(new models_1.ActuatorSetStateCommand(models_1.CommandSource.Automatic, true, 'StromStoss On due to Presence'));
|
|
14
|
+
}
|
|
15
|
+
}, actuator.settings.stromStossResendTime * 1000, this));
|
|
16
|
+
}
|
|
14
17
|
services_1.Utils.guardedTimeout(() => {
|
|
15
18
|
actuator.setActuator(new models_1.ActuatorSetStateCommand(models_1.CommandSource.Force, false, 'StromStoss Off'));
|
|
16
19
|
}, 3000, this);
|
|
17
20
|
}
|
|
18
21
|
static setTimeBased(device, c) {
|
|
19
|
-
if (
|
|
22
|
+
if (c.isManual ||
|
|
23
|
+
(c.time === models_1.TimeOfDay.Daylight && device.settings.dayOn) ||
|
|
24
|
+
(c.time === models_1.TimeOfDay.Night && device.settings.nightOn) ||
|
|
20
25
|
(c.time === models_1.TimeOfDay.BeforeSunrise && device.settings.dawnOn) ||
|
|
21
26
|
(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));
|
|
27
|
+
device.setLight(new models_1.LampSetLightCommand(c, true, `SetLight due to TimeBased ${models_1.TimeOfDay[c.time]}`, c.timeout));
|
|
23
28
|
}
|
|
24
29
|
}
|
|
25
30
|
static checkUnBlock(device, command) {
|
|
@@ -29,8 +34,9 @@ class LampUtils {
|
|
|
29
34
|
!command.on &&
|
|
30
35
|
device.blockAutomationHandler.automaticBlockActive) {
|
|
31
36
|
dontBlock = true;
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
const liftCommand = new models_1.BlockAutomaticLiftBlockCommand(command, 'Reset Automatic Block as we are turning off manually after a force on');
|
|
38
|
+
liftCommand.overrideCommandSource = models_1.CommandSource.Automatic;
|
|
39
|
+
device.blockAutomationHandler.liftAutomaticBlock(liftCommand);
|
|
34
40
|
}
|
|
35
41
|
return dontBlock;
|
|
36
42
|
}
|
|
@@ -42,15 +48,15 @@ class LampUtils {
|
|
|
42
48
|
c.time = services_1.TimeCallbackService.dayType((_a = device.room) === null || _a === void 0 ? void 0 : _a.settings.lampOffset);
|
|
43
49
|
}
|
|
44
50
|
if (newVal && c.time !== undefined) {
|
|
45
|
-
device.setTimeBased(new models_1.LampSetTimeBasedCommand(c, c.time, '
|
|
51
|
+
device.setTimeBased(new models_1.LampSetTimeBasedCommand(c, c.time, '', timeout));
|
|
46
52
|
return true;
|
|
47
53
|
}
|
|
48
|
-
device.setLight(new models_1.LampSetLightCommand(c, newVal, '
|
|
54
|
+
device.setLight(new models_1.LampSetLightCommand(c, newVal, '', timeout));
|
|
49
55
|
return newVal;
|
|
50
56
|
}
|
|
51
57
|
static checkBlockActive(device, c) {
|
|
52
58
|
if (!c.isForceAction && device.blockAutomationHandler.automaticBlockActive) {
|
|
53
|
-
device.log(models_1.LogLevel.Debug, `Skip
|
|
59
|
+
device.log(models_1.LogLevel.Debug, `Skip command to ${c.on} as it is locked until ${new Date(device.blockAutomationHandler.automaticBlockedUntil).toLocaleTimeString()}; command Log: ${c.logMessage}`);
|
|
54
60
|
device.targetAutomaticState = c.on;
|
|
55
61
|
return true;
|
|
56
62
|
}
|
|
@@ -64,22 +70,33 @@ class LampUtils {
|
|
|
64
70
|
return false;
|
|
65
71
|
}
|
|
66
72
|
static setActuator(device, c) {
|
|
73
|
+
if (device.settings.isStromStoss &&
|
|
74
|
+
c.on &&
|
|
75
|
+
c.containsType(models_1.CommandType.ActuatorRestoreTargetAutomaticValueCommand)) {
|
|
76
|
+
// Don't restore automatic state on Strommstoss-Relais as this might result in a loop.
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
67
79
|
const dontBlock = LampUtils.checkUnBlock(device, c);
|
|
68
80
|
if (LampUtils.checkBlockActive(device, c)) {
|
|
69
81
|
return;
|
|
70
82
|
}
|
|
83
|
+
if (c.isAutomaticAction) {
|
|
84
|
+
// Preserve the target state for the automatic handler, as
|
|
85
|
+
device.targetAutomaticState = c.on;
|
|
86
|
+
}
|
|
71
87
|
if (LampUtils.checkUnchanged(device, c)) {
|
|
72
88
|
return;
|
|
73
89
|
}
|
|
74
90
|
device.queuedValue = c.on;
|
|
75
|
-
device.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c
|
|
91
|
+
device.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c, c.on));
|
|
76
92
|
if (device.settings.isStromStoss && c.on) {
|
|
77
93
|
c.timeout = 3000;
|
|
78
94
|
LampUtils.stromStossOn(device);
|
|
79
95
|
}
|
|
80
96
|
if (c.timeout > -1 && !dontBlock) {
|
|
81
|
-
device.blockAutomationHandler.disableAutomatic(c.timeout, models_1.CollisionSolving.overrideIfGreater);
|
|
97
|
+
device.blockAutomationHandler.disableAutomatic(new models_1.BlockAutomaticCommand(c, c.timeout, '', models_1.CollisionSolving.overrideIfGreater));
|
|
82
98
|
}
|
|
83
99
|
}
|
|
84
100
|
}
|
|
85
101
|
exports.LampUtils = LampUtils;
|
|
102
|
+
LampUtils.stromStossContinueTimeouts = new Map();
|
|
@@ -11,6 +11,7 @@ export declare class WledDevice extends IoBrokerBaseDevice implements iDimmableL
|
|
|
11
11
|
settings: WledSettings;
|
|
12
12
|
readonly blockAutomationHandler: BlockAutomaticHandler;
|
|
13
13
|
targetAutomaticState: boolean;
|
|
14
|
+
protected readonly _debounceStateDelay: number;
|
|
14
15
|
private readonly _onID;
|
|
15
16
|
private readonly _presetID;
|
|
16
17
|
private readonly _brightnessID;
|
|
@@ -7,6 +7,7 @@ const services_1 = require("../services");
|
|
|
7
7
|
const models_1 = require("../../models");
|
|
8
8
|
const blockAutomaticHandler_1 = require("../services/blockAutomaticHandler");
|
|
9
9
|
const sharedFunctions_1 = require("./sharedFunctions");
|
|
10
|
+
const DeviceCapability_1 = require("./DeviceCapability");
|
|
10
11
|
class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
|
|
11
12
|
constructor(pInfo) {
|
|
12
13
|
super(pInfo, deviceType_1.DeviceType.WledDevice);
|
|
@@ -16,10 +17,13 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
|
|
|
16
17
|
this.queuedValue = null;
|
|
17
18
|
this.settings = new models_1.WledSettings();
|
|
18
19
|
this.targetAutomaticState = false;
|
|
20
|
+
this._debounceStateDelay = 500;
|
|
19
21
|
this._onID = `${this.info.fullID}.on`;
|
|
20
22
|
this._presetID = `${this.info.fullID}.ps`;
|
|
21
23
|
this._brightnessID = `${this.info.fullID}.bri`;
|
|
22
24
|
this.blockAutomationHandler = new blockAutomaticHandler_1.BlockAutomaticHandler(this.restoreTargetAutomaticValue.bind(this));
|
|
25
|
+
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.lamp);
|
|
26
|
+
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.dimmablelamp);
|
|
23
27
|
}
|
|
24
28
|
get actuatorOn() {
|
|
25
29
|
return this.on;
|
|
@@ -28,8 +32,7 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
|
|
|
28
32
|
return this.on;
|
|
29
33
|
}
|
|
30
34
|
restoreTargetAutomaticValue(c) {
|
|
31
|
-
this.
|
|
32
|
-
this.setLight(new models_1.WledSetLightCommand(c, this.targetAutomaticState, 'Lampen RestoreTargetAutomaticValue'));
|
|
35
|
+
this.setLight(new models_1.WledSetLightCommand(c, this.targetAutomaticState));
|
|
33
36
|
}
|
|
34
37
|
update(idSplit, state, initial = false, _pOverride = false) {
|
|
35
38
|
this.queuedValue = null;
|
|
@@ -47,7 +50,6 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
|
|
|
47
50
|
this.setWled(new models_1.WledSetLightCommand(c, c.on, 'Set Wled due to DimmerSetLightCommand', c.timeout, c.brightness, c.transitionTime, undefined));
|
|
48
51
|
}
|
|
49
52
|
setWled(c) {
|
|
50
|
-
this.log(models_1.LogLevel.Debug, c.logMessage);
|
|
51
53
|
if (this._onID === '') {
|
|
52
54
|
services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `Keine On ID für "${this.info.customName}" bekannt.`);
|
|
53
55
|
return;
|
|
@@ -60,28 +62,31 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
|
|
|
60
62
|
if (sharedFunctions_1.LampUtils.checkBlockActive(this, c)) {
|
|
61
63
|
return;
|
|
62
64
|
}
|
|
65
|
+
this.log(models_1.LogLevel.Debug, c.logMessage);
|
|
63
66
|
if (c.on && c.brightness !== -1 && this.brightness < 10) {
|
|
64
67
|
c.brightness = 10;
|
|
65
68
|
}
|
|
66
|
-
services_1.ServerLogService.writeLog(models_1.LogLevel.Debug, `WLED Schalten: "${this.info.customName}" An: ${c.on}\tHelligkeit: ${c.brightness}%`);
|
|
67
69
|
this.queuedValue = c.on;
|
|
68
|
-
|
|
69
|
-
|
|
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
|
|
70
75
|
this.setState(this._presetID, c.preset, undefined, (err) => {
|
|
71
76
|
services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `WLED schalten ergab Fehler: ${err}`);
|
|
72
77
|
});
|
|
73
78
|
}
|
|
74
79
|
else if (c.brightness > -1) {
|
|
80
|
+
// This also turns the device on
|
|
75
81
|
this.setState(this._brightnessID, c.brightness, undefined, (err) => {
|
|
76
82
|
services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `Dimmer Helligkeit schalten ergab Fehler: ${err}`);
|
|
77
83
|
});
|
|
78
84
|
}
|
|
79
85
|
if (c.timeout !== undefined && c.timeout > -1 && !dontBlock) {
|
|
80
|
-
this.blockAutomationHandler.disableAutomatic(c.timeout, models_1.CollisionSolving.overrideIfGreater);
|
|
86
|
+
this.blockAutomationHandler.disableAutomatic(new models_1.BlockAutomaticCommand(c, c.timeout, '', models_1.CollisionSolving.overrideIfGreater));
|
|
81
87
|
}
|
|
82
88
|
}
|
|
83
89
|
setTimeBased(c) {
|
|
84
|
-
this.log(models_1.LogLevel.Debug, `Wled setTimeBased ${c.time}`);
|
|
85
90
|
this.setWled(models_1.WledSetLightCommand.byTimeBased(this.settings, c));
|
|
86
91
|
}
|
|
87
92
|
persist() {
|
|
@@ -23,8 +23,7 @@ class ZigbeeActuator extends zigbeeDevice_1.ZigbeeDevice {
|
|
|
23
23
|
this.blockAutomationHandler = new blockAutomaticHandler_1.BlockAutomaticHandler(this.restoreTargetAutomaticValue.bind(this));
|
|
24
24
|
}
|
|
25
25
|
restoreTargetAutomaticValue(c) {
|
|
26
|
-
this.
|
|
27
|
-
this.setActuator(new models_1.ActuatorSetStateCommand(c, this.targetAutomaticState, 'Restore Target Automatic value'));
|
|
26
|
+
this.setActuator(new models_1.ActuatorSetStateCommand(c, this.targetAutomaticState));
|
|
28
27
|
}
|
|
29
28
|
update(idSplit, state, initial = false, handledByChildObject = false) {
|
|
30
29
|
if (!handledByChildObject) {
|
|
@@ -6,8 +6,6 @@ import { iDisposable } from '../../../services';
|
|
|
6
6
|
export declare class ZigbeeDevice extends IoBrokerBaseDevice implements iDisposable {
|
|
7
7
|
protected _available: boolean;
|
|
8
8
|
protected _dontSendOnUnavailable: boolean;
|
|
9
|
-
protected _debounceStateDelay: number;
|
|
10
|
-
private _lastWrite;
|
|
11
9
|
private readonly _deviceQueryId;
|
|
12
10
|
get available(): boolean;
|
|
13
11
|
protected _linkQuality: number;
|
|
@@ -18,9 +18,6 @@ class ZigbeeDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
|
|
|
18
18
|
super(pInfo, pType);
|
|
19
19
|
this._available = false;
|
|
20
20
|
this._dontSendOnUnavailable = false;
|
|
21
|
-
// If configured > 0, this indicates the minimum time between state writes in ms
|
|
22
|
-
this._debounceStateDelay = 0;
|
|
23
|
-
this._lastWrite = 0;
|
|
24
21
|
this._linkQuality = 0;
|
|
25
22
|
this.persistZigbeeInterval = services_1.Utils.guardedInterval(() => {
|
|
26
23
|
this.persistZigbeeDevice();
|
|
@@ -40,16 +37,18 @@ class ZigbeeDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
|
|
|
40
37
|
}
|
|
41
38
|
switch (idSplit[3]) {
|
|
42
39
|
case 'available':
|
|
43
|
-
|
|
44
|
-
if (
|
|
45
|
-
this.log(models_1.LogLevel.Debug, `
|
|
40
|
+
const newAvailability = state.val;
|
|
41
|
+
if (this._available && !newAvailability) {
|
|
42
|
+
this.log(models_1.LogLevel.Debug, `Device became unavailable.`);
|
|
46
43
|
}
|
|
44
|
+
this._available = newAvailability;
|
|
47
45
|
break;
|
|
48
46
|
case 'link_quality':
|
|
49
|
-
|
|
50
|
-
if (this._linkQuality
|
|
51
|
-
this.log(models_1.LogLevel.Debug, `
|
|
47
|
+
const newValue = state.val;
|
|
48
|
+
if (this._linkQuality > 5 && newValue <= 5) {
|
|
49
|
+
this.log(models_1.LogLevel.Debug, `The link-quality dropped to a critical level: ${newValue}`);
|
|
52
50
|
}
|
|
51
|
+
this._linkQuality = state.val;
|
|
53
52
|
break;
|
|
54
53
|
}
|
|
55
54
|
this.stateMap.set(idSplit[3], state);
|
|
@@ -76,15 +75,7 @@ class ZigbeeDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
|
|
|
76
75
|
this.log(models_1.LogLevel.Warn, `Device unavailable --> Not changing ${pointId} to ${state}`);
|
|
77
76
|
return;
|
|
78
77
|
}
|
|
79
|
-
|
|
80
|
-
this._lastWrite = services_1.Utils.nowMS();
|
|
81
|
-
super.setState(pointId, state, onSuccess, onError);
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
services_1.Utils.guardedTimeout(() => {
|
|
85
|
-
this.log(models_1.LogLevel.Trace, `Debounced write to ${pointId} to ${state}`);
|
|
86
|
-
this.setState(pointId, state, onSuccess, onError);
|
|
87
|
-
}, this._debounceStateDelay, this);
|
|
78
|
+
super.setState(pointId, state, onSuccess, onError);
|
|
88
79
|
}
|
|
89
80
|
}
|
|
90
81
|
exports.ZigbeeDevice = ZigbeeDevice;
|
|
@@ -35,7 +35,7 @@ class ZigbeeDimmer extends index_1.ZigbeeDevice {
|
|
|
35
35
|
return this.lightOn;
|
|
36
36
|
}
|
|
37
37
|
restoreTargetAutomaticValue(c) {
|
|
38
|
-
this.setActuator(new models_1.ActuatorSetStateCommand(c, this.targetAutomaticState
|
|
38
|
+
this.setActuator(new models_1.ActuatorSetStateCommand(c, this.targetAutomaticState));
|
|
39
39
|
}
|
|
40
40
|
update(idSplit, state, initial = false) {
|
|
41
41
|
this.queuedValue = null;
|
|
@@ -62,7 +62,7 @@ class ZigbeeDimmer extends index_1.ZigbeeDevice {
|
|
|
62
62
|
this.setLight(models_1.DimmerSetLightCommand.byTimeBased(this.settings, c));
|
|
63
63
|
}
|
|
64
64
|
setActuator(c) {
|
|
65
|
-
this.setLight(new models_1.DimmerSetLightCommand(c, c.on, '
|
|
65
|
+
this.setLight(new models_1.DimmerSetLightCommand(c, c.on, '', c.timeout));
|
|
66
66
|
}
|
|
67
67
|
toggleActuator(c) {
|
|
68
68
|
const setActuatorCommand = models_1.ActuatorSetStateCommand.byActuatorAndToggleCommand(this, c);
|
|
@@ -82,26 +82,26 @@ class ZigbeeDimmer extends index_1.ZigbeeDevice {
|
|
|
82
82
|
this.log(models_1.LogLevel.Error, `Keine Connection bekannt.`);
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
if (c.transitionTime > -1) {
|
|
86
|
-
this.setState(this._stateIdTransitionTime, c.transitionTime);
|
|
87
|
-
}
|
|
88
85
|
const dontBlock = sharedFunctions_1.LampUtils.checkUnBlock(this, c);
|
|
89
86
|
if (sharedFunctions_1.LampUtils.checkBlockActive(this, c)) {
|
|
90
87
|
return;
|
|
91
88
|
}
|
|
89
|
+
if (c.transitionTime > -1) {
|
|
90
|
+
this.setState(this._stateIdTransitionTime, c.transitionTime);
|
|
91
|
+
}
|
|
92
92
|
if (c.on && c.brightness <= 0 && this.brightness < 10) {
|
|
93
93
|
c.brightness = 10;
|
|
94
94
|
}
|
|
95
|
-
this.log(models_1.LogLevel.Debug, `Set Light Acutator to "${c.on}" with brightness ${c.brightness}`, services_1.LogDebugType.SetActuator);
|
|
96
95
|
if (c.timeout > -1 && !dontBlock) {
|
|
97
|
-
this.blockAutomationHandler.disableAutomatic(c
|
|
96
|
+
this.blockAutomationHandler.disableAutomatic(new models_1.BlockAutomaticCommand(c, c.timeout));
|
|
98
97
|
}
|
|
99
98
|
if (((_a = services_1.SettingsService.settings.ioBroker) === null || _a === void 0 ? void 0 : _a.useZigbee2mqtt) && !c.on) {
|
|
100
99
|
// With zigbee2mqtt to turn on only setting brighness>0 is needed, so we need state only for turning off
|
|
101
|
-
this.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c
|
|
100
|
+
this.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c, c.on));
|
|
102
101
|
this.queuedValue = c.on;
|
|
103
102
|
return;
|
|
104
103
|
}
|
|
104
|
+
this.log(models_1.LogLevel.Debug, c.logMessage, services_1.LogDebugType.SetActuator);
|
|
105
105
|
if (c.brightness >= this.settings.turnOnThreshhold) {
|
|
106
106
|
this.setBrightnessState(c.brightness);
|
|
107
107
|
return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeviceType } from '../../deviceType';
|
|
2
|
-
import { LampSetTimeBasedCommand, LedSetLightCommand, LedSettings } from '../../../../models';
|
|
2
|
+
import { ActuatorSetStateCommand, LampSetTimeBasedCommand, LedSetLightCommand, LedSettings } from '../../../../models';
|
|
3
3
|
import { IoBrokerDeviceInfo } from '../../IoBrokerDeviceInfo';
|
|
4
4
|
import { iLedRgbCct } from '../../baseDeviceInterfaces/iLedRgbCct';
|
|
5
5
|
import { ZigbeeDimmer } from './zigbeeDimmer';
|
|
@@ -20,6 +20,7 @@ export declare abstract class ZigbeeLedRGBCCT extends ZigbeeDimmer implements iL
|
|
|
20
20
|
* @inheritDoc
|
|
21
21
|
*/
|
|
22
22
|
setTimeBased(c: LampSetTimeBasedCommand): void;
|
|
23
|
+
setActuator(c: ActuatorSetStateCommand): void;
|
|
23
24
|
/**
|
|
24
25
|
* @inheritDoc
|
|
25
26
|
*/
|