hoffmation-base 3.0.0-alpha.30 → 3.0.0-alpha.32
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/action/baseAction.d.ts +4 -0
- package/lib/models/action/baseAction.js +10 -0
- package/lib/models/action/humiditySensorChangeAction.d.ts +16 -0
- package/lib/models/action/humiditySensorChangeAction.js +15 -0
- package/lib/models/action/index.d.ts +7 -0
- package/lib/models/action/index.js +25 -0
- package/lib/models/action/motionSensorAction.d.ts +16 -0
- package/lib/models/action/motionSensorAction.js +15 -0
- package/lib/models/action/presenceGroupFirstEnterAction.d.ts +7 -0
- package/lib/models/action/presenceGroupFirstEnterAction.js +13 -0
- package/lib/models/action/presenceGroupLastLeftAction.d.ts +7 -0
- package/lib/models/action/presenceGroupLastLeftAction.js +13 -0
- package/lib/models/action/shutterPositionChangedAction.d.ts +13 -0
- package/lib/models/action/shutterPositionChangedAction.js +15 -0
- package/lib/models/action/temperatureSensorChangeAction.d.ts +16 -0
- package/lib/models/action/temperatureSensorChangeAction.js +15 -0
- package/lib/models/command/ShutterSetLevelCommand.d.ts +1 -1
- package/lib/models/command/ShutterSetLevelCommand.js +1 -1
- package/lib/models/command/WindowRestoreDesiredPositionCommand.d.ts +1 -1
- package/lib/models/command/WindowRestoreDesiredPositionCommand.js +1 -1
- package/lib/models/command/WindowSetDesiredPositionCommand.d.ts +1 -1
- package/lib/models/command/WindowSetDesiredPositionCommand.js +1 -1
- package/lib/models/command/WindowSetRolloByWeatherStatusCommand.d.ts +1 -1
- package/lib/models/command/WindowSetRolloByWeatherStatusCommand.js +1 -1
- package/lib/models/command/actuatorSetStateCommand.d.ts +1 -1
- package/lib/models/command/actuatorSetStateCommand.js +1 -1
- package/lib/models/command/actuatorToggleCommand.d.ts +1 -1
- package/lib/models/command/actuatorToggleCommand.js +1 -1
- package/lib/models/command/actuatorWriteStateToDeviceCommand.d.ts +1 -1
- package/lib/models/command/actuatorWriteStateToDeviceCommand.js +1 -1
- package/lib/models/command/baseCommand.d.ts +1 -1
- package/lib/models/command/baseCommand.js +2 -2
- package/lib/models/command/blockAutomaticCommand.d.ts +1 -1
- package/lib/models/command/blockAutomaticCommand.js +1 -1
- package/lib/models/command/blockAutomaticLiftBlockCommand.d.ts +1 -1
- package/lib/models/command/blockAutomaticLiftBlockCommand.js +1 -1
- package/lib/models/command/blockAutomaticUntilCommand.d.ts +1 -1
- package/lib/models/command/blockAutomaticUntilCommand.js +1 -1
- package/lib/models/command/commandType.d.ts +6 -0
- package/lib/models/command/commandType.js +6 -0
- package/lib/models/command/dimmerSetLightCommand.d.ts +1 -1
- package/lib/models/command/dimmerSetLightCommand.js +1 -1
- package/lib/models/command/floorSetAllShuttersCommand.d.ts +1 -1
- package/lib/models/command/floorSetAllShuttersCommand.js +1 -1
- package/lib/models/command/lampSetLightCommand.d.ts +1 -1
- package/lib/models/command/lampSetLightCommand.js +1 -1
- package/lib/models/command/lampSetTimeBasedCommand.d.ts +1 -1
- package/lib/models/command/lampSetTimeBasedCommand.js +1 -1
- package/lib/models/command/lampToggleLightCommand.d.ts +1 -1
- package/lib/models/command/lampToggleLightCommand.js +1 -1
- package/lib/models/command/ledSetLightCommand.d.ts +1 -1
- package/lib/models/command/ledSetLightCommand.js +1 -1
- package/lib/models/command/lightGroupSwitchTimeConditionalCommand.d.ts +1 -1
- package/lib/models/command/lightGroupSwitchTimeConditionalCommand.js +1 -1
- package/lib/models/command/restoreTargetAutomaticValueCommand.d.ts +1 -1
- package/lib/models/command/restoreTargetAutomaticValueCommand.js +1 -1
- package/lib/models/command/roomRestoreLightCommand.d.ts +1 -1
- package/lib/models/command/roomRestoreLightCommand.js +1 -1
- package/lib/models/command/roomRestoreShutterPositionCommand.d.ts +1 -1
- package/lib/models/command/roomRestoreShutterPositionCommand.js +1 -1
- package/lib/models/command/roomSetLightTimeBasedCommand.d.ts +1 -1
- package/lib/models/command/roomSetLightTimeBasedCommand.js +1 -1
- package/lib/models/command/shutterSunriseUpCommand.d.ts +1 -1
- package/lib/models/command/shutterSunriseUpCommand.js +1 -1
- package/lib/models/command/shutterSunsetDownCommand.d.ts +1 -1
- package/lib/models/command/shutterSunsetDownCommand.js +1 -1
- package/lib/models/command/wledSetLightCommand.d.ts +1 -1
- package/lib/models/command/wledSetLightCommand.js +1 -1
- package/lib/models/index.d.ts +1 -0
- package/lib/models/index.js +1 -0
- package/lib/server/devices/baseDeviceInterfaces/iHumiditySensor.d.ts +2 -1
- package/lib/server/devices/baseDeviceInterfaces/iMotionSensor.d.ts +2 -2
- package/lib/server/devices/baseDeviceInterfaces/iShutter.d.ts +1 -1
- package/lib/server/devices/baseDeviceInterfaces/iTemperatureSensor.d.ts +2 -1
- package/lib/server/devices/blueIris/cameraDevice.d.ts +2 -2
- package/lib/server/devices/blueIris/cameraDevice.js +1 -1
- package/lib/server/devices/dachs/dachsTemperatureSensor.d.ts +2 -2
- package/lib/server/devices/dachs/dachsTemperatureSensor.js +3 -2
- package/lib/server/devices/groups/Window.d.ts +2 -2
- package/lib/server/devices/groups/Window.js +4 -4
- package/lib/server/devices/groups/presenceGroup.d.ts +4 -2
- package/lib/server/devices/groups/presenceGroup.js +34 -39
- package/lib/server/devices/hmIPDevices/hmIpBewegung.d.ts +2 -2
- package/lib/server/devices/hmIPDevices/hmIpBewegung.js +1 -1
- package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.d.ts +3 -3
- package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.js +4 -4
- package/lib/server/devices/hmIPDevices/hmIpPraezenz.d.ts +8 -8
- package/lib/server/devices/hmIPDevices/hmIpPraezenz.js +9 -9
- package/lib/server/devices/hmIPDevices/hmIpRoll.js +1 -1
- package/lib/server/devices/index.d.ts +5 -3
- package/lib/server/devices/index.js +7 -4
- package/lib/server/devices/sharedFunctions/lampUtils.d.ts +10 -2
- package/lib/server/devices/sharedFunctions/lampUtils.js +29 -5
- package/lib/server/devices/wledDevice.js +7 -0
- package/lib/server/devices/zigbee/BaseDevices/zigbeeDimmer.js +7 -0
- package/lib/server/devices/zigbee/BaseDevices/zigbeeMotionSensor.d.ts +3 -3
- package/lib/server/devices/zigbee/BaseDevices/zigbeeMotionSensor.js +1 -1
- package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.d.ts +1 -1
- package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.js +1 -1
- package/lib/server/devices/zigbee/zigbeeSonoffTemp.d.ts +3 -2
- package/lib/server/devices/zigbee/zigbeeSonoffTemp.js +4 -4
- package/lib/server/services/ac/ac-device.js +3 -3
- package/lib/server/services/govee/own-govee-device.js +7 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { HmIPDevice } from './hmIpDevice';
|
|
2
|
-
import { MotionSensorSettings } from '../../../models';
|
|
2
|
+
import { MotionSensorAction, MotionSensorSettings } from '../../../models';
|
|
3
3
|
import { iBatteryDevice, iIlluminationSensor, iMotionSensor } from '../baseDeviceInterfaces';
|
|
4
4
|
import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
|
|
5
5
|
export declare class HmIpPraezenz extends HmIPDevice implements iIlluminationSensor, iBatteryDevice, iMotionSensor {
|
|
6
|
-
private _battery;
|
|
7
|
-
private _lastBatteryPersist;
|
|
8
|
-
get lastBatteryPersist(): number;
|
|
9
6
|
private static PRESENCE_DETECTION;
|
|
10
7
|
private static CURRENT_ILLUMINATION;
|
|
11
8
|
/** @inheritDoc */
|
|
12
9
|
movementDetected: boolean;
|
|
13
|
-
get battery(): number;
|
|
14
10
|
/** @inheritDoc */
|
|
15
11
|
settings: MotionSensorSettings;
|
|
12
|
+
private _battery;
|
|
13
|
+
private _lastBatteryPersist;
|
|
16
14
|
private _movementDetectedCallback;
|
|
17
15
|
private initialized;
|
|
18
16
|
private _lastMotionTime;
|
|
17
|
+
private _detectionsToday;
|
|
18
|
+
private _currentIllumination;
|
|
19
19
|
constructor(pInfo: IoBrokerDeviceInfo);
|
|
20
|
+
get lastBatteryPersist(): number;
|
|
21
|
+
get battery(): number;
|
|
20
22
|
get timeSinceLastMotion(): number;
|
|
21
|
-
private _detectionsToday;
|
|
22
23
|
get detectionsToday(): number;
|
|
23
24
|
set detectionsToday(pVal: number);
|
|
24
|
-
private _currentIllumination;
|
|
25
25
|
get currentIllumination(): number;
|
|
26
26
|
private set currentIllumination(value);
|
|
27
|
-
addMovementCallback(pCallback: (
|
|
27
|
+
addMovementCallback(pCallback: (action: MotionSensorAction) => void): void;
|
|
28
28
|
/** @inheritDoc */
|
|
29
29
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
30
30
|
updatePresence(pVal: boolean): void;
|
|
@@ -7,21 +7,15 @@ const models_1 = require("../../../models");
|
|
|
7
7
|
const services_1 = require("../../services");
|
|
8
8
|
const DeviceCapability_1 = require("../DeviceCapability");
|
|
9
9
|
class HmIpPraezenz extends hmIpDevice_1.HmIPDevice {
|
|
10
|
-
get lastBatteryPersist() {
|
|
11
|
-
return this._lastBatteryPersist;
|
|
12
|
-
}
|
|
13
|
-
get battery() {
|
|
14
|
-
return this._battery;
|
|
15
|
-
}
|
|
16
10
|
constructor(pInfo) {
|
|
17
11
|
var _a;
|
|
18
12
|
super(pInfo, deviceType_1.DeviceType.HmIpPraezenz);
|
|
19
|
-
this._battery = -99;
|
|
20
|
-
this._lastBatteryPersist = 0;
|
|
21
13
|
/** @inheritDoc */
|
|
22
14
|
this.movementDetected = false;
|
|
23
15
|
/** @inheritDoc */
|
|
24
16
|
this.settings = new models_1.MotionSensorSettings();
|
|
17
|
+
this._battery = -99;
|
|
18
|
+
this._lastBatteryPersist = 0;
|
|
25
19
|
this._movementDetectedCallback = [];
|
|
26
20
|
// private presenceStateID: string;
|
|
27
21
|
this.initialized = false;
|
|
@@ -46,6 +40,12 @@ class HmIpPraezenz extends hmIpDevice_1.HmIPDevice {
|
|
|
46
40
|
});
|
|
47
41
|
}
|
|
48
42
|
}
|
|
43
|
+
get lastBatteryPersist() {
|
|
44
|
+
return this._lastBatteryPersist;
|
|
45
|
+
}
|
|
46
|
+
get battery() {
|
|
47
|
+
return this._battery;
|
|
48
|
+
}
|
|
49
49
|
get timeSinceLastMotion() {
|
|
50
50
|
return Math.floor((services_1.Utils.nowMS() - this._lastMotionTime) / 1000);
|
|
51
51
|
}
|
|
@@ -112,7 +112,7 @@ class HmIpPraezenz extends hmIpDevice_1.HmIPDevice {
|
|
|
112
112
|
this.log(models_1.LogLevel.Trace, `Dies ist die ${this.detectionsToday} Bewegung `);
|
|
113
113
|
}
|
|
114
114
|
for (const c of this._movementDetectedCallback) {
|
|
115
|
-
c(
|
|
115
|
+
c(new models_1.MotionSensorAction(this));
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
persistMotionSensor() {
|
|
@@ -44,7 +44,7 @@ class HmIpRoll extends hmIpDevice_1.HmIPDevice {
|
|
|
44
44
|
if (value !== this._currentLevel && this._window) {
|
|
45
45
|
services_1.Utils.guardedNewThread(() => {
|
|
46
46
|
var _a;
|
|
47
|
-
(_a = this._window) === null || _a === void 0 ? void 0 : _a.rolloPositionChange(value);
|
|
47
|
+
(_a = this._window) === null || _a === void 0 ? void 0 : _a.rolloPositionChange(new models_2.ShutterPositionChangedAction(this, value));
|
|
48
48
|
}, this);
|
|
49
49
|
this.persist();
|
|
50
50
|
}
|
|
@@ -10,19 +10,21 @@ export * from './scene/index';
|
|
|
10
10
|
export * from './sharedFunctions/index';
|
|
11
11
|
export * from './shelly/index';
|
|
12
12
|
export * from './tuya/index';
|
|
13
|
+
export * from './tv/index';
|
|
13
14
|
export * from './zigbee/index';
|
|
14
15
|
export * from './device-cluster';
|
|
15
16
|
export * from './device-cluster-type';
|
|
16
17
|
export * from './device-list';
|
|
18
|
+
export { DeviceCapability } from './DeviceCapability';
|
|
17
19
|
export * from './DeviceInfo';
|
|
18
20
|
export * from './devices';
|
|
19
21
|
export * from './deviceType';
|
|
20
22
|
export * from './deviceUpdater';
|
|
21
23
|
export * from './Griffe';
|
|
22
24
|
export * from './Heizgruppen';
|
|
23
|
-
export * from './mqtt';
|
|
24
25
|
export * from './iDeviceUpdater';
|
|
26
|
+
export * from './mqtt';
|
|
25
27
|
export * from './IoBrokerBaseDevice';
|
|
26
|
-
export * from './
|
|
27
|
-
export * from './wledDevice';
|
|
28
|
+
export * from './IoBrokerDeviceInfo';
|
|
28
29
|
export { NameAmountValuePair } from './nameAmountValuePair';
|
|
30
|
+
export * from './wledDevice';
|
|
@@ -14,7 +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.NameAmountValuePair = void 0;
|
|
17
|
+
exports.NameAmountValuePair = exports.DeviceCapability = void 0;
|
|
18
18
|
__exportStar(require("./baseDeviceInterfaces/index"), exports);
|
|
19
19
|
__exportStar(require("./blueIris/index"), exports);
|
|
20
20
|
__exportStar(require("./button/index"), exports);
|
|
@@ -27,20 +27,23 @@ __exportStar(require("./scene/index"), exports);
|
|
|
27
27
|
__exportStar(require("./sharedFunctions/index"), exports);
|
|
28
28
|
__exportStar(require("./shelly/index"), exports);
|
|
29
29
|
__exportStar(require("./tuya/index"), exports);
|
|
30
|
+
__exportStar(require("./tv/index"), exports);
|
|
30
31
|
__exportStar(require("./zigbee/index"), exports);
|
|
31
32
|
__exportStar(require("./device-cluster"), exports);
|
|
32
33
|
__exportStar(require("./device-cluster-type"), exports);
|
|
33
34
|
__exportStar(require("./device-list"), exports);
|
|
35
|
+
var DeviceCapability_1 = require("./DeviceCapability");
|
|
36
|
+
Object.defineProperty(exports, "DeviceCapability", { enumerable: true, get: function () { return DeviceCapability_1.DeviceCapability; } });
|
|
34
37
|
__exportStar(require("./DeviceInfo"), exports);
|
|
35
38
|
__exportStar(require("./devices"), exports);
|
|
36
39
|
__exportStar(require("./deviceType"), exports);
|
|
37
40
|
__exportStar(require("./deviceUpdater"), exports);
|
|
38
41
|
__exportStar(require("./Griffe"), exports);
|
|
39
42
|
__exportStar(require("./Heizgruppen"), exports);
|
|
40
|
-
__exportStar(require("./mqtt"), exports);
|
|
41
43
|
__exportStar(require("./iDeviceUpdater"), exports);
|
|
44
|
+
__exportStar(require("./mqtt"), exports);
|
|
42
45
|
__exportStar(require("./IoBrokerBaseDevice"), exports);
|
|
43
|
-
__exportStar(require("./
|
|
44
|
-
__exportStar(require("./wledDevice"), exports);
|
|
46
|
+
__exportStar(require("./IoBrokerDeviceInfo"), exports);
|
|
45
47
|
var nameAmountValuePair_1 = require("./nameAmountValuePair");
|
|
46
48
|
Object.defineProperty(exports, "NameAmountValuePair", { enumerable: true, get: function () { return nameAmountValuePair_1.NameAmountValuePair; } });
|
|
49
|
+
__exportStar(require("./wledDevice"), exports);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { iActuator, iLamp } from '../baseDeviceInterfaces';
|
|
2
|
-
import { ActuatorSetStateCommand, LampSetTimeBasedCommand, LampToggleLightCommand } from '../../../models';
|
|
2
|
+
import { ActuatorSetStateCommand, DimmerSetLightCommand, LampSetTimeBasedCommand, LampToggleLightCommand } from '../../../models';
|
|
3
|
+
import { iDimmableLamp } from '../baseDeviceInterfaces/iDimmableLamp';
|
|
3
4
|
export declare class LampUtils {
|
|
4
5
|
private static stromStossContinueTimeouts;
|
|
5
6
|
static stromStossOn(actuator: iActuator): void;
|
|
@@ -7,6 +8,13 @@ export declare class LampUtils {
|
|
|
7
8
|
static checkUnBlock(device: iActuator, command: ActuatorSetStateCommand): boolean;
|
|
8
9
|
static toggleLight(device: iLamp, c: LampToggleLightCommand): boolean;
|
|
9
10
|
static checkBlockActive(device: iActuator, c: ActuatorSetStateCommand): boolean;
|
|
10
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Check if the dimmer is already in the desired state thus allowing to skip this command
|
|
13
|
+
* @param {iDimmableLamp} device - The device to check
|
|
14
|
+
* @param {DimmerSetLightCommand} c - The command to check
|
|
15
|
+
* @returns {boolean} - True if the command can be skipped
|
|
16
|
+
*/
|
|
17
|
+
static checkDimmerUnchanged(device: iDimmableLamp, c: DimmerSetLightCommand): boolean;
|
|
18
|
+
static checkUnchanged(device: iActuator, c: ActuatorSetStateCommand, noLog?: boolean): boolean;
|
|
11
19
|
static setActuator(device: iActuator, c: ActuatorSetStateCommand): void;
|
|
12
20
|
}
|
|
@@ -61,12 +61,36 @@ class LampUtils {
|
|
|
61
61
|
}
|
|
62
62
|
return false;
|
|
63
63
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Check if the dimmer is already in the desired state thus allowing to skip this command
|
|
66
|
+
* @param {iDimmableLamp} device - The device to check
|
|
67
|
+
* @param {DimmerSetLightCommand} c - The command to check
|
|
68
|
+
* @returns {boolean} - True if the command can be skipped
|
|
69
|
+
*/
|
|
70
|
+
static checkDimmerUnchanged(device, c) {
|
|
71
|
+
if (c.isForceAction) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
if (!this.checkUnchanged(device, c, true)) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
if (c.brightness !== device.brightness) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
device.log(models_1.LogLevel.DeepTrace, `Light command can be skipped as the device is already in desired state: ${c.logMessage}`, services_1.LogDebugType.SkipUnchangedActuatorCommand);
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
static checkUnchanged(device, c, noLog = false) {
|
|
84
|
+
if (c.isForceAction) {
|
|
85
|
+
return false;
|
|
68
86
|
}
|
|
69
|
-
|
|
87
|
+
if (c.on !== device.queuedValue || (device.queuedValue === null && device.actuatorOn !== c.on)) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
if (!noLog) {
|
|
91
|
+
device.log(models_1.LogLevel.DeepTrace, `Light command can be skipped as device is already in desired state; command: ${c.logMessage}`, services_1.LogDebugType.SkipUnchangedActuatorCommand);
|
|
92
|
+
}
|
|
93
|
+
return true;
|
|
70
94
|
}
|
|
71
95
|
static setActuator(device, c) {
|
|
72
96
|
if (device.settings.isStromStoss &&
|
|
@@ -69,6 +69,13 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
|
|
|
69
69
|
if (sharedFunctions_1.LampUtils.checkBlockActive(this, c)) {
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
|
+
if (sharedFunctions_1.LampUtils.checkDimmerUnchanged(this, c)) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (c.isAutomaticAction) {
|
|
76
|
+
// Preserve the target state for the automatic handler, as
|
|
77
|
+
this.targetAutomaticState = c.on;
|
|
78
|
+
}
|
|
72
79
|
this.log(models_1.LogLevel.Debug, c.logMessage);
|
|
73
80
|
if (c.on && c.brightness !== -1 && this.brightness < 10) {
|
|
74
81
|
c.brightness = 10;
|
|
@@ -57,6 +57,13 @@ class ZigbeeDimmer extends zigbeeLamp_1.ZigbeeLamp {
|
|
|
57
57
|
if (sharedFunctions_1.LampUtils.checkBlockActive(this, c)) {
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
|
+
if (sharedFunctions_1.LampUtils.checkDimmerUnchanged(this, c)) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (c.isAutomaticAction) {
|
|
64
|
+
// Preserve the target state for the automatic handler, as
|
|
65
|
+
this.targetAutomaticState = c.on;
|
|
66
|
+
}
|
|
60
67
|
if (c.transitionTime > -1) {
|
|
61
68
|
this.setState(this._stateIdTransitionTime, c.transitionTime);
|
|
62
69
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { DeviceType } from '../../deviceType';
|
|
3
3
|
import { ZigbeeDevice } from './index';
|
|
4
|
-
import { MotionSensorSettings } from '../../../../models';
|
|
4
|
+
import { MotionSensorAction, MotionSensorSettings } from '../../../../models';
|
|
5
5
|
import { iBatteryDevice, iMotionSensor } from '../../baseDeviceInterfaces';
|
|
6
6
|
import { IoBrokerDeviceInfo } from '../../IoBrokerDeviceInfo';
|
|
7
7
|
export declare class ZigbeeMotionSensor extends ZigbeeDevice implements iMotionSensor, iBatteryDevice {
|
|
@@ -10,7 +10,7 @@ export declare class ZigbeeMotionSensor extends ZigbeeDevice implements iMotionS
|
|
|
10
10
|
/** @inheritDoc */
|
|
11
11
|
detectionsToday: number;
|
|
12
12
|
protected _initialized: boolean;
|
|
13
|
-
protected _movementDetectedCallback: Array<(
|
|
13
|
+
protected _movementDetectedCallback: Array<(action: MotionSensorAction) => void>;
|
|
14
14
|
protected _needsMovementResetFallback: boolean;
|
|
15
15
|
protected _fallBackTimeout: NodeJS.Timeout | undefined;
|
|
16
16
|
protected _timeSinceLastMotion: number;
|
|
@@ -31,7 +31,7 @@ export declare class ZigbeeMotionSensor extends ZigbeeDevice implements iMotionS
|
|
|
31
31
|
* @param pCallback - Function that accepts the new state as parameter
|
|
32
32
|
*/
|
|
33
33
|
/** @inheritDoc */
|
|
34
|
-
addMovementCallback(pCallback: (
|
|
34
|
+
addMovementCallback(pCallback: (action: MotionSensorAction) => void): void;
|
|
35
35
|
/** @inheritDoc */
|
|
36
36
|
persistMotionSensor(): void;
|
|
37
37
|
updateMovement(newState: boolean): void;
|
|
@@ -102,7 +102,7 @@ class ZigbeeMotionSensor extends index_1.ZigbeeDevice {
|
|
|
102
102
|
this.log(models_1.LogLevel.Trace, `This is movement no. ${this.detectionsToday}`);
|
|
103
103
|
}
|
|
104
104
|
for (const c of this._movementDetectedCallback) {
|
|
105
|
-
c(
|
|
105
|
+
c(new models_1.MotionSensorAction(this));
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
/** @inheritDoc */
|
|
@@ -19,7 +19,7 @@ export declare class ZigbeeShutter extends ZigbeeDevice implements iShutter {
|
|
|
19
19
|
/** @inheritDoc */
|
|
20
20
|
get currentLevel(): number;
|
|
21
21
|
/** @inheritDoc */
|
|
22
|
-
set currentLevel(value: number);
|
|
22
|
+
protected set currentLevel(value: number);
|
|
23
23
|
protected _window?: Window;
|
|
24
24
|
/** @inheritDoc */
|
|
25
25
|
get window(): Window | undefined;
|
|
@@ -52,7 +52,7 @@ class ZigbeeShutter extends zigbeeDevice_1.ZigbeeDevice {
|
|
|
52
52
|
if (value !== this._currentLevel && this._window) {
|
|
53
53
|
services_1.Utils.guardedNewThread(() => {
|
|
54
54
|
var _a;
|
|
55
|
-
(_a = this._window) === null || _a === void 0 ? void 0 : _a.rolloPositionChange(value);
|
|
55
|
+
(_a = this._window) === null || _a === void 0 ? void 0 : _a.rolloPositionChange(new models_1.ShutterPositionChangedAction(this, value));
|
|
56
56
|
}, this);
|
|
57
57
|
this.persist();
|
|
58
58
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { ZigbeeDevice } from './BaseDevices';
|
|
3
3
|
import { iBatteryDevice, iHumiditySensor, iTemperatureSensor } from '../baseDeviceInterfaces';
|
|
4
4
|
import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
|
|
5
|
+
import { HumiditySensorChangeAction, TemperatureSensorChangeAction } from '../../../models';
|
|
5
6
|
export declare class ZigbeeSonoffTemp extends ZigbeeDevice implements iTemperatureSensor, iHumiditySensor, iBatteryDevice {
|
|
6
7
|
private _battery;
|
|
7
8
|
private _lastBatteryPersist;
|
|
@@ -34,9 +35,9 @@ export declare class ZigbeeSonoffTemp extends ZigbeeDevice implements iTemperatu
|
|
|
34
35
|
/** @inheritDoc */
|
|
35
36
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
36
37
|
/** @inheritDoc */
|
|
37
|
-
addHumidityCallback(pCallback: (
|
|
38
|
+
addHumidityCallback(pCallback: (action: HumiditySensorChangeAction) => void): void;
|
|
38
39
|
/** @inheritDoc */
|
|
39
|
-
addTempChangeCallback(pCallback: (
|
|
40
|
+
addTempChangeCallback(pCallback: (action: TemperatureSensorChangeAction) => void): void;
|
|
40
41
|
/** @inheritDoc */
|
|
41
42
|
onTemperaturChange(newTemperatur: number): void;
|
|
42
43
|
/** @inheritDoc */
|
|
@@ -52,7 +52,7 @@ class ZigbeeSonoffTemp extends BaseDevices_1.ZigbeeDevice {
|
|
|
52
52
|
set humidity(val) {
|
|
53
53
|
this._humidity = val;
|
|
54
54
|
for (const cb of this._humidityCallbacks) {
|
|
55
|
-
cb(val);
|
|
55
|
+
cb(new models_1.HumiditySensorChangeAction(this, val));
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
/** @inheritDoc */
|
|
@@ -66,7 +66,7 @@ class ZigbeeSonoffTemp extends BaseDevices_1.ZigbeeDevice {
|
|
|
66
66
|
set temperature(val) {
|
|
67
67
|
this._temperature = val;
|
|
68
68
|
for (const cb of this._temperaturCallbacks) {
|
|
69
|
-
cb(val);
|
|
69
|
+
cb(new models_1.TemperatureSensorChangeAction(this, val));
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
/** @inheritDoc */
|
|
@@ -92,14 +92,14 @@ class ZigbeeSonoffTemp extends BaseDevices_1.ZigbeeDevice {
|
|
|
92
92
|
addHumidityCallback(pCallback) {
|
|
93
93
|
this._humidityCallbacks.push(pCallback);
|
|
94
94
|
if (this._humidity > 0) {
|
|
95
|
-
pCallback(this._humidity);
|
|
95
|
+
pCallback(new models_1.HumiditySensorChangeAction(this, this._humidity));
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
/** @inheritDoc */
|
|
99
99
|
addTempChangeCallback(pCallback) {
|
|
100
100
|
this._temperaturCallbacks.push(pCallback);
|
|
101
101
|
if (this._temperature > baseDeviceInterfaces_1.UNDEFINED_TEMP_VALUE) {
|
|
102
|
-
pCallback(this._temperature);
|
|
102
|
+
pCallback(new models_1.TemperatureSensorChangeAction(this, this._temperature));
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
/** @inheritDoc */
|
|
@@ -283,18 +283,18 @@ class AcDevice {
|
|
|
283
283
|
}
|
|
284
284
|
this.turnOn();
|
|
285
285
|
}
|
|
286
|
-
onRoomFirstEnter() {
|
|
286
|
+
onRoomFirstEnter(_action) {
|
|
287
287
|
if (!this.settings.noCoolingOnMovement || !this.on || this.mode === ac_mode_1.AcMode.Heating) {
|
|
288
288
|
return;
|
|
289
289
|
}
|
|
290
290
|
this.log(models_1.LogLevel.Info, 'Someone entered the room. Turning off AC');
|
|
291
291
|
this.turnOff();
|
|
292
292
|
}
|
|
293
|
-
onRoomLastLeave() {
|
|
293
|
+
onRoomLastLeave(action) {
|
|
294
294
|
if (!this.settings.noCoolingOnMovement) {
|
|
295
295
|
return;
|
|
296
296
|
}
|
|
297
|
-
this.log(models_1.LogLevel.Info,
|
|
297
|
+
this.log(models_1.LogLevel.Info, `Last person left the room (${action.reasonTrace}). Checking if we should turn on AC`);
|
|
298
298
|
this.restoreTargetAutomaticValue();
|
|
299
299
|
}
|
|
300
300
|
/** @inheritDoc */
|
|
@@ -117,6 +117,13 @@ class OwnGoveeDevice {
|
|
|
117
117
|
if (devices_1.LampUtils.checkBlockActive(this, c)) {
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
|
+
if (devices_1.LampUtils.checkDimmerUnchanged(this, c)) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (c.isAutomaticAction) {
|
|
124
|
+
// Preserve the target state for the automatic handler, as
|
|
125
|
+
this.targetAutomaticState = c.on;
|
|
126
|
+
}
|
|
120
127
|
if (c.brightness > -1 && c.on) {
|
|
121
128
|
this.setBrightness(c.brightness, () => {
|
|
122
129
|
this.turnOn();
|