hoffmation-base 3.0.0-alpha.27 → 3.0.0-alpha.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/models/command/baseCommand.js +3 -0
- package/lib/models/timeCallback.js +3 -3
- package/lib/server/config/heatingMode.d.ts +2 -1
- package/lib/server/config/heatingMode.js +2 -1
- package/lib/server/devices/espresense/detectedBluetoothDevice.js +1 -1
- package/lib/server/devices/groups/windowGroup.js +4 -4
- package/lib/server/devices/sharedFunctions/lampUtils.js +3 -3
- package/lib/server/devices/zigbee/BaseDevices/ZigbeeActuator.d.ts +3 -3
- package/lib/server/devices/zigbee/BaseDevices/ZigbeeActuator.js +3 -4
- package/lib/server/devices/zigbee/BaseDevices/index.d.ts +1 -0
- package/lib/server/devices/zigbee/BaseDevices/index.js +3 -0
- package/lib/server/devices/zigbee/BaseDevices/zigbeeDimmer.d.ts +3 -30
- package/lib/server/devices/zigbee/BaseDevices/zigbeeDimmer.js +2 -56
- package/lib/server/devices/zigbee/BaseDevices/zigbeeLamp.d.ts +20 -0
- package/lib/server/devices/zigbee/BaseDevices/zigbeeLamp.js +47 -0
- package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.js +2 -2
- package/lib/server/devices/zigbee/zigbeeBlitzShp.d.ts +1 -0
- package/lib/server/devices/zigbee/zigbeeBlitzShp.js +2 -1
- package/lib/server/devices/zigbee/zigbeeIkeaSteckdose.d.ts +1 -0
- package/lib/server/devices/zigbee/zigbeeIkeaSteckdose.js +2 -1
- package/lib/server/devices/zigbee/zigbeeIlluActuator.d.ts +1 -2
- package/lib/server/devices/zigbee/zigbeeIlluActuator.js +2 -9
- package/lib/server/devices/zigbee/zigbeeIlluLampe.d.ts +4 -15
- package/lib/server/devices/zigbee/zigbeeIlluLampe.js +4 -37
- package/lib/server/devices/zigbee/zigbeeUbisysActuator.d.ts +2 -1
- package/lib/server/devices/zigbee/zigbeeUbisysActuator.js +3 -5
- package/lib/server/devices/zigbee/zigbeeUbisysLampe.d.ts +7 -12
- package/lib/server/devices/zigbee/zigbeeUbisysLampe.js +13 -27
- package/lib/server/services/ShutterService.js +3 -3
- package/lib/server/services/ac/ac-device.d.ts +10 -0
- package/lib/server/services/ac/ac-device.js +27 -9
- package/lib/server/services/api/api-service.js +1 -3
- package/lib/server/services/blockAutomaticHandler.js +3 -1
- package/lib/server/services/calendar/m/303/274ll-service.js +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -14,6 +14,9 @@ class BaseCommand {
|
|
|
14
14
|
this.timestamp = new Date();
|
|
15
15
|
}
|
|
16
16
|
get isAutomaticAction() {
|
|
17
|
+
if (this.overrideCommandSource !== undefined) {
|
|
18
|
+
return this.overrideCommandSource === commandSource_1.CommandSource.Automatic;
|
|
19
|
+
}
|
|
17
20
|
if (this.source instanceof BaseCommand) {
|
|
18
21
|
return this.source.isAutomaticAction;
|
|
19
22
|
}
|
|
@@ -96,8 +96,8 @@ class TimeCallback {
|
|
|
96
96
|
}
|
|
97
97
|
break;
|
|
98
98
|
}
|
|
99
|
-
if (nextCalculatedTime < now && this.nextToDo && this.nextToDo >
|
|
100
|
-
server_1.ServerLogService.writeLog(logLevel_1.LogLevel.Info,
|
|
99
|
+
if (nextCalculatedTime < now && this.nextToDo && this.nextToDo > this.lastDone) {
|
|
100
|
+
server_1.ServerLogService.writeLog(logLevel_1.LogLevel.Info, `Time Callback recalc results in the past, while previous target wasn't yet done --> fire immediately.`);
|
|
101
101
|
this.perform(now);
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
@@ -110,11 +110,11 @@ class TimeCallback {
|
|
|
110
110
|
}
|
|
111
111
|
perform(now = new Date()) {
|
|
112
112
|
server_1.ServerLogService.writeLog(logLevel_1.LogLevel.Debug, `Timecallback '${this.name}' fired`);
|
|
113
|
-
this.cFunction();
|
|
114
113
|
this.lastDone = now;
|
|
115
114
|
this.nextToDo = undefined;
|
|
116
115
|
this._calculationSunrise = undefined;
|
|
117
116
|
this._calculationSunset = undefined;
|
|
117
|
+
this.cFunction();
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
exports.TimeCallback = TimeCallback;
|
|
@@ -5,5 +5,6 @@ var HeatingMode;
|
|
|
5
5
|
(function (HeatingMode) {
|
|
6
6
|
HeatingMode[HeatingMode["None"] = 0] = "None";
|
|
7
7
|
HeatingMode[HeatingMode["Winter"] = 1] = "Winter";
|
|
8
|
-
HeatingMode[HeatingMode["
|
|
8
|
+
HeatingMode[HeatingMode["Summer"] = 2] = "Summer";
|
|
9
|
+
HeatingMode[HeatingMode["TransitionalSeason"] = 3] = "TransitionalSeason";
|
|
9
10
|
})(HeatingMode || (exports.HeatingMode = HeatingMode = {}));
|
|
@@ -90,7 +90,7 @@ class DetectedBluetoothDevice {
|
|
|
90
90
|
const dataPoints = this.getDistances(maxAge);
|
|
91
91
|
const result = [`Distances for ${this.info.customName}`];
|
|
92
92
|
for (const data of dataPoints) {
|
|
93
|
-
result.push(`${data.trackerName}: ${services_1.Utils.round((_a = data.distance) !== null && _a !== void 0 ? _a : -99, 2)}m updated ${new Date(data.lastUpdate).toLocaleTimeString()}`);
|
|
93
|
+
result.push(`${data.trackerName}: ${services_1.Utils.round((_a = data.distance) !== null && _a !== void 0 ? _a : -99, 2)}m updated ${new Date(data.lastUpdate).toLocaleTimeString('de-DE')}`);
|
|
94
94
|
services_1.Utils.nowTime();
|
|
95
95
|
}
|
|
96
96
|
return result.join('\n');
|
|
@@ -79,11 +79,11 @@ class WindowGroup extends base_group_1.BaseGroup {
|
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
sunriseUp(c) {
|
|
82
|
-
this.windows.forEach((
|
|
83
|
-
if (!this.getRoom().settings.sonnenAufgangRollos ||
|
|
82
|
+
this.windows.forEach((w) => {
|
|
83
|
+
if (!this.getRoom().settings.sonnenAufgangRollos || w.getShutter().length === 0) {
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
|
-
|
|
86
|
+
w.setDesiredPosition(new models_1.WindowSetDesiredPositionCommand(c, 100));
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
restoreShutterPosition(c) {
|
|
@@ -164,7 +164,7 @@ class WindowGroup extends base_group_1.BaseGroup {
|
|
|
164
164
|
}
|
|
165
165
|
if (this.sunriseShutterCallback === undefined) {
|
|
166
166
|
this.log(models_1.LogLevel.Debug, `Add Sunrise shutter TimeCallback for ${this.roomName}`);
|
|
167
|
-
this.sunriseShutterCallback = new models_1.TimeCallback(`${this.roomName}
|
|
167
|
+
this.sunriseShutterCallback = new models_1.TimeCallback(`${this.roomName} Sunrise Shutter`, models_1.TimeCallbackType.Sunrise, () => {
|
|
168
168
|
if (room.skipNextRolloUp) {
|
|
169
169
|
this.log(models_1.LogLevel.Info, `${this.roomName} skipped sunrise up due to room.skipNextRolloUp`);
|
|
170
170
|
room.skipNextRolloUp = false;
|
|
@@ -10,12 +10,12 @@ class LampUtils {
|
|
|
10
10
|
var _a, _b;
|
|
11
11
|
LampUtils.stromStossContinueTimeouts.delete(actuator.id);
|
|
12
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'));
|
|
13
|
+
actuator.setActuator(new models_1.ActuatorSetStateCommand(models_1.CommandSource.Automatic, true, 'StromStoss On due to Presence', null));
|
|
14
14
|
}
|
|
15
15
|
}, actuator.settings.stromStossResendTime * 1000, this));
|
|
16
16
|
}
|
|
17
17
|
services_1.Utils.guardedTimeout(() => {
|
|
18
|
-
actuator.setActuator(new models_1.ActuatorSetStateCommand(models_1.CommandSource.Force, false, 'StromStoss Off'));
|
|
18
|
+
actuator.setActuator(new models_1.ActuatorSetStateCommand(models_1.CommandSource.Force, false, 'StromStoss Off', null));
|
|
19
19
|
}, 3000, this);
|
|
20
20
|
}
|
|
21
21
|
static setTimeBased(device, c) {
|
|
@@ -55,7 +55,7 @@ class LampUtils {
|
|
|
55
55
|
}
|
|
56
56
|
static checkBlockActive(device, c) {
|
|
57
57
|
if (!c.isForceAction && device.blockAutomationHandler.automaticBlockActive) {
|
|
58
|
-
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}`);
|
|
58
|
+
device.log(models_1.LogLevel.Debug, `Skip command to ${c.on} as it is locked until ${new Date(device.blockAutomationHandler.automaticBlockedUntil).toLocaleTimeString('de-DE')}; command Log: ${c.logMessage}`);
|
|
59
59
|
device.targetAutomaticState = c.on;
|
|
60
60
|
return true;
|
|
61
61
|
}
|
|
@@ -4,7 +4,7 @@ import { IoBrokerDeviceInfo } from '../../IoBrokerDeviceInfo';
|
|
|
4
4
|
import { iActuator } from '../../baseDeviceInterfaces';
|
|
5
5
|
import { ZigbeeDevice } from './zigbeeDevice';
|
|
6
6
|
import { BlockAutomaticHandler } from '../../../services/blockAutomaticHandler';
|
|
7
|
-
export declare class ZigbeeActuator extends ZigbeeDevice implements iActuator {
|
|
7
|
+
export declare abstract class ZigbeeActuator extends ZigbeeDevice implements iActuator {
|
|
8
8
|
private _actuatorOn;
|
|
9
9
|
/** @inheritDoc */
|
|
10
10
|
readonly blockAutomationHandler: BlockAutomaticHandler;
|
|
@@ -12,12 +12,12 @@ export declare class ZigbeeActuator extends ZigbeeDevice implements iActuator {
|
|
|
12
12
|
targetAutomaticState: boolean;
|
|
13
13
|
/** @inheritDoc */
|
|
14
14
|
settings: ActuatorSettings;
|
|
15
|
-
protected readonly
|
|
15
|
+
protected abstract readonly _stateIdState: string;
|
|
16
16
|
/** @inheritDoc */
|
|
17
17
|
queuedValue: boolean | null;
|
|
18
18
|
/** @inheritDoc */
|
|
19
19
|
get actuatorOn(): boolean;
|
|
20
|
-
constructor(pInfo: IoBrokerDeviceInfo, type: DeviceType
|
|
20
|
+
constructor(pInfo: IoBrokerDeviceInfo, type: DeviceType);
|
|
21
21
|
/** @inheritDoc */
|
|
22
22
|
restoreTargetAutomaticValue(c: RestoreTargetAutomaticValueCommand): void;
|
|
23
23
|
/** @inheritDoc */
|
|
@@ -12,7 +12,7 @@ class ZigbeeActuator extends zigbeeDevice_1.ZigbeeDevice {
|
|
|
12
12
|
get actuatorOn() {
|
|
13
13
|
return this._actuatorOn;
|
|
14
14
|
}
|
|
15
|
-
constructor(pInfo, type
|
|
15
|
+
constructor(pInfo, type) {
|
|
16
16
|
super(pInfo, type);
|
|
17
17
|
this._actuatorOn = false;
|
|
18
18
|
/** @inheritDoc */
|
|
@@ -23,7 +23,6 @@ class ZigbeeActuator extends zigbeeDevice_1.ZigbeeDevice {
|
|
|
23
23
|
this.queuedValue = null;
|
|
24
24
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.actuator);
|
|
25
25
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.blockAutomatic);
|
|
26
|
-
this.actuatorOnSwitchID = actuatorOnSwitchID;
|
|
27
26
|
this.blockAutomationHandler = new blockAutomaticHandler_1.BlockAutomaticHandler(this.restoreTargetAutomaticValue.bind(this));
|
|
28
27
|
}
|
|
29
28
|
/** @inheritDoc */
|
|
@@ -49,7 +48,7 @@ class ZigbeeActuator extends zigbeeDevice_1.ZigbeeDevice {
|
|
|
49
48
|
}
|
|
50
49
|
/** @inheritDoc */
|
|
51
50
|
setActuator(command) {
|
|
52
|
-
if (this.
|
|
51
|
+
if (this._stateIdState === '') {
|
|
53
52
|
this.log(models_1.LogLevel.Error, 'Keine Switch ID bekannt.');
|
|
54
53
|
return;
|
|
55
54
|
}
|
|
@@ -70,7 +69,7 @@ class ZigbeeActuator extends zigbeeDevice_1.ZigbeeDevice {
|
|
|
70
69
|
/** @inheritDoc */
|
|
71
70
|
writeActuatorStateToDevice(c) {
|
|
72
71
|
this.log(models_1.LogLevel.Debug, c.logMessage, services_1.LogDebugType.SetActuator);
|
|
73
|
-
this.setState(this.
|
|
72
|
+
this.setState(this._stateIdState, c.stateValue, undefined, (err) => {
|
|
74
73
|
this.log(models_1.LogLevel.Error, `Lampe schalten ergab Fehler: ${err}`);
|
|
75
74
|
});
|
|
76
75
|
}
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ZigbeeLamp = void 0;
|
|
17
18
|
__exportStar(require("./ZigbeeActuator"), exports);
|
|
18
19
|
__exportStar(require("./zigbeeDevice"), exports);
|
|
19
20
|
__exportStar(require("./zigbeeDimmer"), exports);
|
|
@@ -23,3 +24,5 @@ __exportStar(require("./zigbeeMagnetContact"), exports);
|
|
|
23
24
|
__exportStar(require("./zigbeeMotionSensor"), exports);
|
|
24
25
|
__exportStar(require("./zigbeeShutter"), exports);
|
|
25
26
|
__exportStar(require("./zigbeeSwitch"), exports);
|
|
27
|
+
var zigbeeLamp_1 = require("./zigbeeLamp");
|
|
28
|
+
Object.defineProperty(exports, "ZigbeeLamp", { enumerable: true, get: function () { return zigbeeLamp_1.ZigbeeLamp; } });
|
|
@@ -1,53 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DimmerSetLightCommand, DimmerSettings, LampSetTimeBasedCommand } from '../../../../models';
|
|
2
2
|
import { DeviceType } from '../../deviceType';
|
|
3
|
-
import { ZigbeeDevice } from './index';
|
|
4
3
|
import { IoBrokerDeviceInfo } from '../../IoBrokerDeviceInfo';
|
|
5
4
|
import { iDimmableLamp } from '../../baseDeviceInterfaces/iDimmableLamp';
|
|
6
5
|
import { iTemporaryDisableAutomatic } from '../../baseDeviceInterfaces';
|
|
7
|
-
import {
|
|
8
|
-
export declare abstract class ZigbeeDimmer extends
|
|
9
|
-
/** @inheritDoc */
|
|
10
|
-
readonly blockAutomationHandler: BlockAutomaticHandler;
|
|
11
|
-
/** @inheritDoc */
|
|
12
|
-
queuedValue: boolean | null;
|
|
6
|
+
import { ZigbeeLamp } from './zigbeeLamp';
|
|
7
|
+
export declare abstract class ZigbeeDimmer extends ZigbeeLamp implements iDimmableLamp, iTemporaryDisableAutomatic {
|
|
13
8
|
/** @inheritDoc */
|
|
14
9
|
settings: DimmerSettings;
|
|
15
|
-
/** @inheritDoc */
|
|
16
|
-
targetAutomaticState: boolean;
|
|
17
|
-
protected _lastPersist: number;
|
|
18
10
|
protected abstract readonly _stateIdBrightness: string;
|
|
19
|
-
protected abstract readonly _stateIdState: string;
|
|
20
11
|
protected abstract readonly _stateIdTransitionTime: string;
|
|
21
12
|
protected abstract readonly _stateNameBrightness: string;
|
|
22
|
-
protected abstract readonly _stateNameState: string;
|
|
23
13
|
protected abstract readonly _stateNameTransitionTime: string;
|
|
24
14
|
protected constructor(pInfo: IoBrokerDeviceInfo, deviceType: DeviceType);
|
|
25
15
|
protected _brightness: number;
|
|
26
16
|
/** @inheritDoc */
|
|
27
17
|
get brightness(): number;
|
|
28
|
-
protected _lightOn: boolean;
|
|
29
|
-
/** @inheritDoc */
|
|
30
|
-
get lightOn(): boolean;
|
|
31
18
|
protected _transitionTime: number;
|
|
32
19
|
/** @inheritDoc */
|
|
33
|
-
get actuatorOn(): boolean;
|
|
34
|
-
/** @inheritDoc */
|
|
35
|
-
restoreTargetAutomaticValue(c: RestoreTargetAutomaticValueCommand): void;
|
|
36
|
-
/** @inheritDoc */
|
|
37
20
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
38
21
|
/** @inheritDoc */
|
|
39
22
|
setTimeBased(c: LampSetTimeBasedCommand): void;
|
|
40
23
|
/** @inheritDoc */
|
|
41
|
-
setActuator(c: ActuatorSetStateCommand): void;
|
|
42
|
-
/** @inheritDoc */
|
|
43
|
-
toggleActuator(c: ActuatorToggleCommand): boolean;
|
|
44
|
-
/** @inheritDoc */
|
|
45
24
|
setLight(c: DimmerSetLightCommand): void;
|
|
46
|
-
/** @inheritDoc */
|
|
47
|
-
persist(): void;
|
|
48
|
-
/** @inheritDoc */
|
|
49
|
-
toggleLight(c: LampToggleLightCommand): boolean;
|
|
50
|
-
/** @inheritDoc */
|
|
51
|
-
writeActuatorStateToDevice(c: ActuatorWriteStateToDeviceCommand): void;
|
|
52
25
|
private setBrightnessState;
|
|
53
26
|
}
|
|
@@ -3,55 +3,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ZigbeeDimmer = void 0;
|
|
4
4
|
const models_1 = require("../../../../models");
|
|
5
5
|
const services_1 = require("../../../services");
|
|
6
|
-
const index_1 = require("./index");
|
|
7
6
|
const DeviceCapability_1 = require("../../DeviceCapability");
|
|
8
|
-
const blockAutomaticHandler_1 = require("../../../services/blockAutomaticHandler");
|
|
9
7
|
const sharedFunctions_1 = require("../../sharedFunctions");
|
|
10
|
-
|
|
8
|
+
const zigbeeLamp_1 = require("./zigbeeLamp");
|
|
9
|
+
class ZigbeeDimmer extends zigbeeLamp_1.ZigbeeLamp {
|
|
11
10
|
constructor(pInfo, deviceType) {
|
|
12
11
|
super(pInfo, deviceType);
|
|
13
12
|
/** @inheritDoc */
|
|
14
|
-
this.queuedValue = null;
|
|
15
|
-
/** @inheritDoc */
|
|
16
13
|
this.settings = new models_1.DimmerSettings();
|
|
17
|
-
/** @inheritDoc */
|
|
18
|
-
this.targetAutomaticState = false;
|
|
19
|
-
this._lastPersist = 0;
|
|
20
14
|
this._brightness = 0;
|
|
21
|
-
this._lightOn = false;
|
|
22
15
|
this._transitionTime = 0;
|
|
23
16
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.lamp);
|
|
24
17
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.dimmablelamp);
|
|
25
18
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.blockAutomatic);
|
|
26
|
-
this.blockAutomationHandler = new blockAutomaticHandler_1.BlockAutomaticHandler(this.restoreTargetAutomaticValue.bind(this));
|
|
27
19
|
}
|
|
28
20
|
/** @inheritDoc */
|
|
29
21
|
get brightness() {
|
|
30
22
|
return this._brightness;
|
|
31
23
|
}
|
|
32
24
|
/** @inheritDoc */
|
|
33
|
-
get lightOn() {
|
|
34
|
-
return this._lightOn;
|
|
35
|
-
}
|
|
36
|
-
/** @inheritDoc */
|
|
37
|
-
get actuatorOn() {
|
|
38
|
-
return this.lightOn;
|
|
39
|
-
}
|
|
40
|
-
/** @inheritDoc */
|
|
41
|
-
restoreTargetAutomaticValue(c) {
|
|
42
|
-
this.setActuator(new models_1.ActuatorSetStateCommand(c, this.targetAutomaticState));
|
|
43
|
-
}
|
|
44
|
-
/** @inheritDoc */
|
|
45
25
|
update(idSplit, state, initial = false) {
|
|
46
26
|
this.queuedValue = null;
|
|
47
27
|
this.log(models_1.LogLevel.DeepTrace, `Dimmer Update: ID: ${idSplit.join('.')} JSON: ${JSON.stringify(state)}`);
|
|
48
28
|
super.update(idSplit, state, initial, true);
|
|
49
29
|
switch (idSplit[3]) {
|
|
50
|
-
case this._stateNameState:
|
|
51
|
-
this.log(models_1.LogLevel.Trace, `Dimmer Update für ${this.info.customName} auf ${state.val}`);
|
|
52
|
-
this._lightOn = state.val;
|
|
53
|
-
this.persist();
|
|
54
|
-
break;
|
|
55
30
|
case this._stateNameBrightness:
|
|
56
31
|
this.log(models_1.LogLevel.Trace, `Dimmer Helligkeit Update für ${this.info.customName} auf ${state.val}`);
|
|
57
32
|
this._brightness = state.val;
|
|
@@ -68,16 +43,6 @@ class ZigbeeDimmer extends index_1.ZigbeeDevice {
|
|
|
68
43
|
this.setLight(models_1.DimmerSetLightCommand.byTimeBased(this.settings, c));
|
|
69
44
|
}
|
|
70
45
|
/** @inheritDoc */
|
|
71
|
-
setActuator(c) {
|
|
72
|
-
this.setLight(new models_1.DimmerSetLightCommand(c, c.on, '', c.disableAutomaticCommand));
|
|
73
|
-
}
|
|
74
|
-
/** @inheritDoc */
|
|
75
|
-
toggleActuator(c) {
|
|
76
|
-
const setActuatorCommand = models_1.ActuatorSetStateCommand.byActuatorAndToggleCommand(this, c);
|
|
77
|
-
this.setActuator(setActuatorCommand);
|
|
78
|
-
return setActuatorCommand.on;
|
|
79
|
-
}
|
|
80
|
-
/** @inheritDoc */
|
|
81
46
|
setLight(c) {
|
|
82
47
|
var _a;
|
|
83
48
|
if (this._stateIdState === '') {
|
|
@@ -124,25 +89,6 @@ class ZigbeeDimmer extends index_1.ZigbeeDevice {
|
|
|
124
89
|
}, 1000, this);
|
|
125
90
|
});
|
|
126
91
|
}
|
|
127
|
-
/** @inheritDoc */
|
|
128
|
-
persist() {
|
|
129
|
-
var _a;
|
|
130
|
-
const now = services_1.Utils.nowMS();
|
|
131
|
-
if (this._lastPersist + 1000 > now) {
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
(_a = services_1.Utils.dbo) === null || _a === void 0 ? void 0 : _a.persistActuator(this);
|
|
135
|
-
this._lastPersist = now;
|
|
136
|
-
}
|
|
137
|
-
/** @inheritDoc */
|
|
138
|
-
toggleLight(c) {
|
|
139
|
-
return sharedFunctions_1.LampUtils.toggleLight(this, c);
|
|
140
|
-
}
|
|
141
|
-
/** @inheritDoc */
|
|
142
|
-
writeActuatorStateToDevice(c) {
|
|
143
|
-
this.log(models_1.LogLevel.Debug, c.logMessage, services_1.LogDebugType.SetActuator);
|
|
144
|
-
this.setState(this._stateIdState, c.stateValue);
|
|
145
|
-
}
|
|
146
92
|
setBrightnessState(brightness, onSuccess) {
|
|
147
93
|
this.setState(this._stateIdBrightness, Math.max(0, Math.min(brightness, 100)), onSuccess);
|
|
148
94
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ZigbeeActuator } from './ZigbeeActuator';
|
|
2
|
+
import { iLamp, iTemporaryDisableAutomatic } from '../../baseDeviceInterfaces';
|
|
3
|
+
import { LampSetLightCommand, LampSetTimeBasedCommand, LampToggleLightCommand } from '../../../../models';
|
|
4
|
+
import { IoBrokerDeviceInfo } from '../../IoBrokerDeviceInfo';
|
|
5
|
+
import { DeviceType } from '../../deviceType';
|
|
6
|
+
export declare abstract class ZigbeeLamp extends ZigbeeActuator implements iLamp, iTemporaryDisableAutomatic {
|
|
7
|
+
protected abstract readonly _stateNameState: string;
|
|
8
|
+
protected _lightOn: boolean;
|
|
9
|
+
constructor(pInfo: IoBrokerDeviceInfo, deviceType: DeviceType);
|
|
10
|
+
/** @inheritDoc */
|
|
11
|
+
get lightOn(): boolean;
|
|
12
|
+
/** @inheritDoc */
|
|
13
|
+
update(idSplit: string[], state: ioBroker.State, initial?: boolean, handledByChildObject?: boolean): void;
|
|
14
|
+
/** @inheritDoc */
|
|
15
|
+
setTimeBased(c: LampSetTimeBasedCommand): void;
|
|
16
|
+
/** @inheritdoc */
|
|
17
|
+
setLight(c: LampSetLightCommand): void;
|
|
18
|
+
/** @inheritDoc */
|
|
19
|
+
toggleLight(c: LampToggleLightCommand): boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ZigbeeLamp = void 0;
|
|
4
|
+
const ZigbeeActuator_1 = require("./ZigbeeActuator");
|
|
5
|
+
const models_1 = require("../../../../models");
|
|
6
|
+
const sharedFunctions_1 = require("../../sharedFunctions");
|
|
7
|
+
const DeviceCapability_1 = require("../../DeviceCapability");
|
|
8
|
+
class ZigbeeLamp extends ZigbeeActuator_1.ZigbeeActuator {
|
|
9
|
+
constructor(pInfo, deviceType) {
|
|
10
|
+
super(pInfo, deviceType);
|
|
11
|
+
this._lightOn = false;
|
|
12
|
+
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.lamp);
|
|
13
|
+
}
|
|
14
|
+
/** @inheritDoc */
|
|
15
|
+
get lightOn() {
|
|
16
|
+
return this._lightOn;
|
|
17
|
+
}
|
|
18
|
+
/** @inheritDoc */
|
|
19
|
+
update(idSplit, state, initial = false, handledByChildObject = false) {
|
|
20
|
+
if (!handledByChildObject) {
|
|
21
|
+
this.log(models_1.LogLevel.DeepTrace, `Aktuator Update: ID: ${idSplit.join('.')} JSON: ${JSON.stringify(state)}`);
|
|
22
|
+
}
|
|
23
|
+
this.queuedValue = null;
|
|
24
|
+
this.log(models_1.LogLevel.DeepTrace, `Dimmer Update: ID: ${idSplit.join('.')} JSON: ${JSON.stringify(state)}`);
|
|
25
|
+
super.update(idSplit, state, initial, true);
|
|
26
|
+
switch (idSplit[3]) {
|
|
27
|
+
case this._stateNameState:
|
|
28
|
+
this.log(models_1.LogLevel.Trace, `Lamp Update für ${this.info.customName} auf ${state.val}`);
|
|
29
|
+
this._lightOn = state.val;
|
|
30
|
+
this.persist();
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/** @inheritDoc */
|
|
35
|
+
setTimeBased(c) {
|
|
36
|
+
sharedFunctions_1.LampUtils.setTimeBased(this, c);
|
|
37
|
+
}
|
|
38
|
+
/** @inheritdoc */
|
|
39
|
+
setLight(c) {
|
|
40
|
+
super.setActuator(c);
|
|
41
|
+
}
|
|
42
|
+
/** @inheritDoc */
|
|
43
|
+
toggleLight(c) {
|
|
44
|
+
return sharedFunctions_1.LampUtils.toggleLight(this, c);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.ZigbeeLamp = ZigbeeLamp;
|
|
@@ -89,11 +89,11 @@ class ZigbeeShutter extends zigbeeDevice_1.ZigbeeDevice {
|
|
|
89
89
|
this._firstCommandRecieved = true;
|
|
90
90
|
}
|
|
91
91
|
else if (this._firstCommandRecieved && c.isInitial) {
|
|
92
|
-
this.log(models_1.LogLevel.Debug, `Skipped initial
|
|
92
|
+
this.log(models_1.LogLevel.Debug, `Skipped initial shutter to ${pPosition} as we recieved a command already`);
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
95
|
if (this.currentLevel === pPosition && !c.isForceAction) {
|
|
96
|
-
this.log(models_1.LogLevel.Debug, `Skip
|
|
96
|
+
this.log(models_1.LogLevel.Debug, `Skip shutter command to Position ${pPosition} as this is the current one, commandLog: ${c.logMessage}`, services_1.LogDebugType.SkipUnchangedRolloPosition);
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
99
|
this.log(models_1.LogLevel.Debug, c.logMessage);
|
|
@@ -6,6 +6,7 @@ import { iLoadMeter } from '../baseDeviceInterfaces/iLoadMeter';
|
|
|
6
6
|
export declare class ZigbeeBlitzShp extends ZigbeeActuator implements iExcessEnergyConsumer, iLoadMeter {
|
|
7
7
|
/** @inheritDoc */
|
|
8
8
|
settings: ActuatorSettings;
|
|
9
|
+
protected readonly _stateIdState: string;
|
|
9
10
|
private _steckerOn;
|
|
10
11
|
private _current;
|
|
11
12
|
private _energy;
|
|
@@ -7,7 +7,7 @@ const BaseDevices_1 = require("./BaseDevices");
|
|
|
7
7
|
const DeviceCapability_1 = require("../DeviceCapability");
|
|
8
8
|
class ZigbeeBlitzShp extends BaseDevices_1.ZigbeeActuator {
|
|
9
9
|
constructor(pInfo) {
|
|
10
|
-
super(pInfo, deviceType_1.DeviceType.ZigbeeBlitzShp
|
|
10
|
+
super(pInfo, deviceType_1.DeviceType.ZigbeeBlitzShp);
|
|
11
11
|
/** @inheritDoc */
|
|
12
12
|
this.settings = new models_1.ActuatorSettings();
|
|
13
13
|
this._steckerOn = false;
|
|
@@ -16,6 +16,7 @@ class ZigbeeBlitzShp extends BaseDevices_1.ZigbeeActuator {
|
|
|
16
16
|
this._loadPower = 0;
|
|
17
17
|
this._availableForExcessEnergy = true;
|
|
18
18
|
this._activatedByExcessEnergy = false;
|
|
19
|
+
this._stateIdState = `${pInfo.fullID}.state`;
|
|
19
20
|
this.settings.energySettings = new models_1.ExcessEnergyConsumerSettings();
|
|
20
21
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.excessEnergyConsumer);
|
|
21
22
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.loadMetering);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ZigbeeActuator } from './BaseDevices';
|
|
2
2
|
import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
|
|
3
3
|
export declare class ZigbeeIkeaSteckdose extends ZigbeeActuator {
|
|
4
|
+
protected readonly _stateIdState: string;
|
|
4
5
|
constructor(pInfo: IoBrokerDeviceInfo);
|
|
5
6
|
/** @inheritDoc */
|
|
6
7
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
@@ -6,7 +6,8 @@ const BaseDevices_1 = require("./BaseDevices");
|
|
|
6
6
|
const models_1 = require("../../../models");
|
|
7
7
|
class ZigbeeIkeaSteckdose extends BaseDevices_1.ZigbeeActuator {
|
|
8
8
|
constructor(pInfo) {
|
|
9
|
-
super(pInfo, deviceType_1.DeviceType.ZigbeeIkeaSteckdose
|
|
9
|
+
super(pInfo, deviceType_1.DeviceType.ZigbeeIkeaSteckdose);
|
|
10
|
+
this._stateIdState = `${pInfo.fullID}.state`;
|
|
10
11
|
}
|
|
11
12
|
/** @inheritDoc */
|
|
12
13
|
update(idSplit, state, initial = false) {
|
|
@@ -2,7 +2,6 @@ import { ZigbeeActuator } from './BaseDevices';
|
|
|
2
2
|
import { DeviceType } from '../deviceType';
|
|
3
3
|
import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
|
|
4
4
|
export declare class ZigbeeIlluActuator extends ZigbeeActuator {
|
|
5
|
+
protected readonly _stateIdState: string;
|
|
5
6
|
constructor(pInfo: IoBrokerDeviceInfo, deviceType?: DeviceType);
|
|
6
|
-
/** @inheritDoc */
|
|
7
|
-
update(idSplit: string[], state: ioBroker.State, initial?: boolean, handledByChildObject?: boolean): void;
|
|
8
7
|
}
|
|
@@ -2,18 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ZigbeeIlluActuator = void 0;
|
|
4
4
|
const BaseDevices_1 = require("./BaseDevices");
|
|
5
|
-
const models_1 = require("../../../models");
|
|
6
5
|
const deviceType_1 = require("../deviceType");
|
|
7
6
|
class ZigbeeIlluActuator extends BaseDevices_1.ZigbeeActuator {
|
|
8
7
|
constructor(pInfo, deviceType = deviceType_1.DeviceType.ZigbeeIlluActuator) {
|
|
9
|
-
super(pInfo, deviceType
|
|
10
|
-
|
|
11
|
-
/** @inheritDoc */
|
|
12
|
-
update(idSplit, state, initial = false, handledByChildObject = false) {
|
|
13
|
-
if (!handledByChildObject) {
|
|
14
|
-
this.log(models_1.LogLevel.DeepTrace, `Aktuator Update: ID: ${idSplit.join('.')} JSON: ${JSON.stringify(state)}`);
|
|
15
|
-
}
|
|
16
|
-
super.update(idSplit, state, initial, true);
|
|
8
|
+
super(pInfo, deviceType);
|
|
9
|
+
this._stateIdState = `${pInfo.fullID}.state`;
|
|
17
10
|
}
|
|
18
11
|
}
|
|
19
12
|
exports.ZigbeeIlluActuator = ZigbeeIlluActuator;
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
import { ZigbeeIlluActuator } from './zigbeeIlluActuator';
|
|
2
|
-
import { LampSetLightCommand, LampSetTimeBasedCommand, LampToggleLightCommand } from '../../../models';
|
|
3
1
|
import { iLamp } from '../baseDeviceInterfaces';
|
|
4
2
|
import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
|
|
5
|
-
|
|
3
|
+
import { ZigbeeLamp } from './BaseDevices';
|
|
4
|
+
export declare class ZigbeeIlluLampe extends ZigbeeLamp implements iLamp {
|
|
5
|
+
protected readonly _stateIdState: string;
|
|
6
|
+
protected readonly _stateNameState: string;
|
|
6
7
|
constructor(pInfo: IoBrokerDeviceInfo);
|
|
7
|
-
/** @inheritDoc */
|
|
8
|
-
get lightOn(): boolean;
|
|
9
|
-
/** @inheritDoc */
|
|
10
|
-
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
11
|
-
/** @inheritdoc */
|
|
12
|
-
setLight(c: LampSetLightCommand): void;
|
|
13
|
-
/** @inheritDoc */
|
|
14
|
-
toggleLight(c: LampToggleLightCommand): boolean;
|
|
15
|
-
/** @inheritDoc */
|
|
16
|
-
setTimeBased(c: LampSetTimeBasedCommand): void;
|
|
17
|
-
/** @inheritDoc */
|
|
18
|
-
persist(): void;
|
|
19
8
|
}
|
|
@@ -2,45 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ZigbeeIlluLampe = void 0;
|
|
4
4
|
const deviceType_1 = require("../deviceType");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const services_1 = require("../../services");
|
|
8
|
-
const DeviceCapability_1 = require("../DeviceCapability");
|
|
9
|
-
const sharedFunctions_1 = require("../sharedFunctions");
|
|
10
|
-
class ZigbeeIlluLampe extends zigbeeIlluActuator_1.ZigbeeIlluActuator {
|
|
5
|
+
const BaseDevices_1 = require("./BaseDevices");
|
|
6
|
+
class ZigbeeIlluLampe extends BaseDevices_1.ZigbeeLamp {
|
|
11
7
|
constructor(pInfo) {
|
|
12
8
|
super(pInfo, deviceType_1.DeviceType.ZigbeeIlluLampe);
|
|
13
|
-
this.
|
|
14
|
-
|
|
15
|
-
/** @inheritDoc */
|
|
16
|
-
get lightOn() {
|
|
17
|
-
return super.actuatorOn;
|
|
18
|
-
}
|
|
19
|
-
/** @inheritDoc */
|
|
20
|
-
update(idSplit, state, initial = false) {
|
|
21
|
-
super.update(idSplit, state, initial, true);
|
|
22
|
-
switch (idSplit[3]) {
|
|
23
|
-
case 'state':
|
|
24
|
-
this.log(models_1.LogLevel.Trace, `Lampen Update für ${this.info.customName} auf ${state.val}`);
|
|
25
|
-
break;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
/** @inheritdoc */
|
|
29
|
-
setLight(c) {
|
|
30
|
-
super.setActuator(c);
|
|
31
|
-
}
|
|
32
|
-
/** @inheritDoc */
|
|
33
|
-
toggleLight(c) {
|
|
34
|
-
return sharedFunctions_1.LampUtils.toggleLight(this, c);
|
|
35
|
-
}
|
|
36
|
-
/** @inheritDoc */
|
|
37
|
-
setTimeBased(c) {
|
|
38
|
-
sharedFunctions_1.LampUtils.setTimeBased(this, c);
|
|
39
|
-
}
|
|
40
|
-
/** @inheritDoc */
|
|
41
|
-
persist() {
|
|
42
|
-
var _a;
|
|
43
|
-
(_a = services_1.Utils.dbo) === null || _a === void 0 ? void 0 : _a.persistActuator(this);
|
|
9
|
+
this._stateIdState = `${pInfo.fullID}.state`;
|
|
10
|
+
this._stateNameState = `${pInfo.fullID}.state`;
|
|
44
11
|
}
|
|
45
12
|
}
|
|
46
13
|
exports.ZigbeeIlluLampe = ZigbeeIlluLampe;
|
|
@@ -4,6 +4,7 @@ import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
|
|
|
4
4
|
import { iLoadMeter } from '../baseDeviceInterfaces/iLoadMeter';
|
|
5
5
|
export declare class ZigbeeUbisysActuator extends ZigbeeActuator implements iLoadMeter {
|
|
6
6
|
private _loadPower;
|
|
7
|
+
protected readonly _stateIdState: string;
|
|
7
8
|
/**
|
|
8
9
|
* Creates an instance of {@link DeviceType.ZigbeeUbisysActuator} or a derived class like {@link ZigbeeUbisysLampe}
|
|
9
10
|
* @param pInfo - Device creation information
|
|
@@ -13,5 +14,5 @@ export declare class ZigbeeUbisysActuator extends ZigbeeActuator implements iLoa
|
|
|
13
14
|
/** @inheritDoc */
|
|
14
15
|
get loadPower(): number;
|
|
15
16
|
/** @inheritDoc */
|
|
16
|
-
update(idSplit: string[], state: ioBroker.State, initial?: boolean
|
|
17
|
+
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
17
18
|
}
|
|
@@ -12,19 +12,17 @@ class ZigbeeUbisysActuator extends BaseDevices_1.ZigbeeActuator {
|
|
|
12
12
|
* @param deviceType - The device type (if not {@link DeviceType.ZigbeeUbisysActuator})
|
|
13
13
|
*/
|
|
14
14
|
constructor(pInfo, deviceType = deviceType_1.DeviceType.ZigbeeUbisysActuator) {
|
|
15
|
-
super(pInfo, deviceType
|
|
15
|
+
super(pInfo, deviceType);
|
|
16
16
|
this._loadPower = 0;
|
|
17
17
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.loadMetering);
|
|
18
|
+
this._stateIdState = `${pInfo.fullID}.state`;
|
|
18
19
|
}
|
|
19
20
|
/** @inheritDoc */
|
|
20
21
|
get loadPower() {
|
|
21
22
|
return this._loadPower;
|
|
22
23
|
}
|
|
23
24
|
/** @inheritDoc */
|
|
24
|
-
update(idSplit, state, initial = false
|
|
25
|
-
if (!handledByChildObject) {
|
|
26
|
-
this.log(models_1.LogLevel.DeepTrace, `Aktuator Update: ID: ${idSplit.join('.')} JSON: ${JSON.stringify(state)}`);
|
|
27
|
-
}
|
|
25
|
+
update(idSplit, state, initial = false) {
|
|
28
26
|
switch (idSplit[3]) {
|
|
29
27
|
case 'load_power':
|
|
30
28
|
const newLoadPower = state.val;
|