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
|
@@ -41,6 +41,9 @@ class ZigbeeLedRGBCCT extends zigbeeDimmer_1.ZigbeeDimmer {
|
|
|
41
41
|
setTimeBased(c) {
|
|
42
42
|
this.setLight(models_1.LedSetLightCommand.byTimeBased(this.settings, c));
|
|
43
43
|
}
|
|
44
|
+
setActuator(c) {
|
|
45
|
+
this.setLight(new models_1.LedSetLightCommand(c, c.on, '', c.timeout));
|
|
46
|
+
}
|
|
44
47
|
/**
|
|
45
48
|
* @inheritDoc
|
|
46
49
|
*/
|
|
@@ -56,15 +59,14 @@ class ZigbeeLedRGBCCT extends zigbeeDimmer_1.ZigbeeDimmer {
|
|
|
56
59
|
if (c.on && c.brightness === -1 && this.brightness < 10) {
|
|
57
60
|
c.brightness = 10;
|
|
58
61
|
}
|
|
59
|
-
|
|
62
|
+
super.setLight(c);
|
|
60
63
|
const formattedColor = services_1.Utils.formatHex(c.color);
|
|
61
|
-
if (formattedColor !== null && c.on) {
|
|
64
|
+
if (formattedColor !== null && c.on && (c.color !== this.color || c.isForceAction)) {
|
|
62
65
|
this.setState(this._stateIdColor, formattedColor);
|
|
63
66
|
}
|
|
64
|
-
if (c.colorTemp > -1 && c.on) {
|
|
67
|
+
if (c.colorTemp > -1 && c.on && (c.colorTemp !== this.colortemp || c.isForceAction)) {
|
|
65
68
|
this.setState(this._stateIdColorTemp, c.colorTemp);
|
|
66
69
|
}
|
|
67
|
-
super.setLight(c);
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
exports.ZigbeeLedRGBCCT = ZigbeeLedRGBCCT;
|
|
@@ -24,7 +24,7 @@ export declare class ZigbeeMotionSensor extends ZigbeeDevice implements iMotionS
|
|
|
24
24
|
set detectionsToday(pVal: number);
|
|
25
25
|
/**
|
|
26
26
|
* Adds a callback for when a motion state has changed.
|
|
27
|
-
* @param pCallback Function that accepts the new state as parameter
|
|
27
|
+
* @param pCallback - Function that accepts the new state as parameter
|
|
28
28
|
*/
|
|
29
29
|
addMovementCallback(pCallback: (newState: boolean) => void): void;
|
|
30
30
|
persistMotionSensor(): void;
|
|
@@ -64,7 +64,7 @@ class ZigbeeMotionSensor extends index_1.ZigbeeDevice {
|
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
66
|
* Adds a callback for when a motion state has changed.
|
|
67
|
-
* @param pCallback Function that accepts the new state as parameter
|
|
67
|
+
* @param pCallback - Function that accepts the new state as parameter
|
|
68
68
|
*/
|
|
69
69
|
addMovementCallback(pCallback) {
|
|
70
70
|
this._movementDetectedCallback.push(pCallback);
|
|
@@ -75,19 +75,19 @@ class ZigbeeShutter extends zigbeeDevice_1.ZigbeeDevice {
|
|
|
75
75
|
super.update(idSplit, state, initial, pOverride);
|
|
76
76
|
}
|
|
77
77
|
setLevel(c) {
|
|
78
|
-
this.log(models_1.LogLevel.Debug, c.logMessage);
|
|
79
78
|
let pPosition = c.level;
|
|
80
79
|
if (!this._firstCommandRecieved && !c.isInitial) {
|
|
81
80
|
this._firstCommandRecieved = true;
|
|
82
81
|
}
|
|
83
82
|
else if (this._firstCommandRecieved && c.isInitial) {
|
|
84
|
-
this.log(models_1.LogLevel.Debug, `Skipped initial Rollo
|
|
83
|
+
this.log(models_1.LogLevel.Debug, `Skipped initial Rollo to ${pPosition} as we recieved a command already`);
|
|
85
84
|
return;
|
|
86
85
|
}
|
|
87
86
|
if (this.currentLevel === pPosition && !c.isForceAction) {
|
|
88
|
-
this.log(models_1.LogLevel.Debug, `Skip Rollo command to Position ${pPosition} as this is the current one`, services_1.LogDebugType.SkipUnchangedRolloPosition);
|
|
87
|
+
this.log(models_1.LogLevel.Debug, `Skip Rollo command to Position ${pPosition} as this is the current one, commandLog: ${c.logMessage}`, services_1.LogDebugType.SkipUnchangedRolloPosition);
|
|
89
88
|
return;
|
|
90
89
|
}
|
|
90
|
+
this.log(models_1.LogLevel.Debug, c.logMessage);
|
|
91
91
|
if (this._window !== undefined) {
|
|
92
92
|
if (this._window.griffeInPosition(models_2.WindowPosition.offen) > 0 && pPosition < 100) {
|
|
93
93
|
if (!c.skipOpenWarning) {
|
|
@@ -13,7 +13,7 @@ export declare abstract class ZigbeeSwitch extends ZigbeeDevice implements iButt
|
|
|
13
13
|
abstract buttonTop: Button | undefined;
|
|
14
14
|
abstract buttonTopLeft: Button | undefined;
|
|
15
15
|
abstract buttonTopRight: Button | undefined;
|
|
16
|
-
constructor(pInfo: IoBrokerDeviceInfo, deviceType: DeviceType);
|
|
16
|
+
protected constructor(pInfo: IoBrokerDeviceInfo, deviceType: DeviceType);
|
|
17
17
|
persist(buttonName: string, pressType: ButtonPressType): void;
|
|
18
18
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean, pOverrride?: boolean): void;
|
|
19
19
|
abstract getButtonAssignment(): string;
|
|
@@ -28,6 +28,6 @@ export declare class ZigbeeAquaraVibra extends ZigbeeDevice implements iVibratio
|
|
|
28
28
|
set vibrationBlockedByMotion(pVal: boolean);
|
|
29
29
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
30
30
|
setSensitivity(pVal: number): void;
|
|
31
|
-
alarmCheck
|
|
31
|
+
private alarmCheck;
|
|
32
32
|
persistBatteryDevice(): void;
|
|
33
33
|
}
|
|
@@ -27,9 +27,8 @@ export declare class ZigbeeEuroHeater extends ZigbeeHeater implements iDisposabl
|
|
|
27
27
|
dispose(): void;
|
|
28
28
|
private setValve;
|
|
29
29
|
/**
|
|
30
|
-
* Sets the mode
|
|
31
|
-
* @param
|
|
32
|
-
* @private
|
|
30
|
+
* Sets the mode
|
|
31
|
+
* @param targetMode - (1 = manual valve, 2 = automatic temp based)
|
|
33
32
|
*/
|
|
34
33
|
private setMode;
|
|
35
34
|
}
|
|
@@ -169,9 +169,8 @@ class ZigbeeEuroHeater extends BaseDevices_1.ZigbeeHeater {
|
|
|
169
169
|
}, 10000, this);
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
172
|
-
* Sets the mode
|
|
173
|
-
* @param
|
|
174
|
-
* @private
|
|
172
|
+
* Sets the mode
|
|
173
|
+
* @param targetMode - (1 = manual valve, 2 = automatic temp based)
|
|
175
174
|
*/
|
|
176
175
|
setMode(targetMode) {
|
|
177
176
|
this.setState(this._setModeId, targetMode);
|
|
@@ -32,79 +32,79 @@ export declare class IOBrokerConnection implements iDisposable {
|
|
|
32
32
|
private _isExecutedInBrowser;
|
|
33
33
|
/**
|
|
34
34
|
* Getter isExecutedInBrowser
|
|
35
|
-
* @
|
|
35
|
+
* @returns
|
|
36
36
|
*/
|
|
37
37
|
get isExecutedInBrowser(): boolean;
|
|
38
38
|
private _enums?;
|
|
39
39
|
/**
|
|
40
40
|
* Getter enums
|
|
41
|
-
* @
|
|
41
|
+
* @returns
|
|
42
42
|
*/
|
|
43
43
|
get enums(): Record<string, ioBroker.EnumObject> | undefined;
|
|
44
44
|
/**
|
|
45
45
|
* Setter enums
|
|
46
|
-
* @param
|
|
46
|
+
* @param value
|
|
47
47
|
*/
|
|
48
48
|
set enums(value: Record<string, ioBroker.EnumObject> | undefined);
|
|
49
49
|
private _isAuthDone;
|
|
50
50
|
/**
|
|
51
51
|
* Getter isAuthDone
|
|
52
|
-
* @
|
|
52
|
+
* @returns
|
|
53
53
|
*/
|
|
54
54
|
get isAuthDone(): boolean;
|
|
55
55
|
private _namespace;
|
|
56
56
|
/**
|
|
57
57
|
* Getter namespace
|
|
58
|
-
* @
|
|
58
|
+
* @returns
|
|
59
59
|
*/
|
|
60
60
|
get namespace(): string;
|
|
61
61
|
/**
|
|
62
62
|
* Setter namespace
|
|
63
|
-
* @param
|
|
63
|
+
* @param value
|
|
64
64
|
*/
|
|
65
65
|
set namespace(value: string);
|
|
66
66
|
private _objects?;
|
|
67
67
|
/**
|
|
68
68
|
* Getter objects
|
|
69
|
-
* @
|
|
69
|
+
* @returns
|
|
70
70
|
*/
|
|
71
71
|
get objects(): Record<string, ioBroker.Object> | undefined;
|
|
72
72
|
/**
|
|
73
73
|
* Setter objects
|
|
74
|
-
* @param
|
|
74
|
+
* @param value
|
|
75
75
|
*/
|
|
76
76
|
set objects(value: Record<string, ioBroker.Object> | undefined);
|
|
77
77
|
private _type;
|
|
78
78
|
/**
|
|
79
79
|
* Getter type
|
|
80
|
-
* @
|
|
80
|
+
* @returns
|
|
81
81
|
*/
|
|
82
82
|
get type(): string;
|
|
83
83
|
/**
|
|
84
84
|
* Setter type
|
|
85
|
-
* @param
|
|
85
|
+
* @param value
|
|
86
86
|
*/
|
|
87
87
|
set type(value: string);
|
|
88
88
|
private _timeout;
|
|
89
89
|
/**
|
|
90
90
|
* Getter timeout
|
|
91
|
-
* @
|
|
91
|
+
* @returns
|
|
92
92
|
*/
|
|
93
93
|
get timeout(): number;
|
|
94
94
|
/**
|
|
95
95
|
* Setter timeout
|
|
96
|
-
* @param
|
|
96
|
+
* @param value
|
|
97
97
|
*/
|
|
98
98
|
set timeout(value: number);
|
|
99
99
|
private _user;
|
|
100
100
|
/**
|
|
101
101
|
* Getter user
|
|
102
|
-
* @
|
|
102
|
+
* @returns
|
|
103
103
|
*/
|
|
104
104
|
get user(): string;
|
|
105
105
|
/**
|
|
106
106
|
* Setter user
|
|
107
|
-
* @param
|
|
107
|
+
* @param value
|
|
108
108
|
*/
|
|
109
109
|
set user(value: string);
|
|
110
110
|
reconnect(pConnOptions: unknown): void;
|
|
@@ -113,7 +113,7 @@ export declare class IOBrokerConnection implements iDisposable {
|
|
|
113
113
|
readFile(filename: string, callback: ioBroker.ReadFileCallback, isRemote: boolean): void;
|
|
114
114
|
getMimeType(ext: string): string;
|
|
115
115
|
readFile64(filename: string, callback: unknown, isRemote: boolean): void;
|
|
116
|
-
writeFile(filename: string, data: unknown | string, mode: number, callback: ioBroker.ErrnoCallback, ...
|
|
116
|
+
writeFile(filename: string, data: unknown | string, mode: number, callback: ioBroker.ErrnoCallback, ..._args: unknown[]): void;
|
|
117
117
|
writeFile64(filename: string, data: string, callback: ioBroker.ErrnoCallback): void;
|
|
118
118
|
readDir(dirname: string, callback: ioBroker.ReadDirCallback): void;
|
|
119
119
|
mkdir(dirname: string, callback: ioBroker.ErrnoCallback): void;
|
|
@@ -123,16 +123,16 @@ export declare class IOBrokerConnection implements iDisposable {
|
|
|
123
123
|
sendTo(instance: string, command: string, payload: ioBroker.MessagePayload, callback: ioBroker.MessageCallback | ioBroker.MessageCallbackInfo): void;
|
|
124
124
|
getStates(idPattern: string | undefined, callback: ioBroker.GetStatesCallback): void;
|
|
125
125
|
getObjects(useCache: boolean, callback: ioBroker.GetObjectsCallback): void;
|
|
126
|
-
getChildren(id: string, useCache: boolean, callback: (err?: Error | null, children?: string[]) => void, ...
|
|
126
|
+
getChildren(id: string, useCache: boolean, callback: (err?: Error | null, children?: string[]) => void, ..._args: unknown[]): void;
|
|
127
127
|
getObject(id: string, useCache: boolean, callback: ioBroker.GetObjectCallback): void;
|
|
128
128
|
getSyncTime(): Date;
|
|
129
|
-
addObject(
|
|
129
|
+
addObject(_objId: unknown, _obj: unknown, _callback: unknown): void;
|
|
130
130
|
delObject(objId: string): void;
|
|
131
131
|
httpGet(url: string, callback: (res: IncomingMessage | Error) => void): void;
|
|
132
132
|
logError(errorText: string): void;
|
|
133
133
|
authenticate(user: string, password: string, salt: string): void;
|
|
134
|
-
getConfig(useCache: boolean, callback: (error: Error | null, conf?: Record<string,
|
|
135
|
-
sendCommand(instance: string, command: string, data: string | number | boolean | unknown[] | Record<string,
|
|
134
|
+
getConfig(useCache: boolean, callback: (error: Error | null, conf?: Record<string, unknown>) => void, ..._args: unknown[]): void;
|
|
135
|
+
sendCommand(instance: string, command: string, data: string | number | boolean | unknown[] | Record<string, unknown> | null, ack?: boolean): void;
|
|
136
136
|
readProjects(callback: (err?: NodeJS.ErrnoException | null, objects?: Array<{
|
|
137
137
|
name: string;
|
|
138
138
|
readOnly: undefined | boolean;
|
|
@@ -142,7 +142,7 @@ export declare class IOBrokerConnection implements iDisposable {
|
|
|
142
142
|
clearCache(): void;
|
|
143
143
|
getHistory(id: string, options: ioBroker.GetHistoryOptions & {
|
|
144
144
|
timeout?: number;
|
|
145
|
-
}, callback: ioBroker.GetHistoryCallback, ...
|
|
145
|
+
}, callback: ioBroker.GetHistoryCallback, ..._args: unknown[]): void;
|
|
146
146
|
private _checkConnection;
|
|
147
147
|
private _monitor;
|
|
148
148
|
private _onAuth;
|
|
@@ -26,6 +26,7 @@ var ConnectionState;
|
|
|
26
26
|
})(ConnectionState || (ConnectionState = {}));
|
|
27
27
|
class IOBrokerConnection {
|
|
28
28
|
constructor(connOptions = {}, connCallbacks = new models_1.ConnectionCallbacks(), objectsRequired = false) {
|
|
29
|
+
var _a;
|
|
29
30
|
this._authInfo = new ioBrokerAuthInfo_1.IoBrokerAuthInfo();
|
|
30
31
|
this._authRunning = false;
|
|
31
32
|
this._cmdQueue = new Array();
|
|
@@ -78,7 +79,7 @@ class IOBrokerConnection {
|
|
|
78
79
|
this._connCallbacks = connCallbacks;
|
|
79
80
|
let connLink = connOptions.connLink;
|
|
80
81
|
if (!connOptions.connLink && this._isExecutedInBrowser) {
|
|
81
|
-
connLink = window.localStorage.getItem('connLink');
|
|
82
|
+
connLink = (_a = window.localStorage.getItem('connLink')) !== null && _a !== void 0 ? _a : undefined;
|
|
82
83
|
}
|
|
83
84
|
// Connection data from "/_socket/info.js"
|
|
84
85
|
if (!connLink && typeof socketUrl !== 'undefined')
|
|
@@ -290,6 +291,7 @@ class IOBrokerConnection {
|
|
|
290
291
|
}
|
|
291
292
|
const err = reason;
|
|
292
293
|
iobrokerConnectionLogging_1.iobrokerConnectionLogging.writeLog(iobrokerConnectionLogging_1.iobrokerConnectionLogLevel.Error, `Recieved socket error: ${err.message}\nStack:${err.stack}`);
|
|
294
|
+
// @ts-ignore
|
|
293
295
|
const innerErr = reason.description;
|
|
294
296
|
if (innerErr) {
|
|
295
297
|
iobrokerConnectionLogging_1.iobrokerConnectionLogging.writeLog(iobrokerConnectionLogging_1.iobrokerConnectionLogLevel.Error, `Inner socket error: ${innerErr.message}\nStack:${innerErr.stack}`);
|
|
@@ -298,91 +300,91 @@ class IOBrokerConnection {
|
|
|
298
300
|
}
|
|
299
301
|
/**
|
|
300
302
|
* Getter isExecutedInBrowser
|
|
301
|
-
* @
|
|
303
|
+
* @returns
|
|
302
304
|
*/
|
|
303
305
|
get isExecutedInBrowser() {
|
|
304
306
|
return this._isExecutedInBrowser;
|
|
305
307
|
}
|
|
306
308
|
/**
|
|
307
309
|
* Getter enums
|
|
308
|
-
* @
|
|
310
|
+
* @returns
|
|
309
311
|
*/
|
|
310
312
|
get enums() {
|
|
311
313
|
return this._enums;
|
|
312
314
|
}
|
|
313
315
|
/**
|
|
314
316
|
* Setter enums
|
|
315
|
-
* @param
|
|
317
|
+
* @param value
|
|
316
318
|
*/
|
|
317
319
|
set enums(value) {
|
|
318
320
|
this._enums = value;
|
|
319
321
|
}
|
|
320
322
|
/**
|
|
321
323
|
* Getter isAuthDone
|
|
322
|
-
* @
|
|
324
|
+
* @returns
|
|
323
325
|
*/
|
|
324
326
|
get isAuthDone() {
|
|
325
327
|
return this._isAuthDone;
|
|
326
328
|
}
|
|
327
329
|
/**
|
|
328
330
|
* Getter namespace
|
|
329
|
-
* @
|
|
331
|
+
* @returns
|
|
330
332
|
*/
|
|
331
333
|
get namespace() {
|
|
332
334
|
return this._namespace;
|
|
333
335
|
}
|
|
334
336
|
/**
|
|
335
337
|
* Setter namespace
|
|
336
|
-
* @param
|
|
338
|
+
* @param value
|
|
337
339
|
*/
|
|
338
340
|
set namespace(value) {
|
|
339
341
|
this._namespace = value;
|
|
340
342
|
}
|
|
341
343
|
/**
|
|
342
344
|
* Getter objects
|
|
343
|
-
* @
|
|
345
|
+
* @returns
|
|
344
346
|
*/
|
|
345
347
|
get objects() {
|
|
346
348
|
return this._objects;
|
|
347
349
|
}
|
|
348
350
|
/**
|
|
349
351
|
* Setter objects
|
|
350
|
-
* @param
|
|
352
|
+
* @param value
|
|
351
353
|
*/
|
|
352
354
|
set objects(value) {
|
|
353
355
|
this._objects = value;
|
|
354
356
|
}
|
|
355
357
|
/**
|
|
356
358
|
* Getter type
|
|
357
|
-
* @
|
|
359
|
+
* @returns
|
|
358
360
|
*/
|
|
359
361
|
get type() {
|
|
360
362
|
return this._type;
|
|
361
363
|
}
|
|
362
364
|
/**
|
|
363
365
|
* Setter type
|
|
364
|
-
* @param
|
|
366
|
+
* @param value
|
|
365
367
|
*/
|
|
366
368
|
set type(value) {
|
|
367
369
|
this._type = value;
|
|
368
370
|
}
|
|
369
371
|
/**
|
|
370
372
|
* Getter timeout
|
|
371
|
-
* @
|
|
373
|
+
* @returns
|
|
372
374
|
*/
|
|
373
375
|
get timeout() {
|
|
374
376
|
return this._timeout;
|
|
375
377
|
}
|
|
376
378
|
/**
|
|
377
379
|
* Setter timeout
|
|
378
|
-
* @param
|
|
380
|
+
* @param value
|
|
379
381
|
*/
|
|
380
382
|
set timeout(value) {
|
|
381
383
|
this._timeout = value;
|
|
382
384
|
}
|
|
383
385
|
/**
|
|
384
386
|
* Getter user
|
|
385
|
-
* @
|
|
387
|
+
* @returns
|
|
386
388
|
*/
|
|
387
389
|
get user() {
|
|
388
390
|
return this._user;
|
|
@@ -390,7 +392,7 @@ class IOBrokerConnection {
|
|
|
390
392
|
//#endregion
|
|
391
393
|
/**
|
|
392
394
|
* Setter user
|
|
393
|
-
* @param
|
|
395
|
+
* @param value
|
|
394
396
|
*/
|
|
395
397
|
set user(value) {
|
|
396
398
|
this._user = value;
|
|
@@ -478,7 +480,7 @@ class IOBrokerConnection {
|
|
|
478
480
|
const regMatch = ext.toLowerCase().match(/\.[^.]+$/);
|
|
479
481
|
ext = regMatch !== null && regMatch.length > 0 ? regMatch[0] : '';
|
|
480
482
|
}
|
|
481
|
-
let _mimeType
|
|
483
|
+
let _mimeType;
|
|
482
484
|
if (ext === '.css') {
|
|
483
485
|
_mimeType = 'text/css';
|
|
484
486
|
}
|
|
@@ -588,7 +590,7 @@ class IOBrokerConnection {
|
|
|
588
590
|
// @ts-ignore
|
|
589
591
|
writeFile(filename, data, mode, callback,
|
|
590
592
|
// @ts-ignore
|
|
591
|
-
...
|
|
593
|
+
..._args) {
|
|
592
594
|
if (this._type === 'local') {
|
|
593
595
|
// @ts-ignore
|
|
594
596
|
storage.set(filename, JSON.stringify(data));
|
|
@@ -764,6 +766,7 @@ class IOBrokerConnection {
|
|
|
764
766
|
}
|
|
765
767
|
for (const row of res.rows) {
|
|
766
768
|
if (row.value !== null) {
|
|
769
|
+
// @ts-ignore
|
|
767
770
|
data[row.id] = row.value;
|
|
768
771
|
}
|
|
769
772
|
}
|
|
@@ -781,6 +784,7 @@ class IOBrokerConnection {
|
|
|
781
784
|
}
|
|
782
785
|
for (const row of res.rows) {
|
|
783
786
|
if (row.value !== null) {
|
|
787
|
+
// @ts-ignore
|
|
784
788
|
data[row.id] = row.value;
|
|
785
789
|
}
|
|
786
790
|
}
|
|
@@ -792,6 +796,7 @@ class IOBrokerConnection {
|
|
|
792
796
|
}
|
|
793
797
|
for (const row of res.rows) {
|
|
794
798
|
if (row.value !== null) {
|
|
799
|
+
// @ts-ignore
|
|
795
800
|
data[row.id] = row.value;
|
|
796
801
|
}
|
|
797
802
|
}
|
|
@@ -819,7 +824,7 @@ class IOBrokerConnection {
|
|
|
819
824
|
// @ts-ignore
|
|
820
825
|
getChildren(id, useCache, callback,
|
|
821
826
|
// @ts-ignore
|
|
822
|
-
...
|
|
827
|
+
..._args) {
|
|
823
828
|
if (this._checkConnection('getChildren', arguments) != ConnectionState.connected)
|
|
824
829
|
return;
|
|
825
830
|
if (!id)
|
|
@@ -849,6 +854,7 @@ class IOBrokerConnection {
|
|
|
849
854
|
}
|
|
850
855
|
for (const row of res.rows) {
|
|
851
856
|
if (row.value !== null) {
|
|
857
|
+
// @ts-ignore
|
|
852
858
|
data[row.id] = row.value;
|
|
853
859
|
}
|
|
854
860
|
}
|
|
@@ -859,6 +865,7 @@ class IOBrokerConnection {
|
|
|
859
865
|
}
|
|
860
866
|
for (const row of res.rows) {
|
|
861
867
|
if (row.value !== null) {
|
|
868
|
+
// @ts-ignore
|
|
862
869
|
data[row.id] = row.value;
|
|
863
870
|
}
|
|
864
871
|
}
|
|
@@ -870,6 +877,7 @@ class IOBrokerConnection {
|
|
|
870
877
|
}
|
|
871
878
|
for (const row of res.rows) {
|
|
872
879
|
if (row.value !== null) {
|
|
880
|
+
// @ts-ignore
|
|
873
881
|
data[row.id] = row.value;
|
|
874
882
|
}
|
|
875
883
|
}
|
|
@@ -960,7 +968,7 @@ class IOBrokerConnection {
|
|
|
960
968
|
return new Date(0);
|
|
961
969
|
}
|
|
962
970
|
// @ts-ignore
|
|
963
|
-
addObject(
|
|
971
|
+
addObject(_objId, _obj, _callback) {
|
|
964
972
|
if (!this._isConnected) {
|
|
965
973
|
iobrokerConnectionLogging_1.iobrokerConnectionLogging.writeLog(iobrokerConnectionLogging_1.iobrokerConnectionLogLevel.Debug, 'No connection!');
|
|
966
974
|
return;
|
|
@@ -1024,7 +1032,7 @@ class IOBrokerConnection {
|
|
|
1024
1032
|
// FIXME finish implementation of this file
|
|
1025
1033
|
getConfig(useCache, callback,
|
|
1026
1034
|
// @ts-ignore
|
|
1027
|
-
...
|
|
1035
|
+
..._args) {
|
|
1028
1036
|
if (this._checkConnection('getConfig', arguments) != ConnectionState.connected)
|
|
1029
1037
|
return;
|
|
1030
1038
|
if (typeof useCache === 'function') {
|
|
@@ -1112,7 +1120,7 @@ class IOBrokerConnection {
|
|
|
1112
1120
|
}
|
|
1113
1121
|
getHistory(id, options, callback,
|
|
1114
1122
|
// @ts-ignore
|
|
1115
|
-
...
|
|
1123
|
+
..._args) {
|
|
1116
1124
|
if (this._checkConnection('getHistory', arguments) != ConnectionState.connected)
|
|
1117
1125
|
return;
|
|
1118
1126
|
if (!options)
|
|
@@ -54,8 +54,7 @@ class PollyService {
|
|
|
54
54
|
const fPath = path_1.default.join(this._mp3Path, filename);
|
|
55
55
|
try {
|
|
56
56
|
if (fs.existsSync(fPath)) {
|
|
57
|
-
|
|
58
|
-
return duration;
|
|
57
|
+
return (0, get_mp3_duration_1.default)(fs.readFileSync(fPath));
|
|
59
58
|
}
|
|
60
59
|
}
|
|
61
60
|
catch (err) {
|
|
@@ -4,79 +4,94 @@ export declare class Res {
|
|
|
4
4
|
private static selectedLanguage;
|
|
5
5
|
static initialize(config: iTranslationSettings): void;
|
|
6
6
|
/**
|
|
7
|
-
* Retrieves a string like `Alarm system arming."`
|
|
7
|
+
* @returns Retrieves a string like `Alarm system arming."`
|
|
8
8
|
*/
|
|
9
9
|
static alarmArmed(): string;
|
|
10
10
|
/**
|
|
11
|
-
* Retrieves a string like `Alarm system will be armed in night mode. Sweet Dreams!"`
|
|
11
|
+
* @returns Retrieves a string like `Alarm system will be armed in night mode. Sweet Dreams!"`
|
|
12
12
|
*/
|
|
13
13
|
static alarmNightModeArmed(): string;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* @param deviceCustomName - The custom name of the device
|
|
16
|
+
* @param minutes - The minutes the device was closed after
|
|
17
|
+
* @returns Retrieves a string like `"@P0" closed after @P1 minutes`
|
|
16
18
|
*/
|
|
17
19
|
static closedAfterMinutes(deviceCustomName: string, minutes: string): string;
|
|
18
20
|
/**
|
|
19
|
-
*
|
|
21
|
+
* @param roomName - The name of the room
|
|
22
|
+
* @returns Retrieves a string like `No more smoke: Danger in "@P0" resolved.`
|
|
20
23
|
*/
|
|
21
24
|
static fireAlarmEnd(roomName: string): string;
|
|
22
25
|
/**
|
|
23
|
-
*
|
|
26
|
+
* @param roomName - The name of the room
|
|
27
|
+
* @param deviceCustomName - The custom name of the device
|
|
28
|
+
* @returns Retrieves a string like `Smoke detector "@P0" active. Possible fire in "@P1".`
|
|
24
29
|
*/
|
|
25
30
|
static fireAlarmRepeat(roomName: string, deviceCustomName: string): string;
|
|
26
31
|
/**
|
|
27
|
-
*
|
|
32
|
+
* @param roomName - The name of the room
|
|
33
|
+
* @param deviceCustomName - The custom name of the device
|
|
34
|
+
* @returns Retrieves a string like `Smoke detector "@P0" triggered. Possible fire in "@P1".`
|
|
28
35
|
*/
|
|
29
36
|
static fireAlarmStart(roomName: string, deviceCustomName: string): string;
|
|
30
37
|
/**
|
|
31
|
-
* Retrieves a string like `Good Morning`
|
|
38
|
+
* @returns Retrieves a string like `Good Morning`
|
|
32
39
|
*/
|
|
33
40
|
static goodMorning(): string;
|
|
34
41
|
/**
|
|
35
|
-
* Retrieves a string like "Alarm. Intruder detected"
|
|
42
|
+
* @returns Retrieves a string like "Alarm. Intruder detected"
|
|
36
43
|
*/
|
|
37
44
|
static intruderAlarm(): string;
|
|
38
45
|
/**
|
|
39
|
-
* Retrieves a string like "Additional defense protocol initiated."
|
|
46
|
+
* @returns Retrieves a string like "Additional defense protocol initiated."
|
|
40
47
|
*/
|
|
41
48
|
static intruderAdditionalDefenseWarning(): string;
|
|
42
49
|
/**
|
|
43
|
-
* Retrieves a string like "Hello potential intruder! You're beeing recorded and the alarm protocol is initiated please leave the building immediately!"
|
|
50
|
+
* @returns Retrieves a string like "Hello potential intruder! You're beeing recorded and the alarm protocol is initiated please leave the building immediately!"
|
|
44
51
|
*/
|
|
45
52
|
static intruderGreeting(): string;
|
|
46
53
|
/**
|
|
47
|
-
* Retrieves a string like "Leave now! The owners and additional emergency contacts are informed!"
|
|
54
|
+
* @returns Retrieves a string like "Leave now! The owners and additional emergency contacts are informed!"
|
|
48
55
|
*/
|
|
49
56
|
static intruderLeaveAndOwnerInformed(): string;
|
|
50
57
|
/**
|
|
51
|
-
* Retrieves a string like "All shutter are opening, please leave immediatly."
|
|
58
|
+
* @returns Retrieves a string like "All shutter are opening, please leave immediatly."
|
|
52
59
|
*/
|
|
53
60
|
static intruderShutterUpPleaseLeave(): string;
|
|
54
61
|
/**
|
|
55
|
-
*
|
|
62
|
+
* @param deviceCustomName - The custom name of the device
|
|
63
|
+
* @returns Retrieves a string like `"@P0" just closed`
|
|
56
64
|
*/
|
|
57
65
|
static justClosed(deviceCustomName: string): string;
|
|
58
66
|
/**
|
|
59
|
-
*
|
|
67
|
+
* @param deviceCustomName - The custom name of the device
|
|
68
|
+
* @returns Retrieves a string like `Vibration Alert from "@P0". I repeat: Alarm at "@P0"`
|
|
60
69
|
*/
|
|
61
70
|
static vibrationAlarm(deviceCustomName: string): string;
|
|
62
71
|
/**
|
|
63
|
-
*
|
|
72
|
+
* @param roomName - The name of the room
|
|
73
|
+
* @returns Retrieves a string like `Water alarm end: Flooding in "@P0" over.`
|
|
64
74
|
*/
|
|
65
75
|
static waterAlarmEnd(roomName: string): string;
|
|
66
76
|
/**
|
|
67
|
-
*
|
|
77
|
+
* @param deviceCustomName - The custom name of the device
|
|
78
|
+
* @param roomName - The name of the room
|
|
79
|
+
* @returns Retrieves a string like `"@P0" has triggered. Pool party in "@P1".`
|
|
68
80
|
*/
|
|
69
81
|
static waterAlarmRepeat(deviceCustomName: string, roomName: string): string;
|
|
70
82
|
/**
|
|
71
|
-
*
|
|
83
|
+
* @param deviceCustomName - The custom name of the device
|
|
84
|
+
* @param roomName - The name of the room
|
|
85
|
+
* @returns Retrieves a string like `"@P0" detects water. Possible pipe burst in "@P1".`
|
|
72
86
|
*/
|
|
73
87
|
static waterAlarmStart(deviceCustomName: string, roomName: string): string;
|
|
74
88
|
/**
|
|
75
|
-
* Retrieves a string like "Vibration Alert from "@P0". I repeat: Alarm at "@P0""
|
|
89
|
+
* @returns Retrieves a string like "Vibration Alert from "@P0". I repeat: Alarm at "@P0""
|
|
76
90
|
*/
|
|
77
91
|
static welcomeHome(): string;
|
|
78
92
|
/**
|
|
79
|
-
*
|
|
93
|
+
* @param deviceCustomName - The custom name of the device
|
|
94
|
+
* @returns Retrieves a string like `"@P0" was opened`
|
|
80
95
|
*/
|
|
81
96
|
static wasOpened(deviceCustomName: string): string;
|
|
82
97
|
private static fill;
|