hoffmation-base 3.0.0-alpha.89 → 3.0.0-alpha.90
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/batteryLevelChangeAction.js +2 -2
- package/lib/models/iJsonOmitKeys.d.ts +9 -0
- package/lib/models/iJsonOmitKeys.js +2 -0
- package/lib/models/index.d.ts +1 -0
- package/lib/server/devices/IoBrokerBaseDevice.d.ts +4 -2
- package/lib/server/devices/IoBrokerBaseDevice.js +3 -1
- package/lib/server/devices/baseDeviceInterfaces/iBatteryDevice.d.ts +4 -13
- package/lib/server/devices/baseDeviceInterfaces/iHandleSensor.d.ts +10 -0
- package/lib/server/devices/baseDeviceInterfaces/iHumiditySensor.d.ts +3 -7
- package/lib/server/devices/baseDeviceInterfaces/iTemperatureSensor.d.ts +3 -7
- package/lib/server/devices/dachs/dachs.js +2 -5
- package/lib/server/devices/dachs/dachsTemperatureSensor.d.ts +2 -7
- package/lib/server/devices/dachs/dachsTemperatureSensor.js +9 -31
- package/lib/server/devices/deviceType.d.ts +1 -0
- package/lib/server/devices/deviceType.js +1 -0
- package/lib/server/devices/devices.js +5 -2
- package/lib/server/devices/groups/Window.d.ts +2 -3
- package/lib/server/devices/groups/Window.js +3 -3
- package/lib/server/devices/groups/windowGroup.js +2 -2
- package/lib/server/devices/hmIPDevices/hmIpGriff.d.ts +9 -35
- package/lib/server/devices/hmIPDevices/hmIpGriff.js +27 -171
- package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.d.ts +5 -13
- package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.js +30 -66
- package/lib/server/devices/hmIPDevices/hmIpHeizung.d.ts +4 -14
- package/lib/server/devices/hmIPDevices/hmIpHeizung.js +6 -39
- package/lib/server/devices/hmIPDevices/hmIpPraezenz.d.ts +5 -14
- package/lib/server/devices/hmIPDevices/hmIpPraezenz.js +6 -38
- package/lib/server/devices/hmIPDevices/hmIpRoll.js +2 -2
- package/lib/server/devices/hmIPDevices/hmIpTaster.d.ts +4 -14
- package/lib/server/devices/hmIPDevices/hmIpTaster.js +6 -38
- package/lib/server/devices/hmIPDevices/hmIpTherm.d.ts +4 -14
- package/lib/server/devices/hmIPDevices/hmIpTherm.js +6 -39
- package/lib/server/devices/models/WindowPosition.d.ts +3 -3
- package/lib/server/devices/models/WindowPosition.js +3 -3
- package/lib/server/devices/sharedFunctions/battery.d.ts +31 -0
- package/lib/server/devices/sharedFunctions/battery.js +65 -0
- package/lib/server/devices/sharedFunctions/handleSensor.d.ts +45 -0
- package/lib/server/devices/sharedFunctions/handleSensor.js +150 -0
- package/lib/server/devices/sharedFunctions/humiditySensor.d.ts +18 -0
- package/lib/server/devices/sharedFunctions/humiditySensor.js +46 -0
- package/lib/server/devices/sharedFunctions/index.d.ts +4 -0
- package/lib/server/devices/sharedFunctions/index.js +4 -0
- package/lib/server/devices/sharedFunctions/temperatureSensor.d.ts +31 -0
- package/lib/server/devices/sharedFunctions/temperatureSensor.js +57 -0
- package/lib/server/devices/shelly/shellyTrv.d.ts +5 -16
- package/lib/server/devices/shelly/shellyTrv.js +7 -41
- package/lib/server/devices/smartGarden/smartGardenDevice.d.ts +4 -16
- package/lib/server/devices/smartGarden/smartGardenDevice.js +7 -42
- package/lib/server/devices/smartGarden/smartGardenSensor.d.ts +3 -13
- package/lib/server/devices/smartGarden/smartGardenSensor.js +14 -57
- package/lib/server/devices/velux/veluxShutter.js +2 -2
- package/lib/server/devices/zigbee/BaseDevices/index.d.ts +1 -0
- package/lib/server/devices/zigbee/BaseDevices/index.js +3 -1
- package/lib/server/devices/zigbee/BaseDevices/zigbeeHeater.d.ts +5 -15
- package/lib/server/devices/zigbee/BaseDevices/zigbeeHeater.js +7 -40
- package/lib/server/devices/zigbee/BaseDevices/zigbeeMagnetContact.d.ts +4 -15
- package/lib/server/devices/zigbee/BaseDevices/zigbeeMagnetContact.js +7 -40
- package/lib/server/devices/zigbee/BaseDevices/zigbeeMotionSensor.d.ts +5 -16
- package/lib/server/devices/zigbee/BaseDevices/zigbeeMotionSensor.js +7 -41
- package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.js +2 -2
- package/lib/server/devices/zigbee/BaseDevices/zigbeeWindowHandle.d.ts +36 -0
- package/lib/server/devices/zigbee/BaseDevices/zigbeeWindowHandle.js +82 -0
- package/lib/server/devices/zigbee/index.d.ts +1 -0
- package/lib/server/devices/zigbee/index.js +1 -0
- package/lib/server/devices/zigbee/zigbeeAquaraVibra.d.ts +4 -16
- package/lib/server/devices/zigbee/zigbeeAquaraVibra.js +7 -41
- package/lib/server/devices/zigbee/zigbeeAquaraWater.d.ts +4 -16
- package/lib/server/devices/zigbee/zigbeeAquaraWater.js +7 -41
- package/lib/server/devices/zigbee/zigbeeHeimanSmoke.d.ts +4 -16
- package/lib/server/devices/zigbee/zigbeeHeimanSmoke.js +7 -41
- package/lib/server/devices/zigbee/zigbeeSodaHandle.d.ts +34 -0
- package/lib/server/devices/zigbee/zigbeeSodaHandle.js +96 -0
- package/lib/server/devices/zigbee/zigbeeSonoffTemp.d.ts +7 -27
- package/lib/server/devices/zigbee/zigbeeSonoffTemp.js +21 -94
- package/lib/server/services/dbo/postgreSqlPersist.js +1 -1
- package/lib/server/services/utils/utils.js +5 -1
- package/lib/server/services/victron/victron-device.d.ts +8 -15
- package/lib/server/services/victron/victron-device.js +22 -51
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -5,10 +5,10 @@ const baseAction_1 = require("./baseAction");
|
|
|
5
5
|
const command_1 = require("../command");
|
|
6
6
|
class BatteryLevelChangeAction extends baseAction_1.BaseAction {
|
|
7
7
|
constructor(device) {
|
|
8
|
-
super(undefined, `New Battery Level (${device.
|
|
8
|
+
super(undefined, `New Battery Level (${device.batteryLevel}%) received`);
|
|
9
9
|
/** @inheritDoc */
|
|
10
10
|
this.type = command_1.CommandType.BatteryManagerLevelChangeAction;
|
|
11
|
-
this.newLevel = device.
|
|
11
|
+
this.newLevel = device.batteryLevel;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
exports.BatteryLevelChangeAction = BatteryLevelChangeAction;
|
package/lib/models/index.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { iRoomDevice } from './baseDeviceInterfaces';
|
|
2
2
|
import { LogDebugType } from '../services';
|
|
3
|
-
import { DeviceSettings, LogLevel, RoomBase, RoomDeviceAddingSettings } from '../../models';
|
|
3
|
+
import { DeviceSettings, iJsonOmitKeys, LogLevel, RoomBase, RoomDeviceAddingSettings } from '../../models';
|
|
4
4
|
import { IOBrokerConnection } from '../ioBroker';
|
|
5
5
|
import { DeviceType } from './deviceType';
|
|
6
6
|
import { IoBrokerDeviceInfo } from './IoBrokerDeviceInfo';
|
|
7
7
|
import { DeviceCapability } from './DeviceCapability';
|
|
8
|
-
export declare abstract class IoBrokerBaseDevice implements iRoomDevice {
|
|
8
|
+
export declare abstract class IoBrokerBaseDevice implements iRoomDevice, iJsonOmitKeys {
|
|
9
9
|
protected _info: IoBrokerDeviceInfo;
|
|
10
10
|
deviceType: DeviceType;
|
|
11
|
+
/** @inheritDoc */
|
|
12
|
+
readonly jsonOmitKeys: string[];
|
|
11
13
|
/**
|
|
12
14
|
* The settings for adding devices to Rooms
|
|
13
15
|
*/
|
|
@@ -19,6 +19,8 @@ class IoBrokerBaseDevice {
|
|
|
19
19
|
constructor(_info, deviceType) {
|
|
20
20
|
this._info = _info;
|
|
21
21
|
this.deviceType = deviceType;
|
|
22
|
+
/** @inheritDoc */
|
|
23
|
+
this.jsonOmitKeys = ['individualStateCallbacks'];
|
|
22
24
|
/**
|
|
23
25
|
* @inheritDoc
|
|
24
26
|
* @default undefined (no Settings)
|
|
@@ -107,7 +109,7 @@ class IoBrokerBaseDevice {
|
|
|
107
109
|
}
|
|
108
110
|
/** @inheritDoc */
|
|
109
111
|
toJSON() {
|
|
110
|
-
return services_1.Utils.jsonFilter(this,
|
|
112
|
+
return services_1.Utils.jsonFilter(this, this.jsonOmitKeys, ['_room']);
|
|
111
113
|
}
|
|
112
114
|
/** @inheritDoc */
|
|
113
115
|
persistDeviceInfo() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BatteryLevelChangeAction } from '../../../models';
|
|
2
1
|
import { iBaseDevice } from './iBaseDevice';
|
|
2
|
+
import { Battery } from '../sharedFunctions';
|
|
3
3
|
/**
|
|
4
4
|
* Interface for Battery Devices.
|
|
5
5
|
* A battery device can be any device that is powered by a battery e.g. a remote, a sensor, etc.
|
|
@@ -8,20 +8,11 @@ import { iBaseDevice } from './iBaseDevice';
|
|
|
8
8
|
*/
|
|
9
9
|
export interface iBatteryDevice extends iBaseDevice {
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Common battery handling like persisting
|
|
12
12
|
*/
|
|
13
|
-
readonly
|
|
13
|
+
readonly battery: Battery;
|
|
14
14
|
/**
|
|
15
15
|
* The battery status of the device in percentage (0 empty - 100 full)
|
|
16
16
|
*/
|
|
17
|
-
readonly
|
|
18
|
-
/**
|
|
19
|
-
* Method to persist the battery status of the device to the persistence layer
|
|
20
|
-
*/
|
|
21
|
-
persistBatteryDevice(): void;
|
|
22
|
-
/**
|
|
23
|
-
* Adds a callback for when the battery-level has Changed.
|
|
24
|
-
* @param pCallback - Function that accepts the new state as parameter
|
|
25
|
-
*/
|
|
26
|
-
addBatteryLevelCallback(pCallback: (action: BatteryLevelChangeAction) => void): void;
|
|
17
|
+
readonly batteryLevel: number;
|
|
27
18
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { WindowPosition } from '../models';
|
|
2
2
|
import { iRoomDevice } from './iRoomDevice';
|
|
3
|
+
import { HandleSensor } from '../sharedFunctions';
|
|
4
|
+
import { Window } from '../groups';
|
|
3
5
|
/**
|
|
4
6
|
* Interface for Handle Sensors.
|
|
5
7
|
* A handle sensor can be any device that is capable of detecting the position of a window handle e.g. a sensor, a window handle, etc.
|
|
@@ -7,6 +9,10 @@ import { iRoomDevice } from './iRoomDevice';
|
|
|
7
9
|
* For devices with {@link DeviceCapability.handleSensor} capability.
|
|
8
10
|
*/
|
|
9
11
|
export interface iHandleSensor extends iRoomDevice {
|
|
12
|
+
/**
|
|
13
|
+
* A common object for all handle sensors handling stuff like persist and callbacks
|
|
14
|
+
*/
|
|
15
|
+
handleSensor: HandleSensor;
|
|
10
16
|
/**
|
|
11
17
|
* The current position of the handle
|
|
12
18
|
*/
|
|
@@ -15,6 +21,10 @@ export interface iHandleSensor extends iRoomDevice {
|
|
|
15
21
|
* The time the handle was open in minutes
|
|
16
22
|
*/
|
|
17
23
|
minutesOpen: number;
|
|
24
|
+
/**
|
|
25
|
+
* If known the window this handle is attached to
|
|
26
|
+
*/
|
|
27
|
+
window: Window | undefined;
|
|
18
28
|
/**
|
|
19
29
|
* Add a callback that is called when the handle is change to open
|
|
20
30
|
* @param pCallback - The callback to fire
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { iRoomDevice } from './iRoomDevice';
|
|
2
2
|
import { HumiditySensorChangeAction } from '../../../models';
|
|
3
|
+
import { HumiditySensor } from '../sharedFunctions';
|
|
3
4
|
export declare const UNDEFINED_HUMIDITY_VALUE = -1;
|
|
4
5
|
/**
|
|
5
6
|
* This interface represents a humidity sensor device.
|
|
@@ -8,10 +9,9 @@ export declare const UNDEFINED_HUMIDITY_VALUE = -1;
|
|
|
8
9
|
*/
|
|
9
10
|
export interface iHumiditySensor extends iRoomDevice {
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
-
* This mainly enforces the interval to be implemented.
|
|
12
|
+
* Common humidity sensor handling like persisting
|
|
13
13
|
*/
|
|
14
|
-
readonly
|
|
14
|
+
readonly humiditySensor: HumiditySensor;
|
|
15
15
|
/**
|
|
16
16
|
* The current humidity in percent
|
|
17
17
|
*/
|
|
@@ -21,8 +21,4 @@ export interface iHumiditySensor extends iRoomDevice {
|
|
|
21
21
|
* @param pCallback - The callback to fire
|
|
22
22
|
*/
|
|
23
23
|
addHumidityCallback(pCallback: (action: HumiditySensorChangeAction) => void): void;
|
|
24
|
-
/**
|
|
25
|
-
* Persists the current humidity information to the database
|
|
26
|
-
*/
|
|
27
|
-
persistHumiditySensor(): void;
|
|
28
24
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { iRoomDevice } from './iRoomDevice';
|
|
2
2
|
import { TemperatureSensorChangeAction } from '../../../models';
|
|
3
|
+
import { TemperatureSensor } from '../sharedFunctions';
|
|
3
4
|
export declare const UNDEFINED_TEMP_VALUE = -99;
|
|
4
5
|
/**
|
|
5
6
|
* This interface represents a temperature sensor device.
|
|
@@ -8,10 +9,9 @@ export declare const UNDEFINED_TEMP_VALUE = -99;
|
|
|
8
9
|
*/
|
|
9
10
|
export interface iTemperatureSensor extends iRoomDevice {
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
-
* Mainly used to enforce implementation
|
|
12
|
+
* Service which handles common aspects of the temperature sensor like persisting
|
|
13
13
|
*/
|
|
14
|
-
readonly
|
|
14
|
+
readonly temperatureSensor: TemperatureSensor;
|
|
15
15
|
/**
|
|
16
16
|
* The current room temperature as a number in Celsius
|
|
17
17
|
*/
|
|
@@ -34,8 +34,4 @@ export interface iTemperatureSensor extends iRoomDevice {
|
|
|
34
34
|
* @param newTemperatur - The new temperature in the room in Celsius
|
|
35
35
|
*/
|
|
36
36
|
onTemperaturChange(newTemperatur: number): void;
|
|
37
|
-
/**
|
|
38
|
-
* Persists the current temperature sensor information to the database
|
|
39
|
-
*/
|
|
40
|
-
persistTemperaturSensor(): void;
|
|
41
37
|
}
|
|
@@ -12,7 +12,6 @@ const dachsSettings_1 = require("../../../models/deviceSettings/dachsSettings");
|
|
|
12
12
|
const lib_1 = require("./lib");
|
|
13
13
|
const dachsTemperatureSensor_1 = require("./dachsTemperatureSensor");
|
|
14
14
|
const blockAutomaticHandler_1 = require("../../services/blockAutomaticHandler");
|
|
15
|
-
const config_1 = require("../../config");
|
|
16
15
|
class Dachs {
|
|
17
16
|
/** @inheritDoc */
|
|
18
17
|
get customName() {
|
|
@@ -61,7 +60,7 @@ class Dachs {
|
|
|
61
60
|
this.blockAutomationHandler = new blockAutomaticHandler_1.BlockAutomaticHandler(this.restoreTargetAutomaticValue.bind(this), this.log.bind(this));
|
|
62
61
|
if ((_b = (_a = devices_1.Devices.energymanager) === null || _a === void 0 ? void 0 : _a.deviceCapabilities) === null || _b === void 0 ? void 0 : _b.includes(devices_1.DeviceCapability.batteryDriven)) {
|
|
63
62
|
const energyManager = devices_1.Devices.energymanager;
|
|
64
|
-
energyManager.addBatteryLevelCallback(this.onBatteryLevelChange.bind(this));
|
|
63
|
+
energyManager.battery.addBatteryLevelCallback(this.onBatteryLevelChange.bind(this));
|
|
65
64
|
}
|
|
66
65
|
this.warmWaterSensor.addTempChangeCallback(this.onTempChange.bind(this));
|
|
67
66
|
this.heatStorageTempSensor.addTempChangeCallback(this.onTempChange.bind(this));
|
|
@@ -271,12 +270,10 @@ class Dachs {
|
|
|
271
270
|
this.warmWaterPump.setActuator(setAction);
|
|
272
271
|
}
|
|
273
272
|
checkHeatingRod(action) {
|
|
274
|
-
var _a;
|
|
275
273
|
if (this.heatingRod === undefined) {
|
|
276
274
|
return;
|
|
277
275
|
}
|
|
278
|
-
const shouldBeOff =
|
|
279
|
-
action.newLevel < this.settings.batteryLevelHeatingRodThreshold;
|
|
276
|
+
const shouldBeOff = action.newLevel < this.settings.batteryLevelHeatingRodThreshold;
|
|
280
277
|
if (this.heatingRod.actuatorOn !== shouldBeOff) {
|
|
281
278
|
return;
|
|
282
279
|
}
|
|
@@ -4,6 +4,7 @@ import { DeviceCapability } from '../DeviceCapability';
|
|
|
4
4
|
import { DeviceType } from '../deviceType';
|
|
5
5
|
import { DeviceInfo } from '../DeviceInfo';
|
|
6
6
|
import { DeviceSettings, LogLevel, RoomBase, TemperatureSensorChangeAction } from '../../../models';
|
|
7
|
+
import { TemperatureSensor } from '../sharedFunctions';
|
|
7
8
|
export declare class DachsTemperatureSensor implements iTemperatureSensor {
|
|
8
9
|
/** @inheritDoc */
|
|
9
10
|
settings: DeviceSettings | undefined;
|
|
@@ -12,9 +13,7 @@ export declare class DachsTemperatureSensor implements iTemperatureSensor {
|
|
|
12
13
|
/** @inheritDoc */
|
|
13
14
|
readonly deviceCapabilities: DeviceCapability[];
|
|
14
15
|
/** @inheritDoc */
|
|
15
|
-
|
|
16
|
-
private _temperaturCallbacks;
|
|
17
|
-
private _roomTemperature;
|
|
16
|
+
temperatureSensor: TemperatureSensor;
|
|
18
17
|
protected _info: DeviceInfo;
|
|
19
18
|
constructor(roomName: string, shortKey: string, longKey: string);
|
|
20
19
|
/** @inheritDoc */
|
|
@@ -34,16 +33,12 @@ export declare class DachsTemperatureSensor implements iTemperatureSensor {
|
|
|
34
33
|
get iTemperature(): number;
|
|
35
34
|
/** @inheritDoc */
|
|
36
35
|
get sTemperature(): string;
|
|
37
|
-
private _temperature;
|
|
38
|
-
private set temperature(value);
|
|
39
36
|
update(newTemp: number): void;
|
|
40
37
|
/** @inheritDoc */
|
|
41
38
|
addTempChangeCallback(pCallback: (action: TemperatureSensorChangeAction) => void): void;
|
|
42
39
|
/** @inheritDoc */
|
|
43
40
|
onTemperaturChange(newTemperatur: number): void;
|
|
44
41
|
/** @inheritDoc */
|
|
45
|
-
persistTemperaturSensor(): void;
|
|
46
|
-
/** @inheritDoc */
|
|
47
42
|
log(level: LogLevel, message: string, debugType?: LogDebugType): void;
|
|
48
43
|
/** @inheritDoc */
|
|
49
44
|
toJSON(): Partial<OwnSonosDevice>;
|
|
@@ -4,14 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.DachsTemperatureSensor = void 0;
|
|
7
|
-
const baseDeviceInterfaces_1 = require("../baseDeviceInterfaces");
|
|
8
7
|
const services_1 = require("../../services");
|
|
9
8
|
const DeviceCapability_1 = require("../DeviceCapability");
|
|
10
9
|
const deviceType_1 = require("../deviceType");
|
|
11
10
|
const DeviceInfo_1 = require("../DeviceInfo");
|
|
12
11
|
const devices_1 = require("../devices");
|
|
13
12
|
const lodash_1 = __importDefault(require("lodash"));
|
|
14
|
-
const
|
|
13
|
+
const sharedFunctions_1 = require("../sharedFunctions");
|
|
15
14
|
class DachsTemperatureSensor {
|
|
16
15
|
constructor(roomName, shortKey, longKey) {
|
|
17
16
|
/** @inheritDoc */
|
|
@@ -21,12 +20,7 @@ class DachsTemperatureSensor {
|
|
|
21
20
|
/** @inheritDoc */
|
|
22
21
|
this.deviceCapabilities = [];
|
|
23
22
|
/** @inheritDoc */
|
|
24
|
-
this.
|
|
25
|
-
this.persistTemperaturSensor();
|
|
26
|
-
}, 5 * 60 * 1000, this, false);
|
|
27
|
-
this._temperaturCallbacks = [];
|
|
28
|
-
this._roomTemperature = baseDeviceInterfaces_1.UNDEFINED_TEMP_VALUE;
|
|
29
|
-
this._temperature = baseDeviceInterfaces_1.UNDEFINED_TEMP_VALUE;
|
|
23
|
+
this.temperatureSensor = new sharedFunctions_1.TemperatureSensor(this);
|
|
30
24
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.temperatureSensor);
|
|
31
25
|
this._info = new DeviceInfo_1.DeviceInfo();
|
|
32
26
|
this._info.fullName = longKey;
|
|
@@ -60,46 +54,32 @@ class DachsTemperatureSensor {
|
|
|
60
54
|
}
|
|
61
55
|
/** @inheritDoc */
|
|
62
56
|
get roomTemperature() {
|
|
63
|
-
return this.
|
|
57
|
+
return this.temperatureSensor.roomTemperature;
|
|
64
58
|
}
|
|
65
59
|
/** @inheritDoc */
|
|
66
60
|
set roomTemperature(value) {
|
|
67
|
-
this.
|
|
61
|
+
this.temperatureSensor.roomTemperature = value;
|
|
68
62
|
}
|
|
69
63
|
/** @inheritDoc */
|
|
70
64
|
get iTemperature() {
|
|
71
|
-
return this.
|
|
65
|
+
return this.temperatureSensor.temperature;
|
|
72
66
|
}
|
|
73
67
|
/** @inheritDoc */
|
|
74
68
|
get sTemperature() {
|
|
75
|
-
return `${this.
|
|
76
|
-
}
|
|
77
|
-
set temperature(val) {
|
|
78
|
-
this._temperature = val;
|
|
79
|
-
for (const cb of this._temperaturCallbacks) {
|
|
80
|
-
cb(new models_1.TemperatureSensorChangeAction(this, val));
|
|
81
|
-
}
|
|
69
|
+
return `${this.temperatureSensor.temperature}°C`;
|
|
82
70
|
}
|
|
83
71
|
update(newTemp) {
|
|
84
|
-
this.temperature = newTemp;
|
|
72
|
+
this.temperatureSensor.temperature = newTemp;
|
|
85
73
|
}
|
|
86
74
|
/** @inheritDoc */
|
|
87
75
|
addTempChangeCallback(pCallback) {
|
|
88
|
-
this.
|
|
89
|
-
if (this._temperature > baseDeviceInterfaces_1.UNDEFINED_TEMP_VALUE) {
|
|
90
|
-
pCallback(new models_1.TemperatureSensorChangeAction(this, this._temperature));
|
|
91
|
-
}
|
|
76
|
+
this.temperatureSensor.addTempChangeCallback(pCallback);
|
|
92
77
|
}
|
|
93
78
|
/** @inheritDoc */
|
|
94
79
|
onTemperaturChange(newTemperatur) {
|
|
95
80
|
this.roomTemperature = newTemperatur;
|
|
96
81
|
}
|
|
97
82
|
/** @inheritDoc */
|
|
98
|
-
persistTemperaturSensor() {
|
|
99
|
-
var _a;
|
|
100
|
-
(_a = services_1.Utils.dbo) === null || _a === void 0 ? void 0 : _a.persistTemperatureSensor(this);
|
|
101
|
-
}
|
|
102
|
-
/** @inheritDoc */
|
|
103
83
|
log(level, message, debugType = services_1.LogDebugType.None) {
|
|
104
84
|
services_1.ServerLogService.writeLog(level, `${this.name}: ${message}`, {
|
|
105
85
|
debugType: debugType,
|
|
@@ -126,9 +106,7 @@ class DachsTemperatureSensor {
|
|
|
126
106
|
}
|
|
127
107
|
/** @inheritDoc */
|
|
128
108
|
dispose() {
|
|
129
|
-
|
|
130
|
-
clearInterval(this.persistTemperatureSensorInterval);
|
|
131
|
-
}
|
|
109
|
+
this.temperatureSensor.dispose();
|
|
132
110
|
}
|
|
133
111
|
}
|
|
134
112
|
exports.DachsTemperatureSensor = DachsTemperatureSensor;
|
|
@@ -42,6 +42,7 @@ var DeviceType;
|
|
|
42
42
|
DeviceType[DeviceType["ZigbeeUbisysActuator"] = 224] = "ZigbeeUbisysActuator";
|
|
43
43
|
DeviceType[DeviceType["ZigbeeUbisysLampe"] = 225] = "ZigbeeUbisysLampe";
|
|
44
44
|
DeviceType[DeviceType["ZigbeeInnr142C"] = 226] = "ZigbeeInnr142C";
|
|
45
|
+
DeviceType[DeviceType["ZigbeeSodaHandle"] = 227] = "ZigbeeSodaHandle";
|
|
45
46
|
DeviceType[DeviceType["JsEnergyManager"] = 301] = "JsEnergyManager";
|
|
46
47
|
DeviceType[DeviceType["RoomScene"] = 401] = "RoomScene";
|
|
47
48
|
DeviceType[DeviceType["ShellyTrv"] = 402] = "ShellyTrv";
|
|
@@ -87,8 +87,8 @@ class Devices {
|
|
|
87
87
|
if (!d.deviceCapabilities.includes(DeviceCapability_1.DeviceCapability.batteryDriven)) {
|
|
88
88
|
continue;
|
|
89
89
|
}
|
|
90
|
-
if (d.
|
|
91
|
-
data.push({ name: d.info.customName, amount: d.
|
|
90
|
+
if (d.batteryLevel !== undefined) {
|
|
91
|
+
data.push({ name: d.info.customName, amount: d.batteryLevel });
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
data = data.sort((a, b) => {
|
|
@@ -226,6 +226,9 @@ class Devices {
|
|
|
226
226
|
case 'EuroHeater':
|
|
227
227
|
d = new zigbee_1.ZigbeeEuroHeater(zigbeeInfo);
|
|
228
228
|
break;
|
|
229
|
+
case 'SodaHandle':
|
|
230
|
+
d = new zigbee_1.ZigbeeSodaHandle(zigbeeInfo);
|
|
231
|
+
break;
|
|
229
232
|
default:
|
|
230
233
|
services_1.ServerLogService.writeLog(models_1.LogLevel.Warn, `No zigbee Device Type for ${zigbeeInfo.deviceType} defined`);
|
|
231
234
|
d = new zigbee_1.ZigbeeDevice(zigbeeInfo, deviceType_1.DeviceType.unknown);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { HmIpGriff } from '../hmIPDevices';
|
|
2
1
|
import { WindowPosition } from '../models';
|
|
3
2
|
import { ShutterPositionChangedAction, WindowRestoreDesiredPositionCommand, WindowSetDesiredPositionCommand } from '../../../models';
|
|
4
|
-
import { iShutter, iVibrationSensor } from '../baseDeviceInterfaces';
|
|
3
|
+
import { iHandleSensor, iShutter, iVibrationSensor } from '../baseDeviceInterfaces';
|
|
5
4
|
import { BaseGroup } from './base-group';
|
|
6
5
|
import { ZigbeeMagnetContact } from '../zigbee';
|
|
7
6
|
export declare class Window extends BaseGroup {
|
|
@@ -26,7 +25,7 @@ export declare class Window extends BaseGroup {
|
|
|
26
25
|
* @param c - The command to execute
|
|
27
26
|
*/
|
|
28
27
|
setDesiredPosition(c: WindowSetDesiredPositionCommand): void;
|
|
29
|
-
getHandle():
|
|
28
|
+
getHandle(): iHandleSensor[];
|
|
30
29
|
getMagnetContact(): ZigbeeMagnetContact[];
|
|
31
30
|
getShutter(): iShutter[];
|
|
32
31
|
getVibration(): iVibrationSensor[];
|
|
@@ -69,7 +69,7 @@ class Window extends base_group_1.BaseGroup {
|
|
|
69
69
|
initialize() {
|
|
70
70
|
this.getHandle().forEach((griff) => {
|
|
71
71
|
griff.addKippCallback((kipp) => {
|
|
72
|
-
if (!(kipp && this.griffeInPosition(models_1.WindowPosition.
|
|
72
|
+
if (!(kipp && this.griffeInPosition(models_1.WindowPosition.open) === 0)) {
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
this.getVibration().forEach((element) => {
|
|
@@ -89,8 +89,8 @@ class Window extends base_group_1.BaseGroup {
|
|
|
89
89
|
});
|
|
90
90
|
griff.addClosedCallback((geschlossen) => {
|
|
91
91
|
if (geschlossen &&
|
|
92
|
-
this.griffeInPosition(models_1.WindowPosition.
|
|
93
|
-
this.griffeInPosition(models_1.WindowPosition.
|
|
92
|
+
this.griffeInPosition(models_1.WindowPosition.open) === 0 &&
|
|
93
|
+
this.griffeInPosition(models_1.WindowPosition.tilted) === 0) {
|
|
94
94
|
const now = new Date().getTime();
|
|
95
95
|
this.getVibration().forEach((element) => {
|
|
96
96
|
this.log(models_2.LogLevel.Debug, `Starte Timeout für Vibrationsdeaktivierung für ${element.info.customName}`);
|
|
@@ -78,10 +78,10 @@ class WindowGroup extends base_group_1.BaseGroup {
|
|
|
78
78
|
if (desiredPos > 0) {
|
|
79
79
|
desiredPos = services_1.WeatherService.weatherRolloPosition(desiredPos, (_d = (_c = room.HeatGroup) === null || _c === void 0 ? void 0 : _c.desiredTemp) !== null && _d !== void 0 ? _d : -99, (_f = (_e = room.HeatGroup) === null || _e === void 0 ? void 0 : _e.temperature) !== null && _f !== void 0 ? _f : -99, this.log.bind(this), shutterSettings);
|
|
80
80
|
}
|
|
81
|
-
if (f.griffeInPosition(models_2.WindowPosition.
|
|
81
|
+
if (f.griffeInPosition(models_2.WindowPosition.open) > 0 && desiredPos < 100) {
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
|
-
if (f.griffeInPosition(models_2.WindowPosition.
|
|
84
|
+
if (f.griffeInPosition(models_2.WindowPosition.tilted) > 0) {
|
|
85
85
|
desiredPos = Math.max(30, desiredPos);
|
|
86
86
|
}
|
|
87
87
|
services_1.ShutterService.windowAllToPosition(f, new models_1.ShutterSetLevelCommand(c, desiredPos, '', true));
|
|
@@ -1,46 +1,33 @@
|
|
|
1
1
|
import { iDisposable } from '../../services';
|
|
2
2
|
import { WindowPosition } from '../models';
|
|
3
3
|
import { Window } from '../groups';
|
|
4
|
-
import { BatteryLevelChangeAction } from '../../../models';
|
|
5
|
-
import { IoBrokerBaseDevice } from '../IoBrokerBaseDevice';
|
|
6
4
|
import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
|
|
7
5
|
import { HmIPDevice } from './hmIpDevice';
|
|
8
6
|
import { iBatteryDevice, iHandleSensor } from '../baseDeviceInterfaces';
|
|
9
7
|
import { HandleSettings } from '../../../models/deviceSettings/handleSettings';
|
|
8
|
+
import { Battery, HandleSensor } from '../sharedFunctions';
|
|
10
9
|
export declare class HmIpGriff extends HmIPDevice implements iHandleSensor, iBatteryDevice, iDisposable {
|
|
10
|
+
/** @inheritDoc */
|
|
11
|
+
readonly battery: Battery;
|
|
12
|
+
/** @inheritDoc */
|
|
13
|
+
readonly handleSensor: HandleSensor;
|
|
11
14
|
/** @inheritDoc */
|
|
12
15
|
settings: HandleSettings;
|
|
13
16
|
/** @inheritDoc */
|
|
14
|
-
position: WindowPosition;
|
|
17
|
+
get position(): WindowPosition;
|
|
15
18
|
/** @inheritDoc */
|
|
16
|
-
minutesOpen: number;
|
|
17
|
-
private _battery;
|
|
18
|
-
private _lastBatteryPersist;
|
|
19
|
-
private _lastHandlePersist;
|
|
20
|
-
private _kippCallback;
|
|
21
|
-
private _closedCallback;
|
|
22
|
-
private _offenCallback;
|
|
23
|
-
private _iOpenTimeout;
|
|
24
|
-
private _window;
|
|
25
|
-
private _helpingRoomTemp;
|
|
26
|
-
private _lastBatteryLevel;
|
|
27
|
-
private _batteryLevelCallbacks;
|
|
19
|
+
get minutesOpen(): number;
|
|
28
20
|
/**
|
|
29
21
|
* Creates an instance of {@link DeviceType.HmIpGriff}.
|
|
30
22
|
* @param pInfo - Device creation information
|
|
31
23
|
*/
|
|
32
24
|
constructor(pInfo: IoBrokerDeviceInfo);
|
|
33
25
|
/** @inheritDoc */
|
|
34
|
-
get
|
|
26
|
+
get batteryLevel(): number;
|
|
27
|
+
get window(): Window | undefined;
|
|
35
28
|
/** @inheritDoc */
|
|
36
|
-
get battery(): number;
|
|
37
|
-
/**
|
|
38
|
-
* Adds a window to this device
|
|
39
|
-
*/
|
|
40
29
|
set window(value: Window);
|
|
41
30
|
/** @inheritDoc */
|
|
42
|
-
addBatteryLevelCallback(pCallback: (action: BatteryLevelChangeAction) => void): void;
|
|
43
|
-
/** @inheritDoc */
|
|
44
31
|
addOffenCallback(pCallback: (pValue: boolean) => void): void;
|
|
45
32
|
/** @inheritDoc */
|
|
46
33
|
addKippCallback(pCallback: (pValue: boolean) => void): void;
|
|
@@ -49,18 +36,5 @@ export declare class HmIpGriff extends HmIPDevice implements iHandleSensor, iBat
|
|
|
49
36
|
/** @inheritDoc */
|
|
50
37
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
51
38
|
/** @inheritDoc */
|
|
52
|
-
persistBatteryDevice(): void;
|
|
53
|
-
/**
|
|
54
|
-
* Persists the handle sensor state to the persistence layer
|
|
55
|
-
*/
|
|
56
|
-
persistHandleSensor(): void;
|
|
57
|
-
/** @inheritDoc */
|
|
58
39
|
dispose(): void;
|
|
59
|
-
/** @inheritDoc */
|
|
60
|
-
toJSON(): Partial<IoBrokerBaseDevice>;
|
|
61
|
-
private updatePosition;
|
|
62
|
-
/**
|
|
63
|
-
* Checks whether the battery level did change and if so fires the callbacks
|
|
64
|
-
*/
|
|
65
|
-
private checkForBatteryChange;
|
|
66
40
|
}
|