hoffmation-base 3.0.0-alpha.35 → 3.0.0-alpha.37
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/server/devices/baseDeviceInterfaces/iLamp.d.ts +0 -4
- package/lib/server/devices/groups/lightGroup.js +3 -22
- package/lib/server/devices/hmIPDevices/hmIpLampe.d.ts +1 -1
- package/lib/server/devices/hmIPDevices/hmIpLampe.js +3 -3
- package/lib/server/devices/sharedFunctions/lampUtils.js +1 -1
- package/lib/server/devices/wledDevice.d.ts +0 -2
- package/lib/server/devices/wledDevice.js +3 -7
- package/lib/server/devices/zigbee/BaseDevices/ZigbeeActuator.d.ts +5 -4
- package/lib/server/devices/zigbee/BaseDevices/ZigbeeActuator.js +10 -9
- package/lib/server/devices/zigbee/BaseDevices/zigbeeDimmer.d.ts +2 -2
- package/lib/server/devices/zigbee/BaseDevices/zigbeeDimmer.js +4 -6
- package/lib/server/devices/zigbee/BaseDevices/zigbeeLamp.d.ts +0 -4
- package/lib/server/devices/zigbee/BaseDevices/zigbeeLamp.js +2 -14
- package/lib/server/devices/zigbee/BaseDevices/zigbeeLedRGBCCT.js +1 -1
- package/lib/server/devices/zigbee/zigbeeBlitzShp.d.ts +1 -1
- package/lib/server/devices/zigbee/zigbeeBlitzShp.js +1 -1
- package/lib/server/devices/zigbee/zigbeeIkeaSteckdose.d.ts +1 -1
- package/lib/server/devices/zigbee/zigbeeIkeaSteckdose.js +1 -1
- package/lib/server/devices/zigbee/zigbeeIlluActuator.d.ts +1 -1
- package/lib/server/devices/zigbee/zigbeeIlluActuator.js +1 -1
- package/lib/server/devices/zigbee/zigbeeIlluDimmer.d.ts +1 -1
- package/lib/server/devices/zigbee/zigbeeIlluDimmer.js +1 -1
- package/lib/server/devices/zigbee/zigbeeIlluLampe.d.ts +1 -2
- package/lib/server/devices/zigbee/zigbeeIlluLampe.js +1 -2
- package/lib/server/devices/zigbee/zigbeeIlluLedRGBCCT.d.ts +1 -1
- package/lib/server/devices/zigbee/zigbeeIlluLedRGBCCT.js +1 -1
- package/lib/server/devices/zigbee/zigbeeInnr142C.d.ts +1 -1
- package/lib/server/devices/zigbee/zigbeeInnr142C.js +1 -1
- package/lib/server/devices/zigbee/zigbeeLinkindLedRgbCct.d.ts +1 -1
- package/lib/server/devices/zigbee/zigbeeLinkindLedRgbCct.js +1 -1
- package/lib/server/devices/zigbee/zigbeeOsramDimmer.d.ts +1 -1
- package/lib/server/devices/zigbee/zigbeeOsramDimmer.js +1 -1
- package/lib/server/devices/zigbee/zigbeeUbisysActuator.d.ts +1 -1
- package/lib/server/devices/zigbee/zigbeeUbisysActuator.js +1 -1
- package/lib/server/devices/zigbee/zigbeeUbisysLampe.d.ts +1 -2
- package/lib/server/devices/zigbee/zigbeeUbisysLampe.js +1 -2
- package/lib/server/services/govee/own-govee-device.d.ts +1 -2
- package/lib/server/services/govee/own-govee-device.js +7 -10
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -6,10 +6,6 @@ import { iActuator } from './iActuator';
|
|
|
6
6
|
* For devices with {@link DeviceCapability.lamp} capability.
|
|
7
7
|
*/
|
|
8
8
|
export interface iLamp extends iActuator {
|
|
9
|
-
/**
|
|
10
|
-
* The state value of the device
|
|
11
|
-
*/
|
|
12
|
-
readonly lightOn: boolean;
|
|
13
9
|
/**
|
|
14
10
|
* Changes the state of the lamp based on the time
|
|
15
11
|
* @param command - The command to execute
|
|
@@ -17,28 +17,9 @@ class LightGroup extends base_group_1.BaseGroup {
|
|
|
17
17
|
this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.WLED, new device_list_1.DeviceList(wledIds));
|
|
18
18
|
}
|
|
19
19
|
anyLightsOn() {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
for (i = 0; i < this.getLED().length; i++) {
|
|
27
|
-
if (this.getLED()[i].actuatorOn) {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
for (i = 0; i < this.getOutlets().length; i++) {
|
|
32
|
-
if (this.getOutlets()[i].actuatorOn) {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
for (i = 0; i < this.getWled().length; i++) {
|
|
37
|
-
if (this.getWled()[i].actuatorOn) {
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return false;
|
|
20
|
+
return (this.getAllAsActuator().find((a) => {
|
|
21
|
+
return a.actuatorOn;
|
|
22
|
+
}) !== undefined);
|
|
42
23
|
}
|
|
43
24
|
getLights() {
|
|
44
25
|
return this.deviceCluster.getDevicesByType(device_cluster_type_1.DeviceClusterType.Lamps);
|
|
@@ -5,7 +5,7 @@ import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
|
|
|
5
5
|
import { BlockAutomaticHandler } from '../../services/blockAutomaticHandler';
|
|
6
6
|
export declare class HmIpLampe extends HmIPDevice implements iLamp, iTemporaryDisableAutomatic {
|
|
7
7
|
/** @inheritDoc */
|
|
8
|
-
|
|
8
|
+
private _actuatorOn;
|
|
9
9
|
/** @inheritDoc */
|
|
10
10
|
settings: ActuatorSettings;
|
|
11
11
|
private lightOnSwitchID;
|
|
@@ -12,7 +12,7 @@ class HmIpLampe extends hmIpDevice_1.HmIPDevice {
|
|
|
12
12
|
constructor(pInfo) {
|
|
13
13
|
super(pInfo, deviceType_1.DeviceType.HmIpLampe);
|
|
14
14
|
/** @inheritDoc */
|
|
15
|
-
this.
|
|
15
|
+
this._actuatorOn = false;
|
|
16
16
|
/** @inheritDoc */
|
|
17
17
|
this.settings = new models_1.ActuatorSettings();
|
|
18
18
|
this.lightOnSwitchID = '';
|
|
@@ -26,7 +26,7 @@ class HmIpLampe extends hmIpDevice_1.HmIPDevice {
|
|
|
26
26
|
this.blockAutomationHandler = new blockAutomaticHandler_1.BlockAutomaticHandler(this.restoreTargetAutomaticValue.bind(this));
|
|
27
27
|
}
|
|
28
28
|
get actuatorOn() {
|
|
29
|
-
return this.
|
|
29
|
+
return this._actuatorOn;
|
|
30
30
|
}
|
|
31
31
|
restoreTargetAutomaticValue(c) {
|
|
32
32
|
this.setLight(new models_1.LampSetLightCommand(c, this.targetAutomaticState));
|
|
@@ -39,7 +39,7 @@ class HmIpLampe extends hmIpDevice_1.HmIPDevice {
|
|
|
39
39
|
switch (idSplit[3]) {
|
|
40
40
|
case '1':
|
|
41
41
|
if (idSplit[4] === 'STATE') {
|
|
42
|
-
this.
|
|
42
|
+
this._actuatorOn = state.val;
|
|
43
43
|
this.persist();
|
|
44
44
|
}
|
|
45
45
|
break;
|
|
@@ -42,7 +42,7 @@ class LampUtils {
|
|
|
42
42
|
}
|
|
43
43
|
static toggleLight(device, c) {
|
|
44
44
|
var _a;
|
|
45
|
-
const newVal = device.queuedValue !== null ? !device.queuedValue : !device.
|
|
45
|
+
const newVal = device.queuedValue !== null ? !device.queuedValue : !device.actuatorOn;
|
|
46
46
|
if (newVal && c.time === undefined && c.calculateTime && device.room !== undefined) {
|
|
47
47
|
c.time = services_1.TimeCallbackService.dayType((_a = device.room) === null || _a === void 0 ? void 0 : _a.settings.lampOffset);
|
|
48
48
|
}
|
|
@@ -23,8 +23,6 @@ export declare class WledDevice extends IoBrokerBaseDevice implements iDimmableL
|
|
|
23
23
|
/** @inheritDoc */
|
|
24
24
|
get actuatorOn(): boolean;
|
|
25
25
|
/** @inheritDoc */
|
|
26
|
-
get lightOn(): boolean;
|
|
27
|
-
/** @inheritDoc */
|
|
28
26
|
restoreTargetAutomaticValue(c: RestoreTargetAutomaticValueCommand): void;
|
|
29
27
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean, _pOverride?: boolean): void;
|
|
30
28
|
/** @inheritDoc */
|
|
@@ -33,10 +33,6 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
|
|
|
33
33
|
return this.on;
|
|
34
34
|
}
|
|
35
35
|
/** @inheritDoc */
|
|
36
|
-
get lightOn() {
|
|
37
|
-
return this.on;
|
|
38
|
-
}
|
|
39
|
-
/** @inheritDoc */
|
|
40
36
|
restoreTargetAutomaticValue(c) {
|
|
41
37
|
this.setLight(new models_1.WledSetLightCommand(c, this.targetAutomaticState));
|
|
42
38
|
}
|
|
@@ -69,13 +65,13 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
|
|
|
69
65
|
if (sharedFunctions_1.LampUtils.checkBlockActive(this, c)) {
|
|
70
66
|
return;
|
|
71
67
|
}
|
|
72
|
-
if (sharedFunctions_1.LampUtils.canDimmerChangeBeSkipped(this, c)) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
68
|
if (c.isAutomaticAction) {
|
|
76
69
|
// Preserve the target state for the automatic handler, as
|
|
77
70
|
this.targetAutomaticState = c.on;
|
|
78
71
|
}
|
|
72
|
+
if (sharedFunctions_1.LampUtils.canDimmerChangeBeSkipped(this, c)) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
79
75
|
this.log(models_1.LogLevel.Debug, c.logMessage);
|
|
80
76
|
if (c.on && c.brightness !== -1 && this.brightness < 10) {
|
|
81
77
|
c.brightness = 10;
|
|
@@ -5,20 +5,21 @@ import { iActuator } from '../../baseDeviceInterfaces';
|
|
|
5
5
|
import { ZigbeeDevice } from './zigbeeDevice';
|
|
6
6
|
import { BlockAutomaticHandler } from '../../../services/blockAutomaticHandler';
|
|
7
7
|
export declare abstract class ZigbeeActuator extends ZigbeeDevice implements iActuator {
|
|
8
|
-
private _actuatorOn;
|
|
9
8
|
/** @inheritDoc */
|
|
10
9
|
readonly blockAutomationHandler: BlockAutomaticHandler;
|
|
11
10
|
/** @inheritDoc */
|
|
12
11
|
targetAutomaticState: boolean;
|
|
13
|
-
protected _lastPersist: number;
|
|
14
12
|
/** @inheritDoc */
|
|
15
13
|
settings: ActuatorSettings;
|
|
16
|
-
protected abstract readonly _stateIdState: string;
|
|
17
14
|
/** @inheritDoc */
|
|
18
15
|
queuedValue: boolean | null;
|
|
16
|
+
protected _lastPersist: number;
|
|
17
|
+
protected abstract readonly _actuatorOnStateIdState: string;
|
|
18
|
+
protected readonly _stateNameState: string;
|
|
19
|
+
private _actuatorOn;
|
|
20
|
+
constructor(pInfo: IoBrokerDeviceInfo, type: DeviceType);
|
|
19
21
|
/** @inheritDoc */
|
|
20
22
|
get actuatorOn(): boolean;
|
|
21
|
-
constructor(pInfo: IoBrokerDeviceInfo, type: DeviceType);
|
|
22
23
|
/** @inheritDoc */
|
|
23
24
|
restoreTargetAutomaticValue(c: RestoreTargetAutomaticValueCommand): void;
|
|
24
25
|
/** @inheritDoc */
|
|
@@ -8,25 +8,26 @@ const DeviceCapability_1 = require("../../DeviceCapability");
|
|
|
8
8
|
const blockAutomaticHandler_1 = require("../../../services/blockAutomaticHandler");
|
|
9
9
|
const sharedFunctions_1 = require("../../sharedFunctions");
|
|
10
10
|
class ZigbeeActuator extends zigbeeDevice_1.ZigbeeDevice {
|
|
11
|
-
/** @inheritDoc */
|
|
12
|
-
get actuatorOn() {
|
|
13
|
-
return this._actuatorOn;
|
|
14
|
-
}
|
|
15
11
|
constructor(pInfo, type) {
|
|
16
12
|
super(pInfo, type);
|
|
17
|
-
this._actuatorOn = false;
|
|
18
13
|
/** @inheritDoc */
|
|
19
14
|
this.targetAutomaticState = false;
|
|
20
|
-
this._lastPersist = 0;
|
|
21
15
|
/** @inheritDoc */
|
|
22
16
|
this.settings = new models_1.ActuatorSettings();
|
|
23
17
|
/** @inheritDoc */
|
|
24
18
|
this.queuedValue = null;
|
|
19
|
+
this._lastPersist = 0;
|
|
20
|
+
this._stateNameState = 'state';
|
|
21
|
+
this._actuatorOn = false;
|
|
25
22
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.actuator);
|
|
26
23
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.blockAutomatic);
|
|
27
24
|
this.blockAutomationHandler = new blockAutomaticHandler_1.BlockAutomaticHandler(this.restoreTargetAutomaticValue.bind(this));
|
|
28
25
|
}
|
|
29
26
|
/** @inheritDoc */
|
|
27
|
+
get actuatorOn() {
|
|
28
|
+
return this._actuatorOn;
|
|
29
|
+
}
|
|
30
|
+
/** @inheritDoc */
|
|
30
31
|
restoreTargetAutomaticValue(c) {
|
|
31
32
|
this.setActuator(new models_1.ActuatorSetStateCommand(c, this.targetAutomaticState));
|
|
32
33
|
}
|
|
@@ -38,7 +39,7 @@ class ZigbeeActuator extends zigbeeDevice_1.ZigbeeDevice {
|
|
|
38
39
|
this.queuedValue = null;
|
|
39
40
|
super.update(idSplit, state, initial, true);
|
|
40
41
|
switch (idSplit[3]) {
|
|
41
|
-
case
|
|
42
|
+
case this._stateNameState:
|
|
42
43
|
if (!handledByChildObject) {
|
|
43
44
|
this.log(models_1.LogLevel.Trace, `Aktor Update für ${this.info.customName} auf ${state.val}`);
|
|
44
45
|
}
|
|
@@ -49,7 +50,7 @@ class ZigbeeActuator extends zigbeeDevice_1.ZigbeeDevice {
|
|
|
49
50
|
}
|
|
50
51
|
/** @inheritDoc */
|
|
51
52
|
setActuator(command) {
|
|
52
|
-
if (this.
|
|
53
|
+
if (this._actuatorOnStateIdState === '') {
|
|
53
54
|
this.log(models_1.LogLevel.Error, 'Keine Switch ID bekannt.');
|
|
54
55
|
return;
|
|
55
56
|
}
|
|
@@ -75,7 +76,7 @@ class ZigbeeActuator extends zigbeeDevice_1.ZigbeeDevice {
|
|
|
75
76
|
/** @inheritDoc */
|
|
76
77
|
writeActuatorStateToDevice(c) {
|
|
77
78
|
this.log(models_1.LogLevel.Debug, c.logMessage, services_1.LogDebugType.SetActuator);
|
|
78
|
-
this.setState(this.
|
|
79
|
+
this.setState(this._actuatorOnStateIdState, c.stateValue, undefined, (err) => {
|
|
79
80
|
this.log(models_1.LogLevel.Error, `Lampe schalten ergab Fehler: ${err}`);
|
|
80
81
|
});
|
|
81
82
|
}
|
|
@@ -11,11 +11,11 @@ export declare abstract class ZigbeeDimmer extends ZigbeeLamp implements iDimmab
|
|
|
11
11
|
protected abstract readonly _stateIdTransitionTime: string;
|
|
12
12
|
protected abstract readonly _stateNameBrightness: string;
|
|
13
13
|
protected abstract readonly _stateNameTransitionTime: string;
|
|
14
|
-
protected constructor(pInfo: IoBrokerDeviceInfo, deviceType: DeviceType);
|
|
15
14
|
protected _brightness: number;
|
|
15
|
+
protected _transitionTime: number;
|
|
16
|
+
protected constructor(pInfo: IoBrokerDeviceInfo, deviceType: DeviceType);
|
|
16
17
|
/** @inheritDoc */
|
|
17
18
|
get brightness(): number;
|
|
18
|
-
protected _transitionTime: number;
|
|
19
19
|
/** @inheritDoc */
|
|
20
20
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
21
21
|
/** @inheritDoc */
|
|
@@ -13,9 +13,7 @@ class ZigbeeDimmer extends zigbeeLamp_1.ZigbeeLamp {
|
|
|
13
13
|
this.settings = new models_1.DimmerSettings();
|
|
14
14
|
this._brightness = 0;
|
|
15
15
|
this._transitionTime = 0;
|
|
16
|
-
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.lamp);
|
|
17
16
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.dimmablelamp);
|
|
18
|
-
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.blockAutomatic);
|
|
19
17
|
}
|
|
20
18
|
/** @inheritDoc */
|
|
21
19
|
get brightness() {
|
|
@@ -45,7 +43,7 @@ class ZigbeeDimmer extends zigbeeLamp_1.ZigbeeLamp {
|
|
|
45
43
|
/** @inheritDoc */
|
|
46
44
|
setLight(c) {
|
|
47
45
|
var _a;
|
|
48
|
-
if (this.
|
|
46
|
+
if (this._actuatorOnStateIdState === '') {
|
|
49
47
|
this.log(models_1.LogLevel.Error, 'Keine State ID bekannt.');
|
|
50
48
|
return;
|
|
51
49
|
}
|
|
@@ -57,13 +55,13 @@ class ZigbeeDimmer extends zigbeeLamp_1.ZigbeeLamp {
|
|
|
57
55
|
if (sharedFunctions_1.LampUtils.checkBlockActive(this, c)) {
|
|
58
56
|
return;
|
|
59
57
|
}
|
|
60
|
-
if (sharedFunctions_1.LampUtils.canDimmerChangeBeSkipped(this, c)) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
58
|
if (c.isAutomaticAction) {
|
|
64
59
|
// Preserve the target state for the automatic handler, as
|
|
65
60
|
this.targetAutomaticState = c.on;
|
|
66
61
|
}
|
|
62
|
+
if (sharedFunctions_1.LampUtils.canDimmerChangeBeSkipped(this, c)) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
67
65
|
if (c.transitionTime > -1) {
|
|
68
66
|
this.setState(this._stateIdTransitionTime, c.transitionTime);
|
|
69
67
|
}
|
|
@@ -4,12 +4,8 @@ import { LampSetLightCommand, LampSetTimeBasedCommand, LampToggleLightCommand }
|
|
|
4
4
|
import { IoBrokerDeviceInfo } from '../../IoBrokerDeviceInfo';
|
|
5
5
|
import { DeviceType } from '../../deviceType';
|
|
6
6
|
export declare abstract class ZigbeeLamp extends ZigbeeActuator implements iLamp, iTemporaryDisableAutomatic {
|
|
7
|
-
protected abstract readonly _stateNameState: string;
|
|
8
|
-
protected _lightOn: boolean;
|
|
9
7
|
constructor(pInfo: IoBrokerDeviceInfo, deviceType: DeviceType);
|
|
10
8
|
/** @inheritDoc */
|
|
11
|
-
get lightOn(): boolean;
|
|
12
|
-
/** @inheritDoc */
|
|
13
9
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean, handledByChildObject?: boolean): void;
|
|
14
10
|
/** @inheritDoc */
|
|
15
11
|
setTimeBased(c: LampSetTimeBasedCommand): void;
|
|
@@ -8,28 +8,16 @@ const DeviceCapability_1 = require("../../DeviceCapability");
|
|
|
8
8
|
class ZigbeeLamp extends ZigbeeActuator_1.ZigbeeActuator {
|
|
9
9
|
constructor(pInfo, deviceType) {
|
|
10
10
|
super(pInfo, deviceType);
|
|
11
|
-
this._lightOn = false;
|
|
12
11
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.lamp);
|
|
13
12
|
}
|
|
14
13
|
/** @inheritDoc */
|
|
15
|
-
get lightOn() {
|
|
16
|
-
return this._lightOn;
|
|
17
|
-
}
|
|
18
|
-
/** @inheritDoc */
|
|
19
14
|
update(idSplit, state, initial = false, handledByChildObject = false) {
|
|
20
15
|
if (!handledByChildObject) {
|
|
21
|
-
this.log(models_1.LogLevel.DeepTrace, `
|
|
16
|
+
this.log(models_1.LogLevel.DeepTrace, `Lamp Update: ID: ${idSplit.join('.')} JSON: ${JSON.stringify(state)}`);
|
|
22
17
|
}
|
|
23
18
|
this.queuedValue = null;
|
|
24
|
-
this.log(models_1.LogLevel.DeepTrace, `
|
|
19
|
+
this.log(models_1.LogLevel.DeepTrace, `Lamp Update: ID: ${idSplit.join('.')} JSON: ${JSON.stringify(state)}`);
|
|
25
20
|
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
21
|
}
|
|
34
22
|
/** @inheritDoc */
|
|
35
23
|
setTimeBased(c) {
|
|
@@ -49,7 +49,7 @@ class ZigbeeLedRGBCCT extends zigbeeDimmer_1.ZigbeeDimmer {
|
|
|
49
49
|
}
|
|
50
50
|
/** @inheritDoc */
|
|
51
51
|
setLight(c) {
|
|
52
|
-
if (this.
|
|
52
|
+
if (this._actuatorOnStateIdState === '') {
|
|
53
53
|
this.log(models_1.LogLevel.Error, 'Keine State ID bekannt.');
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
@@ -6,7 +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
|
|
9
|
+
protected readonly _actuatorOnStateIdState: string;
|
|
10
10
|
private _steckerOn;
|
|
11
11
|
private _current;
|
|
12
12
|
private _energy;
|
|
@@ -16,7 +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.
|
|
19
|
+
this._actuatorOnStateIdState = `${pInfo.fullID}.state`;
|
|
20
20
|
this.settings.energySettings = new models_1.ExcessEnergyConsumerSettings();
|
|
21
21
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.excessEnergyConsumer);
|
|
22
22
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.loadMetering);
|
|
@@ -1,7 +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
|
|
4
|
+
protected readonly _actuatorOnStateIdState: string;
|
|
5
5
|
constructor(pInfo: IoBrokerDeviceInfo);
|
|
6
6
|
/** @inheritDoc */
|
|
7
7
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
@@ -7,7 +7,7 @@ const models_1 = require("../../../models");
|
|
|
7
7
|
class ZigbeeIkeaSteckdose extends BaseDevices_1.ZigbeeActuator {
|
|
8
8
|
constructor(pInfo) {
|
|
9
9
|
super(pInfo, deviceType_1.DeviceType.ZigbeeIkeaSteckdose);
|
|
10
|
-
this.
|
|
10
|
+
this._actuatorOnStateIdState = `${pInfo.fullID}.state`;
|
|
11
11
|
}
|
|
12
12
|
/** @inheritDoc */
|
|
13
13
|
update(idSplit, state, initial = false) {
|
|
@@ -2,6 +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
|
|
5
|
+
protected readonly _actuatorOnStateIdState: string;
|
|
6
6
|
constructor(pInfo: IoBrokerDeviceInfo, deviceType?: DeviceType);
|
|
7
7
|
}
|
|
@@ -6,7 +6,7 @@ const deviceType_1 = require("../deviceType");
|
|
|
6
6
|
class ZigbeeIlluActuator extends BaseDevices_1.ZigbeeActuator {
|
|
7
7
|
constructor(pInfo, deviceType = deviceType_1.DeviceType.ZigbeeIlluActuator) {
|
|
8
8
|
super(pInfo, deviceType);
|
|
9
|
-
this.
|
|
9
|
+
this._actuatorOnStateIdState = `${pInfo.fullID}.state`;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
exports.ZigbeeIlluActuator = ZigbeeIlluActuator;
|
|
@@ -5,7 +5,7 @@ export declare class ZigbeeIlluDimmer extends ZigbeeDimmer {
|
|
|
5
5
|
protected _stateNameState: string;
|
|
6
6
|
protected _stateNameTransitionTime: string;
|
|
7
7
|
protected _stateIdBrightness: string;
|
|
8
|
-
protected
|
|
8
|
+
protected _actuatorOnStateIdState: string;
|
|
9
9
|
protected _stateIdTransitionTime: string;
|
|
10
10
|
constructor(pInfo: IoBrokerDeviceInfo);
|
|
11
11
|
}
|
|
@@ -9,7 +9,7 @@ class ZigbeeIlluDimmer extends BaseDevices_1.ZigbeeDimmer {
|
|
|
9
9
|
this._stateNameBrightness = 'brightness';
|
|
10
10
|
this._stateNameState = 'state';
|
|
11
11
|
this._stateNameTransitionTime = 'transition_time';
|
|
12
|
-
this.
|
|
12
|
+
this._actuatorOnStateIdState = `${this.info.fullID}.state`;
|
|
13
13
|
this._stateIdBrightness = `${this.info.fullID}.brightness`;
|
|
14
14
|
this._stateIdTransitionTime = `${this.info.fullID}.transition_time`;
|
|
15
15
|
}
|
|
@@ -2,7 +2,6 @@ import { iLamp } from '../baseDeviceInterfaces';
|
|
|
2
2
|
import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
|
|
3
3
|
import { ZigbeeLamp } from './BaseDevices';
|
|
4
4
|
export declare class ZigbeeIlluLampe extends ZigbeeLamp implements iLamp {
|
|
5
|
-
protected readonly
|
|
6
|
-
protected readonly _stateNameState: string;
|
|
5
|
+
protected readonly _actuatorOnStateIdState: string;
|
|
7
6
|
constructor(pInfo: IoBrokerDeviceInfo);
|
|
8
7
|
}
|
|
@@ -6,8 +6,7 @@ const BaseDevices_1 = require("./BaseDevices");
|
|
|
6
6
|
class ZigbeeIlluLampe extends BaseDevices_1.ZigbeeLamp {
|
|
7
7
|
constructor(pInfo) {
|
|
8
8
|
super(pInfo, deviceType_1.DeviceType.ZigbeeIlluLampe);
|
|
9
|
-
this.
|
|
10
|
-
this._stateNameState = `${pInfo.fullID}.state`;
|
|
9
|
+
this._actuatorOnStateIdState = `${pInfo.fullID}.${this._stateNameState}`;
|
|
11
10
|
}
|
|
12
11
|
}
|
|
13
12
|
exports.ZigbeeIlluLampe = ZigbeeIlluLampe;
|
|
@@ -4,7 +4,7 @@ export declare class ZigbeeIlluLedRGBCCT extends ZigbeeLedRGBCCT {
|
|
|
4
4
|
protected readonly _stateIdBrightness: string;
|
|
5
5
|
protected readonly _stateIdColor: string;
|
|
6
6
|
protected readonly _stateIdColorTemp: string;
|
|
7
|
-
protected readonly
|
|
7
|
+
protected readonly _actuatorOnStateIdState: string;
|
|
8
8
|
protected readonly _stateIdTransitionTime: string;
|
|
9
9
|
protected readonly _stateNameBrightness: string;
|
|
10
10
|
protected readonly _stateNameState: string;
|
|
@@ -14,7 +14,7 @@ class ZigbeeIlluLedRGBCCT extends BaseDevices_1.ZigbeeLedRGBCCT {
|
|
|
14
14
|
this._stateIdBrightness = `${this.info.fullID}.brightness`;
|
|
15
15
|
this._stateIdColor = `${this.info.fullID}.color`;
|
|
16
16
|
this._stateIdColorTemp = `${this.info.fullID}.colortemp`;
|
|
17
|
-
this.
|
|
17
|
+
this._actuatorOnStateIdState = `${this.info.fullID}.state`;
|
|
18
18
|
this._stateIdTransitionTime = `${this.info.fullID}.transition_time`;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -4,7 +4,7 @@ export declare class ZigbeeInnr142C extends ZigbeeLedRGBCCT {
|
|
|
4
4
|
protected readonly _stateIdBrightness: string;
|
|
5
5
|
protected readonly _stateIdColor: string;
|
|
6
6
|
protected readonly _stateIdColorTemp: string;
|
|
7
|
-
protected readonly
|
|
7
|
+
protected readonly _actuatorOnStateIdState: string;
|
|
8
8
|
protected readonly _stateIdTransitionTime: string;
|
|
9
9
|
protected readonly _stateNameBrightness: string;
|
|
10
10
|
protected readonly _stateNameState: string;
|
|
@@ -15,7 +15,7 @@ class ZigbeeInnr142C extends BaseDevices_1.ZigbeeLedRGBCCT {
|
|
|
15
15
|
this._stateIdBrightness = `${this.info.fullID}.brightness`;
|
|
16
16
|
this._stateIdColor = `${this.info.fullID}.color`;
|
|
17
17
|
this._stateIdColorTemp = `${this.info.fullID}.colortemp`;
|
|
18
|
-
this.
|
|
18
|
+
this._actuatorOnStateIdState = `${this.info.fullID}.state`;
|
|
19
19
|
this._stateIdTransitionTime = `${this.info.fullID}.transition_time`;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -4,7 +4,7 @@ export declare class ZigbeeLinkindLedRgbCct extends ZigbeeLedRGBCCT {
|
|
|
4
4
|
protected readonly _stateIdBrightness: string;
|
|
5
5
|
protected readonly _stateIdColor: string;
|
|
6
6
|
protected readonly _stateIdColorTemp: string;
|
|
7
|
-
protected readonly
|
|
7
|
+
protected readonly _actuatorOnStateIdState: string;
|
|
8
8
|
protected readonly _stateIdTransitionTime: string;
|
|
9
9
|
protected readonly _stateNameBrightness: string;
|
|
10
10
|
protected readonly _stateNameState: string;
|
|
@@ -14,7 +14,7 @@ class ZigbeeLinkindLedRgbCct extends BaseDevices_1.ZigbeeLedRGBCCT {
|
|
|
14
14
|
this._stateIdBrightness = `${this.info.fullID}.brightness`;
|
|
15
15
|
this._stateIdColor = `${this.info.fullID}.color`;
|
|
16
16
|
this._stateIdColorTemp = `${this.info.fullID}.colortemp`;
|
|
17
|
-
this.
|
|
17
|
+
this._actuatorOnStateIdState = `${this.info.fullID}.state`;
|
|
18
18
|
this._stateIdTransitionTime = `${this.info.fullID}.transition_time`;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -5,7 +5,7 @@ export declare class ZigbeeOsramDimmer extends ZigbeeDimmer {
|
|
|
5
5
|
protected _stateNameState: string;
|
|
6
6
|
protected _stateNameTransitionTime: string;
|
|
7
7
|
protected _stateIdBrightness: string;
|
|
8
|
-
protected
|
|
8
|
+
protected _actuatorOnStateIdState: string;
|
|
9
9
|
protected _stateIdTransitionTime: string;
|
|
10
10
|
constructor(pInfo: IoBrokerDeviceInfo);
|
|
11
11
|
}
|
|
@@ -9,7 +9,7 @@ class ZigbeeOsramDimmer extends BaseDevices_1.ZigbeeDimmer {
|
|
|
9
9
|
this._stateNameBrightness = 'brightness';
|
|
10
10
|
this._stateNameState = 'state';
|
|
11
11
|
this._stateNameTransitionTime = 'transition_time';
|
|
12
|
-
this.
|
|
12
|
+
this._actuatorOnStateIdState = `${this.info.fullID}.state`;
|
|
13
13
|
this._stateIdBrightness = `${this.info.fullID}.brightness`;
|
|
14
14
|
this._stateIdTransitionTime = `${this.info.fullID}.transition_time`;
|
|
15
15
|
}
|
|
@@ -4,7 +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
|
|
7
|
+
protected readonly _actuatorOnStateIdState: string;
|
|
8
8
|
/**
|
|
9
9
|
* Creates an instance of {@link DeviceType.ZigbeeUbisysActuator} or a derived class like {@link ZigbeeUbisysLampe}
|
|
10
10
|
* @param pInfo - Device creation information
|
|
@@ -15,7 +15,7 @@ class ZigbeeUbisysActuator extends BaseDevices_1.ZigbeeActuator {
|
|
|
15
15
|
super(pInfo, deviceType);
|
|
16
16
|
this._loadPower = 0;
|
|
17
17
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.loadMetering);
|
|
18
|
-
this.
|
|
18
|
+
this._actuatorOnStateIdState = `${pInfo.fullID}.state`;
|
|
19
19
|
}
|
|
20
20
|
/** @inheritDoc */
|
|
21
21
|
get loadPower() {
|
|
@@ -3,8 +3,7 @@ import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
|
|
|
3
3
|
import { ZigbeeLamp } from './BaseDevices';
|
|
4
4
|
import { iLoadMeter } from '../baseDeviceInterfaces/iLoadMeter';
|
|
5
5
|
export declare class ZigbeeUbisysLampe extends ZigbeeLamp implements iLamp, iLoadMeter {
|
|
6
|
-
protected readonly
|
|
7
|
-
protected readonly _stateNameState: string;
|
|
6
|
+
protected readonly _actuatorOnStateIdState: string;
|
|
8
7
|
private _loadPower;
|
|
9
8
|
constructor(pInfo: IoBrokerDeviceInfo);
|
|
10
9
|
/** @inheritDoc */
|
|
@@ -10,8 +10,7 @@ class ZigbeeUbisysLampe extends BaseDevices_1.ZigbeeLamp {
|
|
|
10
10
|
super(pInfo, deviceType_1.DeviceType.ZigbeeUbisysLampe);
|
|
11
11
|
this._loadPower = 0;
|
|
12
12
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.loadMetering);
|
|
13
|
-
this.
|
|
14
|
-
this._stateNameState = `${pInfo.fullID}.state`;
|
|
13
|
+
this._actuatorOnStateIdState = `${pInfo.fullID}.state`;
|
|
15
14
|
}
|
|
16
15
|
/** @inheritDoc */
|
|
17
16
|
get loadPower() {
|
|
@@ -27,7 +27,7 @@ export declare class OwnGoveeDevice implements iLedRgbCct, iTemporaryDisableAuto
|
|
|
27
27
|
/** @inheritDoc */
|
|
28
28
|
targetAutomaticState: boolean;
|
|
29
29
|
protected _info: DeviceInfo;
|
|
30
|
-
private
|
|
30
|
+
private _actuatorOn;
|
|
31
31
|
private _color;
|
|
32
32
|
private _colortemp;
|
|
33
33
|
private _room;
|
|
@@ -37,7 +37,6 @@ export declare class OwnGoveeDevice implements iLedRgbCct, iTemporaryDisableAuto
|
|
|
37
37
|
get room(): RoomBase;
|
|
38
38
|
get customName(): string;
|
|
39
39
|
get actuatorOn(): boolean;
|
|
40
|
-
get lightOn(): boolean;
|
|
41
40
|
get info(): DeviceInfo;
|
|
42
41
|
get id(): string;
|
|
43
42
|
get name(): string;
|
|
@@ -32,7 +32,7 @@ class OwnGoveeDevice {
|
|
|
32
32
|
this.brightness = -1;
|
|
33
33
|
/** @inheritDoc */
|
|
34
34
|
this.targetAutomaticState = false;
|
|
35
|
-
this.
|
|
35
|
+
this._actuatorOn = false;
|
|
36
36
|
this._color = '#fcba32';
|
|
37
37
|
this._colortemp = 500;
|
|
38
38
|
this._room = undefined;
|
|
@@ -63,10 +63,7 @@ class OwnGoveeDevice {
|
|
|
63
63
|
return this.info.customName;
|
|
64
64
|
}
|
|
65
65
|
get actuatorOn() {
|
|
66
|
-
return this.
|
|
67
|
-
}
|
|
68
|
-
get lightOn() {
|
|
69
|
-
return this._on;
|
|
66
|
+
return this._actuatorOn;
|
|
70
67
|
}
|
|
71
68
|
get info() {
|
|
72
69
|
return this._info;
|
|
@@ -117,13 +114,13 @@ class OwnGoveeDevice {
|
|
|
117
114
|
if (devices_1.LampUtils.checkBlockActive(this, c)) {
|
|
118
115
|
return;
|
|
119
116
|
}
|
|
120
|
-
if (devices_1.LampUtils.canDimmerChangeBeSkipped(this, c)) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
117
|
if (c.isAutomaticAction) {
|
|
124
118
|
// Preserve the target state for the automatic handler, as
|
|
125
119
|
this.targetAutomaticState = c.on;
|
|
126
120
|
}
|
|
121
|
+
if (devices_1.LampUtils.canDimmerChangeBeSkipped(this, c)) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
127
124
|
if (c.brightness > -1 && c.on) {
|
|
128
125
|
this.setBrightness(c.brightness, () => {
|
|
129
126
|
this.turnOn();
|
|
@@ -168,7 +165,7 @@ class OwnGoveeDevice {
|
|
|
168
165
|
}
|
|
169
166
|
update(data) {
|
|
170
167
|
this.queuedValue = null;
|
|
171
|
-
this.
|
|
168
|
+
this._actuatorOn = data.onOff === 1;
|
|
172
169
|
this.brightness = data.brightness;
|
|
173
170
|
this._color = `#${data.color.r.toString(16)}${data.color.g.toString(16)}${data.color.b.toString(16)}`;
|
|
174
171
|
this._colortemp = data.colorTemInKelvin;
|
|
@@ -199,7 +196,7 @@ class OwnGoveeDevice {
|
|
|
199
196
|
}
|
|
200
197
|
turnOn() {
|
|
201
198
|
var _a;
|
|
202
|
-
if (this.
|
|
199
|
+
if (this._actuatorOn) {
|
|
203
200
|
return;
|
|
204
201
|
}
|
|
205
202
|
this.queuedValue = true;
|