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
|
@@ -1,28 +1,37 @@
|
|
|
1
1
|
import { DeviceSettings } from './deviceSettings';
|
|
2
2
|
export declare class ActuatorSettings extends DeviceSettings {
|
|
3
|
+
/**
|
|
4
|
+
* Whether to turn on the device at dawn in time-based commands or automatic.
|
|
5
|
+
*/
|
|
3
6
|
dawnOn: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Whether to turn on the device at dusk in time-based commands or automatic.
|
|
9
|
+
*/
|
|
4
10
|
duskOn: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether to turn on the device at night in time-based commands or automatic.
|
|
13
|
+
*/
|
|
5
14
|
nightOn: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Whether to turn on the device at day in time-based commands or automatic.
|
|
17
|
+
*/
|
|
18
|
+
dayOn: boolean;
|
|
6
19
|
/**
|
|
7
20
|
* Indicates if this device controls e.g. an Eltako, which has it's own Turn Off Time logic.
|
|
8
|
-
* @type {boolean}
|
|
9
21
|
*/
|
|
10
22
|
isStromStoss: boolean;
|
|
11
23
|
/**
|
|
12
24
|
* Whether after manually turning off a previously manually turned on device, fall back to automatic mode.
|
|
13
25
|
* Instead of switching to a forced off state.
|
|
14
|
-
* @type {boolean}
|
|
15
26
|
*/
|
|
16
27
|
resetToAutomaticOnForceOffAfterForceOn: boolean;
|
|
17
28
|
/**
|
|
18
29
|
* If this is an Actuator controling a time based relais,
|
|
19
30
|
* this indicates the time after which we retrigger the relais.
|
|
20
|
-
* @type {number}
|
|
21
31
|
*/
|
|
22
32
|
stromStossResendTime: number;
|
|
23
33
|
/**
|
|
24
34
|
* Whether to include this device in the ambient light option.
|
|
25
|
-
* @type {boolean}
|
|
26
35
|
*/
|
|
27
36
|
includeInAmbientLight: boolean;
|
|
28
37
|
fromPartialObject(data: Partial<ActuatorSettings>): void;
|
|
@@ -6,42 +6,52 @@ const server_1 = require("../../server");
|
|
|
6
6
|
class ActuatorSettings extends deviceSettings_1.DeviceSettings {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments);
|
|
9
|
+
/**
|
|
10
|
+
* Whether to turn on the device at dawn in time-based commands or automatic.
|
|
11
|
+
*/
|
|
9
12
|
this.dawnOn = true;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to turn on the device at dusk in time-based commands or automatic.
|
|
15
|
+
*/
|
|
10
16
|
this.duskOn = true;
|
|
17
|
+
/**
|
|
18
|
+
* Whether to turn on the device at night in time-based commands or automatic.
|
|
19
|
+
*/
|
|
11
20
|
this.nightOn = true;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to turn on the device at day in time-based commands or automatic.
|
|
23
|
+
*/
|
|
24
|
+
this.dayOn = false;
|
|
12
25
|
/**
|
|
13
26
|
* Indicates if this device controls e.g. an Eltako, which has it's own Turn Off Time logic.
|
|
14
|
-
* @type {boolean}
|
|
15
27
|
*/
|
|
16
28
|
this.isStromStoss = false;
|
|
17
29
|
/**
|
|
18
30
|
* Whether after manually turning off a previously manually turned on device, fall back to automatic mode.
|
|
19
31
|
* Instead of switching to a forced off state.
|
|
20
|
-
* @type {boolean}
|
|
21
32
|
*/
|
|
22
33
|
this.resetToAutomaticOnForceOffAfterForceOn = true;
|
|
23
34
|
/**
|
|
24
35
|
* If this is an Actuator controling a time based relais,
|
|
25
36
|
* this indicates the time after which we retrigger the relais.
|
|
26
|
-
* @type {number}
|
|
27
37
|
*/
|
|
28
38
|
this.stromStossResendTime = 180;
|
|
29
39
|
/**
|
|
30
40
|
* Whether to include this device in the ambient light option.
|
|
31
|
-
* @type {boolean}
|
|
32
41
|
*/
|
|
33
42
|
this.includeInAmbientLight = false;
|
|
34
43
|
}
|
|
35
44
|
fromPartialObject(data) {
|
|
36
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
45
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
37
46
|
this.dawnOn = (_a = data.dawnOn) !== null && _a !== void 0 ? _a : this.dawnOn;
|
|
38
47
|
this.duskOn = (_b = data.duskOn) !== null && _b !== void 0 ? _b : this.duskOn;
|
|
39
48
|
this.nightOn = (_c = data.nightOn) !== null && _c !== void 0 ? _c : this.nightOn;
|
|
40
|
-
this.
|
|
41
|
-
this.
|
|
49
|
+
this.dayOn = (_d = data.dayOn) !== null && _d !== void 0 ? _d : this.dayOn;
|
|
50
|
+
this.isStromStoss = (_e = data.isStromStoss) !== null && _e !== void 0 ? _e : this.isStromStoss;
|
|
51
|
+
this.stromStossResendTime = (_f = data.stromStossResendTime) !== null && _f !== void 0 ? _f : this.stromStossResendTime;
|
|
42
52
|
this.resetToAutomaticOnForceOffAfterForceOn =
|
|
43
|
-
(
|
|
44
|
-
this.includeInAmbientLight = (
|
|
53
|
+
(_g = data.resetToAutomaticOnForceOffAfterForceOn) !== null && _g !== void 0 ? _g : this.resetToAutomaticOnForceOffAfterForceOn;
|
|
54
|
+
this.includeInAmbientLight = (_h = data.includeInAmbientLight) !== null && _h !== void 0 ? _h : this.includeInAmbientLight;
|
|
45
55
|
super.fromPartialObject(data);
|
|
46
56
|
}
|
|
47
57
|
toJSON() {
|
|
@@ -2,7 +2,6 @@ import { DeviceSettings } from './deviceSettings';
|
|
|
2
2
|
export declare class GarageDoorOpenerSettings extends DeviceSettings {
|
|
3
3
|
/**
|
|
4
4
|
* In case the sensor detects open door instead of closed
|
|
5
|
-
* @type {boolean}
|
|
6
5
|
*/
|
|
7
6
|
invertSensor: boolean;
|
|
8
7
|
fromPartialObject(data: Partial<GarageDoorOpenerSettings>): void;
|
|
@@ -5,34 +5,28 @@ export declare class HeaterSettings extends DeviceSettings {
|
|
|
5
5
|
/**
|
|
6
6
|
* Whether this device should be controlled using only valve position
|
|
7
7
|
* !! Only certain devices allow direct controlling of valve Position !!
|
|
8
|
-
* @type {boolean}
|
|
9
8
|
*/
|
|
10
9
|
controlByPid: boolean;
|
|
11
10
|
controlByTempDiff: boolean;
|
|
12
11
|
/**
|
|
13
12
|
* Whether this device should turn off at Start of summer season and only heat in winter
|
|
14
|
-
* @type {boolean}
|
|
15
13
|
*/
|
|
16
14
|
seasonalTurnOffActive: boolean;
|
|
17
15
|
/**
|
|
18
16
|
*
|
|
19
17
|
* The day in a year after which SeasonalHeater should be turned off completly
|
|
20
|
-
* @type {number}
|
|
21
18
|
*/
|
|
22
19
|
seasonTurnOffDay: number;
|
|
23
20
|
/**
|
|
24
21
|
* The day in a year after which SeasonalHeater should be turned to automatic
|
|
25
|
-
* @type {number}
|
|
26
22
|
*/
|
|
27
23
|
seasonTurnOnDay: number;
|
|
28
24
|
/**
|
|
29
25
|
* In case of pid Control the forced minimum percentage for this heater valve
|
|
30
|
-
* @type {number}
|
|
31
26
|
*/
|
|
32
27
|
pidForcedMinimum: number;
|
|
33
28
|
/**
|
|
34
29
|
* Whether this AC should be turned off for some time manually
|
|
35
|
-
* @type {boolean}
|
|
36
30
|
*/
|
|
37
31
|
manualDisabled: boolean;
|
|
38
32
|
fromPartialObject(data: Partial<HeaterSettings>): void;
|
|
@@ -11,34 +11,28 @@ class HeaterSettings extends deviceSettings_1.DeviceSettings {
|
|
|
11
11
|
/**
|
|
12
12
|
* Whether this device should be controlled using only valve position
|
|
13
13
|
* !! Only certain devices allow direct controlling of valve Position !!
|
|
14
|
-
* @type {boolean}
|
|
15
14
|
*/
|
|
16
15
|
this.controlByPid = false;
|
|
17
16
|
this.controlByTempDiff = false;
|
|
18
17
|
/**
|
|
19
18
|
* Whether this device should turn off at Start of summer season and only heat in winter
|
|
20
|
-
* @type {boolean}
|
|
21
19
|
*/
|
|
22
20
|
this.seasonalTurnOffActive = true;
|
|
23
21
|
/**
|
|
24
22
|
*
|
|
25
23
|
* The day in a year after which SeasonalHeater should be turned off completly
|
|
26
|
-
* @type {number}
|
|
27
24
|
*/
|
|
28
25
|
this.seasonTurnOffDay = 99;
|
|
29
26
|
/**
|
|
30
27
|
* The day in a year after which SeasonalHeater should be turned to automatic
|
|
31
|
-
* @type {number}
|
|
32
28
|
*/
|
|
33
29
|
this.seasonTurnOnDay = 267;
|
|
34
30
|
/**
|
|
35
31
|
* In case of pid Control the forced minimum percentage for this heater valve
|
|
36
|
-
* @type {number}
|
|
37
32
|
*/
|
|
38
33
|
this.pidForcedMinimum = 1;
|
|
39
34
|
/**
|
|
40
35
|
* Whether this AC should be turned off for some time manually
|
|
41
|
-
* @type {boolean}
|
|
42
36
|
*/
|
|
43
37
|
this.manualDisabled = false;
|
|
44
38
|
}
|
|
@@ -25,24 +25,16 @@ class LedSettings extends dimmerSettings_1.DimmerSettings {
|
|
|
25
25
|
this.nightColorTemp = -1;
|
|
26
26
|
}
|
|
27
27
|
fromPartialObject(data) {
|
|
28
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p
|
|
29
|
-
this.
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
38
|
-
this.nightOn = (_k = data.nightOn) !== null && _k !== void 0 ? _k : this.nightOn;
|
|
39
|
-
this.nightBrightness = (_l = data.nightBrightness) !== null && _l !== void 0 ? _l : this.nightBrightness;
|
|
40
|
-
this.nightColorTemp = (_m = data.nightColorTemp) !== null && _m !== void 0 ? _m : this.nightColorTemp;
|
|
41
|
-
this.defaultColor = (_p = server_1.Utils.formatHex((_o = data.defaultColor) !== null && _o !== void 0 ? _o : this.defaultColor)) !== null && _p !== void 0 ? _p : LedSettings.fallbackColor;
|
|
42
|
-
this.dayColor = (_r = server_1.Utils.formatHex((_q = data.dayColor) !== null && _q !== void 0 ? _q : this.dayColor)) !== null && _r !== void 0 ? _r : LedSettings.fallbackColor;
|
|
43
|
-
this.dawnColor = (_t = server_1.Utils.formatHex((_s = data.dawnColor) !== null && _s !== void 0 ? _s : this.dawnColor)) !== null && _t !== void 0 ? _t : LedSettings.fallbackColor;
|
|
44
|
-
this.duskColor = (_v = server_1.Utils.formatHex((_u = data.duskColor) !== null && _u !== void 0 ? _u : this.duskColor)) !== null && _v !== void 0 ? _v : LedSettings.fallbackColor;
|
|
45
|
-
this.nightColor = (_x = server_1.Utils.formatHex((_w = data.nightColor) !== null && _w !== void 0 ? _w : this.nightColor)) !== null && _x !== void 0 ? _x : LedSettings.fallbackColor;
|
|
28
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
29
|
+
this.dayColorTemp = (_a = data.dayColorTemp) !== null && _a !== void 0 ? _a : this.dayColorTemp;
|
|
30
|
+
this.dawnColorTemp = (_b = data.dawnColorTemp) !== null && _b !== void 0 ? _b : this.dawnColorTemp;
|
|
31
|
+
this.duskColorTemp = (_c = data.duskColorTemp) !== null && _c !== void 0 ? _c : this.duskColorTemp;
|
|
32
|
+
this.nightColorTemp = (_d = data.nightColorTemp) !== null && _d !== void 0 ? _d : this.nightColorTemp;
|
|
33
|
+
this.defaultColor = (_f = server_1.Utils.formatHex((_e = data.defaultColor) !== null && _e !== void 0 ? _e : this.defaultColor)) !== null && _f !== void 0 ? _f : LedSettings.fallbackColor;
|
|
34
|
+
this.dayColor = (_h = server_1.Utils.formatHex((_g = data.dayColor) !== null && _g !== void 0 ? _g : this.dayColor)) !== null && _h !== void 0 ? _h : LedSettings.fallbackColor;
|
|
35
|
+
this.dawnColor = (_k = server_1.Utils.formatHex((_j = data.dawnColor) !== null && _j !== void 0 ? _j : this.dawnColor)) !== null && _k !== void 0 ? _k : LedSettings.fallbackColor;
|
|
36
|
+
this.duskColor = (_m = server_1.Utils.formatHex((_l = data.duskColor) !== null && _l !== void 0 ? _l : this.duskColor)) !== null && _m !== void 0 ? _m : LedSettings.fallbackColor;
|
|
37
|
+
this.nightColor = (_p = server_1.Utils.formatHex((_o = data.nightColor) !== null && _o !== void 0 ? _o : this.nightColor)) !== null && _p !== void 0 ? _p : LedSettings.fallbackColor;
|
|
46
38
|
super.fromPartialObject(data);
|
|
47
39
|
}
|
|
48
40
|
toJSON() {
|
|
@@ -2,7 +2,6 @@ import { DeviceSettings } from './deviceSettings';
|
|
|
2
2
|
export declare class MotionSensorSettings extends DeviceSettings {
|
|
3
3
|
/**
|
|
4
4
|
* If set to false, a detected movement on this sensor will block certain alarms on windows in this room
|
|
5
|
-
* @type {boolean}
|
|
6
5
|
*/
|
|
7
6
|
seesWindow: boolean;
|
|
8
7
|
excludeFromNightAlarm: boolean;
|
|
@@ -8,7 +8,6 @@ class MotionSensorSettings extends deviceSettings_1.DeviceSettings {
|
|
|
8
8
|
super(...arguments);
|
|
9
9
|
/**
|
|
10
10
|
* If set to false, a detected movement on this sensor will block certain alarms on windows in this room
|
|
11
|
-
* @type {boolean}
|
|
12
11
|
*/
|
|
13
12
|
this.seesWindow = true;
|
|
14
13
|
this.excludeFromNightAlarm = false;
|
|
@@ -4,18 +4,15 @@ export declare class ShutterSettings extends DeviceSettings {
|
|
|
4
4
|
msTilBot: number;
|
|
5
5
|
/**
|
|
6
6
|
* The direction this shutter is facing (0 = North, 180 = South)
|
|
7
|
-
* @type {number}
|
|
8
7
|
*/
|
|
9
8
|
direction: number;
|
|
10
9
|
/**
|
|
11
10
|
* The desired position, when the shutter should perform a heat reduction.
|
|
12
|
-
* @type {number}
|
|
13
11
|
*/
|
|
14
12
|
heatReductionPosition: number;
|
|
15
13
|
/**
|
|
16
14
|
* Some shutter give no position feedback on their own, so by knowing the durations in either direction,
|
|
17
15
|
* we can programmatically trigger the callbacks.
|
|
18
|
-
* @type {boolean}
|
|
19
16
|
*/
|
|
20
17
|
triggerPositionUpdateByTime: boolean;
|
|
21
18
|
fromPartialObject(data: Partial<ShutterSettings>): void;
|
|
@@ -10,18 +10,15 @@ class ShutterSettings extends deviceSettings_1.DeviceSettings {
|
|
|
10
10
|
this.msTilBot = -1;
|
|
11
11
|
/**
|
|
12
12
|
* The direction this shutter is facing (0 = North, 180 = South)
|
|
13
|
-
* @type {number}
|
|
14
13
|
*/
|
|
15
14
|
this.direction = 180;
|
|
16
15
|
/**
|
|
17
16
|
* The desired position, when the shutter should perform a heat reduction.
|
|
18
|
-
* @type {number}
|
|
19
17
|
*/
|
|
20
18
|
this.heatReductionPosition = 40;
|
|
21
19
|
/**
|
|
22
20
|
* Some shutter give no position feedback on their own, so by knowing the durations in either direction,
|
|
23
21
|
* we can programmatically trigger the callbacks.
|
|
24
|
-
* @type {boolean}
|
|
25
22
|
*/
|
|
26
23
|
this.triggerPositionUpdateByTime = false;
|
|
27
24
|
}
|
|
@@ -16,19 +16,11 @@ class WledSettings extends dimmerSettings_1.DimmerSettings {
|
|
|
16
16
|
this.nightBrightness = 2;
|
|
17
17
|
}
|
|
18
18
|
fromPartialObject(data) {
|
|
19
|
-
var _a, _b, _c, _d
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
24
|
-
this.duskOn = (_e = data.duskOn) !== null && _e !== void 0 ? _e : this.duskOn;
|
|
25
|
-
this.duskBrightness = (_f = data.duskBrightness) !== null && _f !== void 0 ? _f : this.duskBrightness;
|
|
26
|
-
this.nightOn = (_g = data.nightOn) !== null && _g !== void 0 ? _g : this.nightOn;
|
|
27
|
-
this.nightBrightness = (_h = data.nightBrightness) !== null && _h !== void 0 ? _h : this.nightBrightness;
|
|
28
|
-
this.dawnPreset = (_j = data.dawnPreset) !== null && _j !== void 0 ? _j : this.dawnPreset;
|
|
29
|
-
this.dayPreset = (_k = data.dayPreset) !== null && _k !== void 0 ? _k : this.dayPreset;
|
|
30
|
-
this.duskPreset = (_l = data.duskPreset) !== null && _l !== void 0 ? _l : this.duskPreset;
|
|
31
|
-
this.nightPreset = (_m = data.nightPreset) !== null && _m !== void 0 ? _m : this.nightPreset;
|
|
19
|
+
var _a, _b, _c, _d;
|
|
20
|
+
this.dawnPreset = (_a = data.dawnPreset) !== null && _a !== void 0 ? _a : this.dawnPreset;
|
|
21
|
+
this.dayPreset = (_b = data.dayPreset) !== null && _b !== void 0 ? _b : this.dayPreset;
|
|
22
|
+
this.duskPreset = (_c = data.duskPreset) !== null && _c !== void 0 ? _c : this.duskPreset;
|
|
23
|
+
this.nightPreset = (_d = data.nightPreset) !== null && _d !== void 0 ? _d : this.nightPreset;
|
|
32
24
|
super.fromPartialObject(data);
|
|
33
25
|
}
|
|
34
26
|
toJSON() {
|
|
@@ -3,11 +3,13 @@ import { iIdHolder } from '../iIdHolder';
|
|
|
3
3
|
import { GroupSettings } from './groupSettings';
|
|
4
4
|
export declare class HeatGroupSettings extends GroupSettings {
|
|
5
5
|
automaticPoints: TemperatureSettings[];
|
|
6
|
+
/**
|
|
7
|
+
* Whether the temperature should be calculated automatically, or the manualTemperature should be used
|
|
8
|
+
*/
|
|
6
9
|
automaticMode: boolean;
|
|
7
10
|
automaticFallBackTemperatur: number;
|
|
8
11
|
/**
|
|
9
12
|
* Target temperature when automaticMode is disabled
|
|
10
|
-
* @type {number}
|
|
11
13
|
*/
|
|
12
14
|
manualTemperature: number;
|
|
13
15
|
fromPartialObject(data: Partial<HeatGroupSettings>): void;
|
|
@@ -7,11 +7,13 @@ class HeatGroupSettings extends groupSettings_1.GroupSettings {
|
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments);
|
|
9
9
|
this.automaticPoints = [];
|
|
10
|
+
/**
|
|
11
|
+
* Whether the temperature should be calculated automatically, or the manualTemperature should be used
|
|
12
|
+
*/
|
|
10
13
|
this.automaticMode = true;
|
|
11
14
|
this.automaticFallBackTemperatur = 20;
|
|
12
15
|
/**
|
|
13
16
|
* Target temperature when automaticMode is disabled
|
|
14
|
-
* @type {number}
|
|
15
17
|
*/
|
|
16
18
|
this.manualTemperature = 20;
|
|
17
19
|
}
|
|
@@ -3,5 +3,11 @@ import { LogDebugType } from '../server';
|
|
|
3
3
|
export interface iIdHolder {
|
|
4
4
|
readonly id: string;
|
|
5
5
|
readonly customName: string;
|
|
6
|
+
/**
|
|
7
|
+
* Logs a message for this idHolder
|
|
8
|
+
* @param {LogLevel} level - The log level
|
|
9
|
+
* @param {string} message - The message to log
|
|
10
|
+
* @param {LogDebugType} logDebugType - If provided, this message will only be logged if the debug type is enabled in the settings
|
|
11
|
+
*/
|
|
6
12
|
log(level: LogLevel, message: string, logDebugType?: LogDebugType): void;
|
|
7
13
|
}
|
|
@@ -4,8 +4,8 @@ export declare abstract class ObjectSettings {
|
|
|
4
4
|
persist(holder: iIdHolder): void;
|
|
5
5
|
/**
|
|
6
6
|
* Loads the settings from the database
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
7
|
+
* @param holder - The holder of the settings (e.g. a device)
|
|
8
|
+
* @param loadDoneCb - Callback when loading is done
|
|
9
9
|
*/
|
|
10
10
|
initializeFromDb(holder: iIdHolder, loadDoneCb?: () => void): void;
|
|
11
11
|
fromPartialObject(_obj: Partial<ObjectSettings>): void;
|
|
@@ -14,8 +14,8 @@ class ObjectSettings {
|
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Loads the settings from the database
|
|
17
|
-
* @param
|
|
18
|
-
* @param
|
|
17
|
+
* @param holder - The holder of the settings (e.g. a device)
|
|
18
|
+
* @param loadDoneCb - Callback when loading is done
|
|
19
19
|
*/
|
|
20
20
|
initializeFromDb(holder, loadDoneCb) {
|
|
21
21
|
var _a;
|
|
@@ -18,7 +18,7 @@ export declare class RoomBase implements iRoomBase, iIdHolder {
|
|
|
18
18
|
get sunsetShutterCallback(): TimeCallback | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* For Rooms the id is itss name
|
|
21
|
-
* @returns
|
|
21
|
+
* @returns The Roomname
|
|
22
22
|
*/
|
|
23
23
|
get id(): string;
|
|
24
24
|
get customName(): string;
|
|
@@ -39,6 +39,7 @@ export declare class RoomBase implements iRoomBase, iIdHolder {
|
|
|
39
39
|
recalcTimeCallbacks(): void;
|
|
40
40
|
/**
|
|
41
41
|
* Sets the light based on the current time, rollo Position and room Settings
|
|
42
|
+
* @param c - The command to execute
|
|
42
43
|
*/
|
|
43
44
|
setLightTimeBased(c: RoomSetLightTimeBasedCommand): void;
|
|
44
45
|
isNowLightTime(): boolean;
|
|
@@ -41,7 +41,7 @@ class RoomBase {
|
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* For Rooms the id is itss name
|
|
44
|
-
* @returns
|
|
44
|
+
* @returns The Roomname
|
|
45
45
|
*/
|
|
46
46
|
get id() {
|
|
47
47
|
return this.roomName;
|
|
@@ -106,6 +106,7 @@ class RoomBase {
|
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
108
108
|
* Sets the light based on the current time, rollo Position and room Settings
|
|
109
|
+
* @param c - The command to execute
|
|
109
110
|
*/
|
|
110
111
|
setLightTimeBased(c) {
|
|
111
112
|
var _a, _b;
|
|
@@ -115,7 +116,7 @@ class RoomBase {
|
|
|
115
116
|
}
|
|
116
117
|
if (c.movementDependant && this.PraesenzGroup && !((_a = this.PraesenzGroup) === null || _a === void 0 ? void 0 : _a.anyPresent())) {
|
|
117
118
|
this.log(logLevel_1.LogLevel.Trace, 'Turn off lights as no-one is present.');
|
|
118
|
-
this.LightGroup.switchAll(new command_1.ActuatorSetStateCommand(c, false, '
|
|
119
|
+
this.LightGroup.switchAll(new command_1.ActuatorSetStateCommand(c, false, 'No one is present --> Turn off lights.'));
|
|
119
120
|
return;
|
|
120
121
|
}
|
|
121
122
|
if (!this.settings.lampOffset && !this.settings.roomIsAlwaysDark) {
|
|
@@ -132,7 +133,7 @@ class RoomBase {
|
|
|
132
133
|
})))) {
|
|
133
134
|
timeOfDay = server_1.Utils.nowTime().hours > 16 ? timeCallback_1.TimeOfDay.AfterSunset : timeCallback_1.TimeOfDay.BeforeSunrise;
|
|
134
135
|
}
|
|
135
|
-
this.LightGroup.switchTimeConditional(new command_1.LightGroupSwitchTimeConditionalCommand(c, timeOfDay
|
|
136
|
+
this.LightGroup.switchTimeConditional(new command_1.LightGroupSwitchTimeConditionalCommand(c, timeOfDay));
|
|
136
137
|
}
|
|
137
138
|
isNowLightTime() {
|
|
138
139
|
var _a;
|
|
@@ -7,9 +7,26 @@ export interface iRoomBase {
|
|
|
7
7
|
sonnenUntergangLichtCallback: TimeCallback | undefined;
|
|
8
8
|
skipNextRolloUp: boolean;
|
|
9
9
|
roomName: string;
|
|
10
|
+
/**
|
|
11
|
+
* This function initializes the roomBase object of this room
|
|
12
|
+
*/
|
|
10
13
|
initializeBase(): void;
|
|
14
|
+
/**
|
|
15
|
+
* This function stores the roominformation to the database
|
|
16
|
+
*/
|
|
11
17
|
persist(): void;
|
|
18
|
+
/**
|
|
19
|
+
* This function recalculates the timecallbacks (e.g. sunset, sunrise handling)
|
|
20
|
+
*/
|
|
12
21
|
recalcTimeCallbacks(): void;
|
|
22
|
+
/**
|
|
23
|
+
* This function sets the light in the room based on the command
|
|
24
|
+
* @param {RoomSetLightTimeBasedCommand} c - The command to execute
|
|
25
|
+
*/
|
|
13
26
|
setLightTimeBased(c: RoomSetLightTimeBasedCommand): void;
|
|
27
|
+
/**
|
|
28
|
+
* This function checks if it is now light time respecting the room settings, the current time and the daylight hours for this location.
|
|
29
|
+
* @returns {boolean}
|
|
30
|
+
*/
|
|
14
31
|
isNowLightTime(): boolean;
|
|
15
32
|
}
|
|
@@ -14,6 +14,8 @@ export declare abstract class IoBrokerBaseDevice implements iRoomDevice {
|
|
|
14
14
|
};
|
|
15
15
|
private _room;
|
|
16
16
|
readonly deviceCapabilities: DeviceCapability[];
|
|
17
|
+
protected _debounceStateDelay: number;
|
|
18
|
+
protected _lastWrite: number;
|
|
17
19
|
get customName(): string;
|
|
18
20
|
get room(): RoomBase;
|
|
19
21
|
protected readonly individualStateCallbacks: Map<string, Array<(val: ioBroker.StateValue) => void>>;
|
|
@@ -21,31 +23,24 @@ export declare abstract class IoBrokerBaseDevice implements iRoomDevice {
|
|
|
21
23
|
get id(): string;
|
|
22
24
|
/**
|
|
23
25
|
* Getter info
|
|
24
|
-
* @
|
|
26
|
+
* @returns The device info
|
|
25
27
|
*/
|
|
26
28
|
get info(): IoBrokerDeviceInfo;
|
|
27
|
-
/**
|
|
28
|
-
* Setter info
|
|
29
|
-
* @param {IoBrokerDeviceInfo} value
|
|
30
|
-
*/
|
|
31
29
|
set info(value: IoBrokerDeviceInfo);
|
|
32
|
-
/**
|
|
33
|
-
* Getter ioConn
|
|
34
|
-
* @return {IOBrokerConnection}
|
|
35
|
-
*/
|
|
36
30
|
get ioConn(): IOBrokerConnection | undefined;
|
|
37
31
|
static addRoom(shortName: string, settings: RoomDeviceAddingSettings): void;
|
|
38
32
|
static checkMissing(): void;
|
|
39
33
|
loadDeviceSettings(): void;
|
|
40
34
|
/**
|
|
41
35
|
* Allows to react on the state change of a given state with the passed cb
|
|
42
|
-
* @param
|
|
43
|
-
* @param
|
|
36
|
+
* @param stateName - Last part of the id e.g. "available" not "zigbee.0.00158d00053d3e4b.available"
|
|
37
|
+
* @param cb - Desired Callback Action, with passed ioBroker.StateValue
|
|
44
38
|
*/
|
|
45
39
|
addIndividualStateCallback(stateName: string, cb: (val: ioBroker.StateValue) => void): void;
|
|
46
40
|
/**
|
|
47
41
|
* Returns whether a connection to ioBroker is established or not
|
|
48
|
-
* @param showError If true, an error message will be written to the log if the connection is not established
|
|
42
|
+
* @param showError - If true, an error message will be written to the log if the connection is not established
|
|
43
|
+
* @returns Whether a connection exists
|
|
49
44
|
*/
|
|
50
45
|
checkIoConnection(showError?: boolean): boolean;
|
|
51
46
|
abstract update(idSplit: string[], state: ioBroker.State, initial: boolean, pOverride: boolean): void;
|
|
@@ -55,10 +50,10 @@ export declare abstract class IoBrokerBaseDevice implements iRoomDevice {
|
|
|
55
50
|
protected addToCorrectRoom(): void;
|
|
56
51
|
/**
|
|
57
52
|
* Sets the state of a given data point and returns true if that was successful.
|
|
58
|
-
* @param pointId Data point to write to
|
|
59
|
-
* @param state Data to write
|
|
60
|
-
* @param onSuccess Callback to run on successfully written data
|
|
61
|
-
* @param onError Callback to run if an error has occurred during writing the data
|
|
53
|
+
* @param pointId - Data point to write to
|
|
54
|
+
* @param state - Data to write
|
|
55
|
+
* @param onSuccess - Callback to run on successfully written data
|
|
56
|
+
* @param onError - Callback to run if an error has occurred during writing the data
|
|
62
57
|
*/
|
|
63
58
|
protected setState(pointId: string, state: string | number | boolean | ioBroker.State | ioBroker.SettableState | null, onSuccess?: (() => void) | undefined, onError?: ((error: Error) => void) | undefined): void;
|
|
64
59
|
}
|
|
@@ -20,6 +20,9 @@ class IoBrokerBaseDevice {
|
|
|
20
20
|
this.settings = undefined;
|
|
21
21
|
this._room = undefined;
|
|
22
22
|
this.deviceCapabilities = [];
|
|
23
|
+
// If configured > 0, this indicates the minimum time between state writes in ms
|
|
24
|
+
this._debounceStateDelay = 0;
|
|
25
|
+
this._lastWrite = 0;
|
|
23
26
|
this.individualStateCallbacks = new Map();
|
|
24
27
|
this.addToCorrectRoom();
|
|
25
28
|
this.persistDeviceInfo();
|
|
@@ -34,22 +37,14 @@ class IoBrokerBaseDevice {
|
|
|
34
37
|
}
|
|
35
38
|
/**
|
|
36
39
|
* Getter info
|
|
37
|
-
* @
|
|
40
|
+
* @returns The device info
|
|
38
41
|
*/
|
|
39
42
|
get info() {
|
|
40
43
|
return this._info;
|
|
41
44
|
}
|
|
42
|
-
/**
|
|
43
|
-
* Setter info
|
|
44
|
-
* @param {IoBrokerDeviceInfo} value
|
|
45
|
-
*/
|
|
46
45
|
set info(value) {
|
|
47
46
|
this._info = value;
|
|
48
47
|
}
|
|
49
|
-
/**
|
|
50
|
-
* Getter ioConn
|
|
51
|
-
* @return {IOBrokerConnection}
|
|
52
|
-
*/
|
|
53
48
|
get ioConn() {
|
|
54
49
|
return ioBroker_1.ioBrokerMain.iOConnection;
|
|
55
50
|
}
|
|
@@ -71,8 +66,8 @@ class IoBrokerBaseDevice {
|
|
|
71
66
|
}
|
|
72
67
|
/**
|
|
73
68
|
* Allows to react on the state change of a given state with the passed cb
|
|
74
|
-
* @param
|
|
75
|
-
* @param
|
|
69
|
+
* @param stateName - Last part of the id e.g. "available" not "zigbee.0.00158d00053d3e4b.available"
|
|
70
|
+
* @param cb - Desired Callback Action, with passed ioBroker.StateValue
|
|
76
71
|
*/
|
|
77
72
|
addIndividualStateCallback(stateName, cb) {
|
|
78
73
|
let arr = this.individualStateCallbacks.get(stateName);
|
|
@@ -86,7 +81,8 @@ class IoBrokerBaseDevice {
|
|
|
86
81
|
}
|
|
87
82
|
/**
|
|
88
83
|
* Returns whether a connection to ioBroker is established or not
|
|
89
|
-
* @param showError If true, an error message will be written to the log if the connection is not established
|
|
84
|
+
* @param showError - If true, an error message will be written to the log if the connection is not established
|
|
85
|
+
* @returns Whether a connection exists
|
|
90
86
|
*/
|
|
91
87
|
checkIoConnection(showError = false) {
|
|
92
88
|
if (!this.ioConn && showError) {
|
|
@@ -142,23 +138,31 @@ class IoBrokerBaseDevice {
|
|
|
142
138
|
}
|
|
143
139
|
/**
|
|
144
140
|
* Sets the state of a given data point and returns true if that was successful.
|
|
145
|
-
* @param pointId Data point to write to
|
|
146
|
-
* @param state Data to write
|
|
147
|
-
* @param onSuccess Callback to run on successfully written data
|
|
148
|
-
* @param onError Callback to run if an error has occurred during writing the data
|
|
141
|
+
* @param pointId - Data point to write to
|
|
142
|
+
* @param state - Data to write
|
|
143
|
+
* @param onSuccess - Callback to run on successfully written data
|
|
144
|
+
* @param onError - Callback to run if an error has occurred during writing the data
|
|
149
145
|
*/
|
|
150
146
|
setState(pointId, state, onSuccess = undefined, onError = undefined) {
|
|
151
147
|
var _a;
|
|
152
148
|
if (!this.checkIoConnection(true)) {
|
|
153
149
|
return;
|
|
154
150
|
}
|
|
151
|
+
if (this._debounceStateDelay > 0 && services_1.Utils.nowMS() - this._lastWrite < this._debounceStateDelay) {
|
|
152
|
+
services_1.Utils.guardedTimeout(() => {
|
|
153
|
+
this.log(models_1.LogLevel.Trace, `Debounced write for ${pointId} to ${state}`);
|
|
154
|
+
this.setState(pointId, state, onSuccess, onError);
|
|
155
|
+
}, this._debounceStateDelay, this);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
this._lastWrite = services_1.Utils.nowMS();
|
|
155
159
|
(_a = this.ioConn) === null || _a === void 0 ? void 0 : _a.setState(pointId, state, (err) => {
|
|
156
160
|
if (err) {
|
|
157
161
|
if (onError) {
|
|
158
162
|
onError(err);
|
|
159
163
|
}
|
|
160
164
|
else {
|
|
161
|
-
|
|
165
|
+
this.log(models_1.LogLevel.Error, `Error occured while setting state "${pointId}" to "${state}": ${err}`);
|
|
162
166
|
}
|
|
163
167
|
return;
|
|
164
168
|
}
|
|
@@ -13,8 +13,8 @@ export declare class IoBrokerDeviceInfo extends DeviceInfo {
|
|
|
13
13
|
private static replaceInvalidIdChars;
|
|
14
14
|
/**
|
|
15
15
|
* Extracts the relevant infos from the passed deviceConfig and combines them in a new Info object
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
16
|
+
* @param pDevConf - The device Config based on the extracted devices.json from ioBroker
|
|
17
|
+
* @param isJsStateChildObject - Within JS Objects, creating devices is limited,
|
|
18
18
|
* so we name the first child state for the object creation (e.g. javascript.0.00-EnergyManager.CurrentProduction)
|
|
19
19
|
*/
|
|
20
20
|
constructor(pDevConf: deviceConfig, isJsStateChildObject?: boolean);
|