hoffmation-base 1.0.43 → 1.0.46
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/DeviceCapability.d.ts +17 -0
- package/lib/server/devices/DeviceCapability.js +21 -0
- package/lib/server/devices/IoBrokerBaseDevice.d.ts +4 -4
- package/lib/server/devices/baseDeviceInterfaces/iActuator.d.ts +15 -0
- package/lib/server/devices/baseDeviceInterfaces/iActuator.js +2 -0
- package/lib/server/devices/baseDeviceInterfaces/iBaseDevice.d.ts +4 -4
- package/lib/server/devices/baseDeviceInterfaces/iButtonSwitch.d.ts +2 -2
- package/lib/server/devices/baseDeviceInterfaces/iDimmableLamp.d.ts +16 -0
- package/lib/server/devices/baseDeviceInterfaces/iDimmableLamp.js +2 -0
- package/lib/server/devices/baseDeviceInterfaces/iEnergyManager.d.ts +2 -2
- package/lib/server/devices/baseDeviceInterfaces/iHandleSensor.d.ts +9 -0
- package/lib/server/devices/baseDeviceInterfaces/iHandleSensor.js +2 -0
- package/lib/server/devices/baseDeviceInterfaces/iHeater.d.ts +2 -2
- package/lib/server/devices/baseDeviceInterfaces/iHumiditySensor.d.ts +2 -2
- package/lib/server/devices/baseDeviceInterfaces/iLamp.d.ts +4 -4
- package/lib/server/devices/baseDeviceInterfaces/iMotionSensor.d.ts +2 -2
- package/lib/server/devices/baseDeviceInterfaces/iShutter.d.ts +2 -2
- package/lib/server/devices/baseDeviceInterfaces/iSpeaker.d.ts +2 -2
- package/lib/server/devices/baseDeviceInterfaces/iTemperatureSensor.d.ts +2 -2
- package/lib/server/devices/baseDeviceInterfaces/iVibrationSensor.d.ts +2 -2
- package/lib/server/devices/baseDeviceInterfaces/index.d.ts +2 -0
- package/lib/server/devices/baseDeviceInterfaces/index.js +2 -0
- package/lib/server/devices/device-cluster.d.ts +4 -4
- package/lib/server/devices/device-list.d.ts +2 -2
- package/lib/server/devices/deviceUpdater.js +2 -1
- package/lib/server/devices/devices.d.ts +2 -2
- package/lib/server/devices/groups/lampenGroup.d.ts +3 -3
- package/lib/server/devices/groups/lampenGroup.js +3 -3
- package/lib/server/devices/hmIPDevices/hmIpBewegung.js +3 -3
- package/lib/server/devices/hmIPDevices/hmIpGriff.d.ts +4 -3
- package/lib/server/devices/hmIPDevices/hmIpGriff.js +1 -1
- package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.js +4 -4
- package/lib/server/devices/hmIPDevices/hmIpLampe.js +2 -2
- package/lib/server/devices/hmIPDevices/hmIpPraezenz.js +2 -2
- package/lib/server/devices/hmIPDevices/hmIpRoll.js +2 -2
- package/lib/server/devices/hmIPDevices/hmIpTaster.js +2 -2
- package/lib/server/devices/hmIPDevices/hmIpWippe.js +2 -2
- package/lib/server/devices/jsObject/jsObjectEnergyManager.js +2 -2
- package/lib/server/devices/zigbee/BaseDevices/ZigbeeActuator.d.ts +4 -3
- package/lib/server/devices/zigbee/BaseDevices/ZigbeeActuator.js +2 -0
- package/lib/server/devices/zigbee/BaseDevices/zigbeeHeater.js +2 -2
- package/lib/server/devices/zigbee/BaseDevices/zigbeeMotionSensor.js +2 -2
- package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.js +2 -2
- package/lib/server/devices/zigbee/zigbeeAquaraMotion.js +2 -2
- package/lib/server/devices/zigbee/zigbeeAquaraVibra.js +2 -2
- package/lib/server/devices/zigbee/zigbeeBlitzShp.js +2 -2
- package/lib/server/devices/zigbee/zigbeeIkeaSteckdose.d.ts +0 -3
- package/lib/server/devices/zigbee/zigbeeIkeaSteckdose.js +0 -9
- package/lib/server/devices/zigbee/zigbeeIlluDimmer.d.ts +2 -2
- package/lib/server/devices/zigbee/zigbeeIlluDimmer.js +3 -2
- package/lib/server/devices/zigbee/zigbeeIlluLampe.js +2 -2
- package/lib/server/devices/zigbee/zigbeeSonoffTemp.js +3 -3
- package/lib/server/services/Sonos/own-sonos-device.d.ts +2 -2
- package/lib/server/services/Sonos/own-sonos-device.js +2 -2
- package/lib/server/services/ac/ac-device.d.ts +4 -4
- package/lib/server/services/ac/ac-device.js +2 -2
- package/lib/server/services/api/api-service.d.ts +22 -4
- package/lib/server/services/api/api-service.js +57 -4
- package/lib/server/services/room-service/room-service.d.ts +3 -2
- package/lib/server/services/room-service/room-service.js +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/lib/server/devices/DeviceCapabilities.d.ts +0 -15
- package/lib/server/devices/DeviceCapabilities.js +0 -19
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare enum DeviceCapability {
|
|
2
|
+
ac = 0,
|
|
3
|
+
actuator = 1,
|
|
4
|
+
buttonSwitch = 2,
|
|
5
|
+
energyManager = 3,
|
|
6
|
+
excessEnergyConsumer = 4,
|
|
7
|
+
heater = 5,
|
|
8
|
+
humiditySensor = 6,
|
|
9
|
+
illuminationSensor = 7,
|
|
10
|
+
lamp = 8,
|
|
11
|
+
dimmablelamp = 9,
|
|
12
|
+
motionSensor = 10,
|
|
13
|
+
shutter = 11,
|
|
14
|
+
temperatureSensor = 12,
|
|
15
|
+
vibrationSensor = 13,
|
|
16
|
+
speaker = 14
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeviceCapability = void 0;
|
|
4
|
+
var DeviceCapability;
|
|
5
|
+
(function (DeviceCapability) {
|
|
6
|
+
DeviceCapability[DeviceCapability["ac"] = 0] = "ac";
|
|
7
|
+
DeviceCapability[DeviceCapability["actuator"] = 1] = "actuator";
|
|
8
|
+
DeviceCapability[DeviceCapability["buttonSwitch"] = 2] = "buttonSwitch";
|
|
9
|
+
DeviceCapability[DeviceCapability["energyManager"] = 3] = "energyManager";
|
|
10
|
+
DeviceCapability[DeviceCapability["excessEnergyConsumer"] = 4] = "excessEnergyConsumer";
|
|
11
|
+
DeviceCapability[DeviceCapability["heater"] = 5] = "heater";
|
|
12
|
+
DeviceCapability[DeviceCapability["humiditySensor"] = 6] = "humiditySensor";
|
|
13
|
+
DeviceCapability[DeviceCapability["illuminationSensor"] = 7] = "illuminationSensor";
|
|
14
|
+
DeviceCapability[DeviceCapability["lamp"] = 8] = "lamp";
|
|
15
|
+
DeviceCapability[DeviceCapability["dimmablelamp"] = 9] = "dimmablelamp";
|
|
16
|
+
DeviceCapability[DeviceCapability["motionSensor"] = 10] = "motionSensor";
|
|
17
|
+
DeviceCapability[DeviceCapability["shutter"] = 11] = "shutter";
|
|
18
|
+
DeviceCapability[DeviceCapability["temperatureSensor"] = 12] = "temperatureSensor";
|
|
19
|
+
DeviceCapability[DeviceCapability["vibrationSensor"] = 13] = "vibrationSensor";
|
|
20
|
+
DeviceCapability[DeviceCapability["speaker"] = 14] = "speaker";
|
|
21
|
+
})(DeviceCapability = exports.DeviceCapability || (exports.DeviceCapability = {}));
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="iobroker" />
|
|
2
|
-
import {
|
|
2
|
+
import { iBaseDevice } from './baseDeviceInterfaces';
|
|
3
3
|
import { LogDebugType } from '../services';
|
|
4
4
|
import { LogLevel, RoomBase, RoomDeviceAddingSettings } from '../../models';
|
|
5
5
|
import { IOBrokerConnection } from '../ioBroker';
|
|
6
6
|
import { DeviceType } from './deviceType';
|
|
7
7
|
import { IoBrokerDeviceInfo } from './IoBrokerDeviceInfo';
|
|
8
|
-
import {
|
|
9
|
-
export declare abstract class IoBrokerBaseDevice implements
|
|
8
|
+
import { DeviceCapability } from './DeviceCapability';
|
|
9
|
+
export declare abstract class IoBrokerBaseDevice implements iBaseDevice {
|
|
10
10
|
protected _info: IoBrokerDeviceInfo;
|
|
11
11
|
deviceType: DeviceType;
|
|
12
12
|
static roomAddingSettings: {
|
|
@@ -14,7 +14,7 @@ export declare abstract class IoBrokerBaseDevice implements IBaseDevice {
|
|
|
14
14
|
};
|
|
15
15
|
room: RoomBase | undefined;
|
|
16
16
|
battery: number | undefined;
|
|
17
|
-
readonly deviceCapabilities:
|
|
17
|
+
readonly deviceCapabilities: DeviceCapability[];
|
|
18
18
|
protected constructor(_info: IoBrokerDeviceInfo, deviceType: DeviceType);
|
|
19
19
|
get id(): string;
|
|
20
20
|
/**
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ActuatorSettings } from '../../../models';
|
|
2
|
+
import { iBaseDevice } from './iBaseDevice';
|
|
3
|
+
export interface iActuator extends iBaseDevice {
|
|
4
|
+
settings: ActuatorSettings;
|
|
5
|
+
actuatorOn: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Controls the power state of this actuator
|
|
8
|
+
* @param {boolean} pValue the new desired State
|
|
9
|
+
* @param {number} timeout if positive the time in ms, after which state should reset
|
|
10
|
+
* @param {boolean} force if true, this command isn't overwritten by automatic actions
|
|
11
|
+
* Accessible in API
|
|
12
|
+
*/
|
|
13
|
+
setActuator(pValue: boolean, timeout?: number, force?: boolean): void;
|
|
14
|
+
toggleActuator(force: boolean): boolean;
|
|
15
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { LogLevel, RoomBase } from '../../../models';
|
|
2
2
|
import { DeviceType } from '../deviceType';
|
|
3
3
|
import { DeviceInfo } from '../DeviceInfo';
|
|
4
|
-
import {
|
|
5
|
-
export interface
|
|
4
|
+
import { DeviceCapability } from '../DeviceCapability';
|
|
5
|
+
export interface iBaseDevice {
|
|
6
6
|
room: RoomBase | undefined;
|
|
7
7
|
deviceType: DeviceType;
|
|
8
8
|
info: DeviceInfo;
|
|
9
|
-
readonly deviceCapabilities:
|
|
9
|
+
readonly deviceCapabilities: DeviceCapability[];
|
|
10
10
|
readonly id: string;
|
|
11
11
|
log(level: LogLevel, message: string): void;
|
|
12
|
-
toJSON(): Partial<
|
|
12
|
+
toJSON(): Partial<iBaseDevice>;
|
|
13
13
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Button } from '../button';
|
|
2
|
-
import {
|
|
3
|
-
export interface iButtonSwitch extends
|
|
2
|
+
import { iBaseDevice } from './iBaseDevice';
|
|
3
|
+
export interface iButtonSwitch extends iBaseDevice {
|
|
4
4
|
buttonTopLeft: Button | undefined;
|
|
5
5
|
buttonTopRight: Button | undefined;
|
|
6
6
|
buttonMidLeft: Button | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { iLamp } from './iLamp';
|
|
2
|
+
import { DimmerSettings, TimeOfDay } from '../../../models';
|
|
3
|
+
export interface iDimmableLamp extends iLamp {
|
|
4
|
+
settings: DimmerSettings;
|
|
5
|
+
toggleLight(time: TimeOfDay, force: boolean, calculateTime: boolean): void;
|
|
6
|
+
/**
|
|
7
|
+
* This function sets the light to a specific value
|
|
8
|
+
* @param pValue The desired value
|
|
9
|
+
* @param timeout A chosen Timeout after which the light should be reset
|
|
10
|
+
* @param force Wether it is a action based on a user action, to override certain rules
|
|
11
|
+
* @param brightness The desired brightness
|
|
12
|
+
* @param transitionTime The transition time during turnOn/turnOff
|
|
13
|
+
* Accessible in API
|
|
14
|
+
*/
|
|
15
|
+
setLight(pValue: boolean, timeout?: number, force?: boolean, brightness?: number, transitionTime?: number): void;
|
|
16
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { iExcessEnergyConsumer } from './iExcessEnergyConsumer';
|
|
2
|
-
import {
|
|
2
|
+
import { iBaseDevice } from './iBaseDevice';
|
|
3
3
|
export declare class PhaseState {
|
|
4
4
|
private readonly _meterValue;
|
|
5
5
|
private readonly _production;
|
|
@@ -13,7 +13,7 @@ export declare class PhaseState {
|
|
|
13
13
|
get injectingWattage(): number;
|
|
14
14
|
get totalConsumptionWattage(): number;
|
|
15
15
|
}
|
|
16
|
-
export interface iEnergyManager extends
|
|
16
|
+
export interface iEnergyManager extends iBaseDevice {
|
|
17
17
|
baseConsumption: number;
|
|
18
18
|
currentProduction: number;
|
|
19
19
|
excessEnergy: number;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FensterPosition } from '../models';
|
|
2
|
+
import { iBaseDevice } from './iBaseDevice';
|
|
3
|
+
export interface iHandleSensor extends iBaseDevice {
|
|
4
|
+
position: FensterPosition;
|
|
5
|
+
minutesOpen: number;
|
|
6
|
+
addOffenCallback(pCallback: (pValue: boolean) => void): void;
|
|
7
|
+
addKippCallback(pCallback: (pValue: boolean) => void): void;
|
|
8
|
+
addClosedCallback(pCallback: (pValue: boolean) => void): void;
|
|
9
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HeaterSettings, TemperatureSettings } from '../../../models';
|
|
2
|
-
import {
|
|
3
|
-
export interface iHeater extends
|
|
2
|
+
import { iBaseDevice } from './iBaseDevice';
|
|
3
|
+
export interface iHeater extends iBaseDevice {
|
|
4
4
|
settings: HeaterSettings;
|
|
5
5
|
readonly desiredTemperature: number;
|
|
6
6
|
readonly humidity: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { iBaseDevice } from './iBaseDevice';
|
|
2
2
|
export declare const UNDEFINED_HUMIDITY_VALUE = -1;
|
|
3
|
-
export interface iHumiditySensor extends
|
|
3
|
+
export interface iHumiditySensor extends iBaseDevice {
|
|
4
4
|
humidity: number;
|
|
5
5
|
addHumidityCallback(pCallback: (pValue: number) => void): void;
|
|
6
6
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { ActuatorSettings,
|
|
2
|
-
import {
|
|
3
|
-
export interface iLamp extends
|
|
1
|
+
import { ActuatorSettings, TimeOfDay } from '../../../models';
|
|
2
|
+
import { iBaseDevice } from './iBaseDevice';
|
|
3
|
+
export interface iLamp extends iBaseDevice {
|
|
4
4
|
settings: ActuatorSettings;
|
|
5
5
|
lightOn: boolean;
|
|
6
|
-
room: RoomBase | undefined;
|
|
7
6
|
setTimeBased(time: TimeOfDay, timeout: number, force: boolean): void;
|
|
8
7
|
toggleLight(time: TimeOfDay, force: boolean, calculateTime: boolean): void;
|
|
9
8
|
/**
|
|
@@ -11,6 +10,7 @@ export interface iLamp extends IBaseDevice {
|
|
|
11
10
|
* @param pValue The desired value
|
|
12
11
|
* @param timeout A chosen Timeout after which the light should be reset
|
|
13
12
|
* @param force Wether it is a action based on a user action, to override certain rules
|
|
13
|
+
* Accessible in API
|
|
14
14
|
*/
|
|
15
15
|
setLight(pValue: boolean, timeout: number, force: boolean): void;
|
|
16
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MotionSensorSettings } from '../../../models';
|
|
2
|
-
import {
|
|
3
|
-
export interface iMotionSensor extends
|
|
2
|
+
import { iBaseDevice } from './iBaseDevice';
|
|
3
|
+
export interface iMotionSensor extends iBaseDevice {
|
|
4
4
|
settings: MotionSensorSettings;
|
|
5
5
|
movementDetected: boolean;
|
|
6
6
|
readonly timeSinceLastMotion: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fenster } from '../groups';
|
|
2
|
-
import {
|
|
3
|
-
export interface iShutter extends
|
|
2
|
+
import { iBaseDevice } from './iBaseDevice';
|
|
3
|
+
export interface iShutter extends iBaseDevice {
|
|
4
4
|
currentLevel: number;
|
|
5
5
|
desiredFensterLevel: number;
|
|
6
6
|
fenster: Fenster | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface ISpeaker extends
|
|
1
|
+
import { iBaseDevice } from './iBaseDevice';
|
|
2
|
+
export interface ISpeaker extends iBaseDevice {
|
|
3
3
|
playOnDevice(mp3Name: string, duration: number, volume?: number, onlyWhenPlaying?: boolean, resolveAfterRevert?: boolean): void;
|
|
4
4
|
playTestMessage(): void;
|
|
5
5
|
playUrl(url: string): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { iBaseDevice } from './iBaseDevice';
|
|
2
2
|
export declare const UNDEFINED_TEMP_VALUE = -99;
|
|
3
|
-
export interface iTemperatureSensor extends
|
|
3
|
+
export interface iTemperatureSensor extends iBaseDevice {
|
|
4
4
|
iTemperature: number;
|
|
5
5
|
sTemperature: string;
|
|
6
6
|
addTempChangeCallback(pCallback: (pValue: number) => void): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface iVibrationSensor extends
|
|
1
|
+
import { iBaseDevice } from './iBaseDevice';
|
|
2
|
+
export interface iVibrationSensor extends iBaseDevice {
|
|
3
3
|
vibrationBlockedByGriff: boolean;
|
|
4
4
|
vibrationBlockedByGriffTimeStamp: number;
|
|
5
5
|
vibrationBlockedByMotion: boolean;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export * from './iAcDevice';
|
|
2
|
+
export * from './iActuator';
|
|
2
3
|
export * from './iBaseDevice';
|
|
3
4
|
export * from './iButtonSwitch';
|
|
4
5
|
export * from './iEnergyManager';
|
|
5
6
|
export * from './iExcessEnergyConsumer';
|
|
7
|
+
export * from './iHandleSensor';
|
|
6
8
|
export * from './iHeater';
|
|
7
9
|
export * from './iHumiditySensor';
|
|
8
10
|
export * from './iIlluminationSensor';
|
|
@@ -15,10 +15,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./iAcDevice"), exports);
|
|
18
|
+
__exportStar(require("./iActuator"), exports);
|
|
18
19
|
__exportStar(require("./iBaseDevice"), exports);
|
|
19
20
|
__exportStar(require("./iButtonSwitch"), exports);
|
|
20
21
|
__exportStar(require("./iEnergyManager"), exports);
|
|
21
22
|
__exportStar(require("./iExcessEnergyConsumer"), exports);
|
|
23
|
+
__exportStar(require("./iHandleSensor"), exports);
|
|
22
24
|
__exportStar(require("./iHeater"), exports);
|
|
23
25
|
__exportStar(require("./iHumiditySensor"), exports);
|
|
24
26
|
__exportStar(require("./iIlluminationSensor"), exports);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { DeviceClusterType } from './device-cluster-type';
|
|
2
2
|
import { DeviceList } from './device-list';
|
|
3
3
|
import { IoBrokerBaseDevice } from './IoBrokerBaseDevice';
|
|
4
|
-
import {
|
|
4
|
+
import { iBaseDevice } from './baseDeviceInterfaces';
|
|
5
5
|
export declare class DeviceCluster {
|
|
6
6
|
deviceMap: Map<DeviceClusterType, DeviceList>;
|
|
7
7
|
constructor(deviceMap?: Map<DeviceClusterType, DeviceList>);
|
|
8
8
|
getIoBrokerDevicesByType(type: DeviceClusterType): IoBrokerBaseDevice[];
|
|
9
|
-
getDevicesByType(type: DeviceClusterType): Array<
|
|
10
|
-
addByDeviceType(device:
|
|
11
|
-
addToList(type: DeviceClusterType, device:
|
|
9
|
+
getDevicesByType(type: DeviceClusterType): Array<iBaseDevice>;
|
|
10
|
+
addByDeviceType(device: iBaseDevice): void;
|
|
11
|
+
addToList(type: DeviceClusterType, device: iBaseDevice): void;
|
|
12
12
|
toJSON(): Partial<DeviceCluster & {
|
|
13
13
|
deviceDict?: {
|
|
14
14
|
[p: string]: DeviceList;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { iBaseDevice } from './baseDeviceInterfaces';
|
|
2
2
|
export declare class DeviceList {
|
|
3
3
|
private _ids;
|
|
4
4
|
constructor(_ids?: string[]);
|
|
5
5
|
get ids(): string[];
|
|
6
|
-
getDevices(): Array<
|
|
6
|
+
getDevices(): Array<iBaseDevice>;
|
|
7
7
|
}
|
|
@@ -17,6 +17,7 @@ class DeviceUpdater {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
updateState(id, state, initial = false) {
|
|
20
|
+
var _a;
|
|
20
21
|
if (state === null) {
|
|
21
22
|
// Ignore null states
|
|
22
23
|
return;
|
|
@@ -32,7 +33,7 @@ class DeviceUpdater {
|
|
|
32
33
|
device.update(idSplit, state, initial, false);
|
|
33
34
|
}
|
|
34
35
|
catch (e) {
|
|
35
|
-
services_1.ServerLogService.writeLog(models_1.LogLevel.Alert, `deviceUpdater.updateState('${id}', '${state}'): Error occured updating Device: ${e} \n ${e.stack}`);
|
|
36
|
+
services_1.ServerLogService.writeLog(models_1.LogLevel.Alert, `deviceUpdater.updateState('${id}', '${state}'): Error occured updating Device: ${e} \n ${(_a = e === null || e === void 0 ? void 0 : e.stack) !== null && _a !== void 0 ? _a : ''}`);
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { deviceConfig, iRoomImportEnforcer } from '../../models';
|
|
2
|
-
import {
|
|
2
|
+
import { iBaseDevice, iEnergyManager } from './baseDeviceInterfaces';
|
|
3
3
|
export declare class Devices {
|
|
4
4
|
static IDENTIFIER_HOMEMATIC: string;
|
|
5
5
|
static IDENTIFIER_JS: string;
|
|
6
6
|
static IDENTIFIER_ZIGBEE: string;
|
|
7
7
|
static IDENTIFIER_WLED: string;
|
|
8
8
|
static alLDevices: {
|
|
9
|
-
[id: string]:
|
|
9
|
+
[id: string]: iBaseDevice;
|
|
10
10
|
};
|
|
11
11
|
static energymanager?: iEnergyManager;
|
|
12
12
|
constructor(pDeviceData: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ZigbeeIlluLedRGBCCT } from '../zigbee';
|
|
2
2
|
import { BaseGroup } from './base-group';
|
|
3
|
-
import { iLamp } from '../baseDeviceInterfaces';
|
|
3
|
+
import { iActuator, iLamp } from '../baseDeviceInterfaces';
|
|
4
4
|
import { TimeOfDay } from '../../../models';
|
|
5
5
|
import { WledDevice } from '../wledDevice';
|
|
6
6
|
export declare class LampenGroup extends BaseGroup {
|
|
@@ -9,7 +9,7 @@ export declare class LampenGroup extends BaseGroup {
|
|
|
9
9
|
getLampen(): iLamp[];
|
|
10
10
|
getLED(): ZigbeeIlluLedRGBCCT[];
|
|
11
11
|
getWled(): WledDevice[];
|
|
12
|
-
getStecker():
|
|
12
|
+
getStecker(): iActuator[];
|
|
13
13
|
handleSunriseOff(): void;
|
|
14
14
|
switchAll(target: boolean, force?: boolean): void;
|
|
15
15
|
switchTimeConditional(time: TimeOfDay): void;
|
|
@@ -28,7 +28,7 @@ class LampenGroup extends base_group_1.BaseGroup {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
for (i = 0; i < this.getStecker().length; i++) {
|
|
31
|
-
if (this.getStecker()[i].
|
|
31
|
+
if (this.getStecker()[i].actuatorOn) {
|
|
32
32
|
return true;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -49,7 +49,7 @@ class LampenGroup extends base_group_1.BaseGroup {
|
|
|
49
49
|
return this.deviceCluster.getIoBrokerDevicesByType(device_cluster_type_1.DeviceClusterType.WLED);
|
|
50
50
|
}
|
|
51
51
|
getStecker() {
|
|
52
|
-
return this.deviceCluster.
|
|
52
|
+
return this.deviceCluster.getDevicesByType(device_cluster_type_1.DeviceClusterType.Outlets);
|
|
53
53
|
}
|
|
54
54
|
handleSunriseOff() {
|
|
55
55
|
if (!this.anyLightsOn()) {
|
|
@@ -120,7 +120,7 @@ class LampenGroup extends base_group_1.BaseGroup {
|
|
|
120
120
|
(time === models_1.TimeOfDay.BeforeSunrise && s.settings.dawnOn) ||
|
|
121
121
|
(time === models_1.TimeOfDay.AfterSunset && s.settings.duskOn)) {
|
|
122
122
|
const timeout = pValue && force ? 30 * 60 * 1000 : -1;
|
|
123
|
-
s.
|
|
123
|
+
s.setActuator(pValue, timeout, force);
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
126
|
}
|
|
@@ -5,7 +5,7 @@ const hmIpDevice_1 = require("./hmIpDevice");
|
|
|
5
5
|
const deviceType_1 = require("../deviceType");
|
|
6
6
|
const models_1 = require("../../../models");
|
|
7
7
|
const services_1 = require("../../services");
|
|
8
|
-
const
|
|
8
|
+
const DeviceCapability_1 = require("../DeviceCapability");
|
|
9
9
|
class HmIpBewegung extends hmIpDevice_1.HmIPDevice {
|
|
10
10
|
constructor(pInfo) {
|
|
11
11
|
var _a;
|
|
@@ -17,8 +17,8 @@ class HmIpBewegung extends hmIpDevice_1.HmIPDevice {
|
|
|
17
17
|
this._lastMotionTime = 0;
|
|
18
18
|
this._detectionsToday = 0;
|
|
19
19
|
this._currentIllumination = -1;
|
|
20
|
-
this.deviceCapabilities.push(
|
|
21
|
-
this.deviceCapabilities.push(
|
|
20
|
+
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.motionSensor);
|
|
21
|
+
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.illuminationSensor);
|
|
22
22
|
(_a = services_1.Utils.dbo) === null || _a === void 0 ? void 0 : _a.getCount(this).then((todayCount) => {
|
|
23
23
|
this.detectionsToday = todayCount.counter;
|
|
24
24
|
this.log(models_1.LogLevel.Debug, `Bewegungscounter vorinitialisiert mit ${this.detectionsToday}`);
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/// <reference types="iobroker" />
|
|
2
|
-
import { HmIPDevice } from './hmIpDevice';
|
|
3
2
|
import { FensterPosition } from '../models';
|
|
4
3
|
import { Fenster } from '../groups';
|
|
5
4
|
import { IoBrokerBaseDevice } from '../IoBrokerBaseDevice';
|
|
6
5
|
import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
|
|
7
|
-
|
|
6
|
+
import { HmIPDevice } from './hmIpDevice';
|
|
7
|
+
import { iHandleSensor } from '../baseDeviceInterfaces';
|
|
8
|
+
export declare class HmIpGriff extends HmIPDevice implements iHandleSensor {
|
|
8
9
|
position: FensterPosition;
|
|
9
10
|
private _kippCallback;
|
|
10
11
|
private _closedCallback;
|
|
11
12
|
private _offenCallback;
|
|
12
13
|
private _iOpenTimeout;
|
|
13
|
-
|
|
14
|
+
minutesOpen: number;
|
|
14
15
|
private _fenster;
|
|
15
16
|
private _helpingRoomTemp;
|
|
16
17
|
constructor(pInfo: IoBrokerDeviceInfo);
|
|
@@ -4,12 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.HmIpGriff = void 0;
|
|
7
|
-
const hmIpDevice_1 = require("./hmIpDevice");
|
|
8
7
|
const deviceType_1 = require("../deviceType");
|
|
9
8
|
const services_1 = require("../../services");
|
|
10
9
|
const models_1 = require("../models");
|
|
11
10
|
const models_2 = require("../../../models");
|
|
12
11
|
const lodash_1 = __importDefault(require("lodash"));
|
|
12
|
+
const hmIpDevice_1 = require("./hmIpDevice");
|
|
13
13
|
class HmIpGriff extends hmIpDevice_1.HmIPDevice {
|
|
14
14
|
constructor(pInfo) {
|
|
15
15
|
super(pInfo, deviceType_1.DeviceType.HmIpGriff);
|
|
@@ -7,7 +7,7 @@ const services_1 = require("../../services");
|
|
|
7
7
|
const models_1 = require("../../../models");
|
|
8
8
|
const baseDeviceInterfaces_1 = require("../baseDeviceInterfaces");
|
|
9
9
|
const device_cluster_type_1 = require("../device-cluster-type");
|
|
10
|
-
const
|
|
10
|
+
const DeviceCapability_1 = require("../DeviceCapability");
|
|
11
11
|
class HmIpHeizgruppe extends hmIpDevice_1.HmIPDevice {
|
|
12
12
|
constructor(pInfo) {
|
|
13
13
|
super(pInfo, deviceType_1.DeviceType.HmIpHeizgruppe);
|
|
@@ -23,9 +23,9 @@ class HmIpHeizgruppe extends hmIpDevice_1.HmIPDevice {
|
|
|
23
23
|
this._humidity = baseDeviceInterfaces_1.UNDEFINED_HUMIDITY_VALUE;
|
|
24
24
|
this._desiredTemperature = 0;
|
|
25
25
|
this._roomTemperatur = baseDeviceInterfaces_1.UNDEFINED_TEMP_VALUE;
|
|
26
|
-
this.deviceCapabilities.push(
|
|
27
|
-
this.deviceCapabilities.push(
|
|
28
|
-
this.deviceCapabilities.push(
|
|
26
|
+
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.temperatureSensor);
|
|
27
|
+
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.humiditySensor);
|
|
28
|
+
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.heater);
|
|
29
29
|
this._setPointTemperatureID = `${this.info.fullID}.1.SET_POINT_TEMPERATURE`;
|
|
30
30
|
this._iAutomaticInterval = services_1.Utils.guardedInterval(this.checkAutomaticChange, 300000, this); // Alle 5 Minuten prüfen
|
|
31
31
|
services_1.TimeCallbackService.addCallback(new models_1.TimeCallback(`${this.info.fullID} Season Check`, models_1.TimeCallbackType.TimeOfDay, () => {
|
|
@@ -5,7 +5,7 @@ const hmIpDevice_1 = require("./hmIpDevice");
|
|
|
5
5
|
const deviceType_1 = require("../deviceType");
|
|
6
6
|
const services_1 = require("../../services");
|
|
7
7
|
const models_1 = require("../../../models");
|
|
8
|
-
const
|
|
8
|
+
const DeviceCapability_1 = require("../DeviceCapability");
|
|
9
9
|
class HmIpLampe extends hmIpDevice_1.HmIPDevice {
|
|
10
10
|
constructor(pInfo) {
|
|
11
11
|
super(pInfo, deviceType_1.DeviceType.HmIpLampe);
|
|
@@ -15,7 +15,7 @@ class HmIpLampe extends hmIpDevice_1.HmIPDevice {
|
|
|
15
15
|
this.lightOnSwitchID = '';
|
|
16
16
|
this._turnOffTimeout = undefined;
|
|
17
17
|
this.turnOffTime = 0;
|
|
18
|
-
this.deviceCapabilities.push(
|
|
18
|
+
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.lamp);
|
|
19
19
|
this.lightOnSwitchID = `${this.info.fullID}.2.STATE`;
|
|
20
20
|
}
|
|
21
21
|
update(idSplit, state, initial = false) {
|
|
@@ -5,7 +5,7 @@ const hmIpDevice_1 = require("./hmIpDevice");
|
|
|
5
5
|
const deviceType_1 = require("../deviceType");
|
|
6
6
|
const models_1 = require("../../../models");
|
|
7
7
|
const services_1 = require("../../services");
|
|
8
|
-
const
|
|
8
|
+
const DeviceCapability_1 = require("../DeviceCapability");
|
|
9
9
|
class HmIpPraezenz extends hmIpDevice_1.HmIPDevice {
|
|
10
10
|
constructor(pInfo) {
|
|
11
11
|
var _a;
|
|
@@ -17,7 +17,7 @@ class HmIpPraezenz extends hmIpDevice_1.HmIPDevice {
|
|
|
17
17
|
this.initialized = false;
|
|
18
18
|
this._detectionsToday = 0;
|
|
19
19
|
this._currentIllumination = -1;
|
|
20
|
-
this.deviceCapabilities.push(
|
|
20
|
+
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.illuminationSensor);
|
|
21
21
|
// this.presenceStateID = `${this.info.fullID}.1.${HmIpPraezenz.PRESENCE_DETECTION}`;
|
|
22
22
|
(_a = services_1.Utils.dbo) === null || _a === void 0 ? void 0 : _a.getCount(this).then((todayCount) => {
|
|
23
23
|
this.detectionsToday = todayCount.counter;
|
|
@@ -10,7 +10,7 @@ const services_1 = require("../../services");
|
|
|
10
10
|
const models_1 = require("../models");
|
|
11
11
|
const models_2 = require("../../../models");
|
|
12
12
|
const lodash_1 = __importDefault(require("lodash"));
|
|
13
|
-
const
|
|
13
|
+
const DeviceCapability_1 = require("../DeviceCapability");
|
|
14
14
|
class HmIpRoll extends hmIpDevice_1.HmIPDevice {
|
|
15
15
|
constructor(pInfo) {
|
|
16
16
|
super(pInfo, deviceType_1.DeviceType.HmIpRoll);
|
|
@@ -18,7 +18,7 @@ class HmIpRoll extends hmIpDevice_1.HmIPDevice {
|
|
|
18
18
|
this._setLevel = -1;
|
|
19
19
|
this._setLevelTime = -1;
|
|
20
20
|
this._currentLevel = -1;
|
|
21
|
-
this.deviceCapabilities.push(
|
|
21
|
+
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.shutter);
|
|
22
22
|
this._setLevelSwitchID = `${this.info.fullID}.4.LEVEL`;
|
|
23
23
|
}
|
|
24
24
|
get currentLevel() {
|
|
@@ -5,7 +5,7 @@ const hmIpDevice_1 = require("./hmIpDevice");
|
|
|
5
5
|
const deviceType_1 = require("../deviceType");
|
|
6
6
|
const button_1 = require("../button");
|
|
7
7
|
const models_1 = require("../../../models");
|
|
8
|
-
const
|
|
8
|
+
const DeviceCapability_1 = require("../DeviceCapability");
|
|
9
9
|
class HmIpTaster extends hmIpDevice_1.HmIPDevice {
|
|
10
10
|
constructor(pInfo) {
|
|
11
11
|
super(pInfo, deviceType_1.DeviceType.HmIpTaster);
|
|
@@ -17,7 +17,7 @@ class HmIpTaster extends hmIpDevice_1.HmIPDevice {
|
|
|
17
17
|
this.buttonBotRight = new button_1.Button('BotRight', HmIpTaster.BUTTON_CAPABILLITIES);
|
|
18
18
|
this.buttonBot = undefined;
|
|
19
19
|
this.buttonTop = undefined;
|
|
20
|
-
this.deviceCapabilities.push(
|
|
20
|
+
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.buttonSwitch);
|
|
21
21
|
}
|
|
22
22
|
update(idSplit, state, initial = false) {
|
|
23
23
|
this.log(models_1.LogLevel.DeepTrace, `Taster Update: JSON: ${JSON.stringify(state)}ID: ${idSplit.join('.')}`);
|
|
@@ -5,13 +5,13 @@ const hmIpDevice_1 = require("./hmIpDevice");
|
|
|
5
5
|
const deviceType_1 = require("../deviceType");
|
|
6
6
|
const button_1 = require("../button");
|
|
7
7
|
const models_1 = require("../../../models");
|
|
8
|
-
const
|
|
8
|
+
const DeviceCapability_1 = require("../DeviceCapability");
|
|
9
9
|
class HmIpWippe extends hmIpDevice_1.HmIPDevice {
|
|
10
10
|
constructor(pInfo) {
|
|
11
11
|
super(pInfo, deviceType_1.DeviceType.HmIpWippe);
|
|
12
12
|
this.buttonBot = new button_1.Button('Bottom', HmIpWippe.BUTTON_CAPABILLITIES);
|
|
13
13
|
this.buttonTop = new button_1.Button('Top', HmIpWippe.BUTTON_CAPABILLITIES);
|
|
14
|
-
this.deviceCapabilities.push(
|
|
14
|
+
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.buttonSwitch);
|
|
15
15
|
}
|
|
16
16
|
update(idSplit, state, initial = false) {
|
|
17
17
|
this.log(models_1.LogLevel.DeepTrace, `Wippe Update: JSON: ${JSON.stringify(state)}ID: ${idSplit.join('.')}`);
|
|
@@ -6,7 +6,7 @@ const baseDeviceInterfaces_1 = require("../baseDeviceInterfaces");
|
|
|
6
6
|
const deviceType_1 = require("../deviceType");
|
|
7
7
|
const models_1 = require("../../../models");
|
|
8
8
|
const services_1 = require("../../services");
|
|
9
|
-
const
|
|
9
|
+
const DeviceCapability_1 = require("../DeviceCapability");
|
|
10
10
|
class JsObjectEnergyManager extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
|
|
11
11
|
constructor(info) {
|
|
12
12
|
super(info, deviceType_1.DeviceType.JsEnergyManager);
|
|
@@ -23,7 +23,7 @@ class JsObjectEnergyManager extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
|
|
|
23
23
|
this._phaseAState = new baseDeviceInterfaces_1.PhaseState(0, 0);
|
|
24
24
|
this._phaseBState = new baseDeviceInterfaces_1.PhaseState(0, 0);
|
|
25
25
|
this._phaseCState = new baseDeviceInterfaces_1.PhaseState(0, 0);
|
|
26
|
-
this.deviceCapabilities.push(
|
|
26
|
+
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.energyManager);
|
|
27
27
|
this.log(models_1.LogLevel.Info, `Creating Energy Manager Device`);
|
|
28
28
|
this._iCalculationInterval = services_1.Utils.guardedInterval(() => {
|
|
29
29
|
this.calculateExcessEnergy();
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/// <reference types="iobroker" />
|
|
2
2
|
import { ActuatorSettings } from '../../../../models';
|
|
3
|
-
import { ZigbeeDevice } from './zigbeeDevice';
|
|
4
3
|
import { DeviceType } from '../../deviceType';
|
|
5
4
|
import { IoBrokerDeviceInfo } from '../../IoBrokerDeviceInfo';
|
|
6
|
-
|
|
5
|
+
import { iActuator } from '../../baseDeviceInterfaces';
|
|
6
|
+
import { ZigbeeDevice } from './zigbeeDevice';
|
|
7
|
+
export declare class ZigbeeActuator extends ZigbeeDevice implements iActuator {
|
|
7
8
|
settings: ActuatorSettings;
|
|
8
9
|
protected readonly actuatorOnSwitchID: string;
|
|
9
10
|
protected queuedValue: boolean | null;
|
|
10
|
-
|
|
11
|
+
actuatorOn: boolean;
|
|
11
12
|
private _turnOffTimeout;
|
|
12
13
|
private turnOffTime;
|
|
13
14
|
constructor(pInfo: IoBrokerDeviceInfo, type: DeviceType, actuatorOnSwitchID: string);
|
|
@@ -4,6 +4,7 @@ exports.ZigbeeActuator = void 0;
|
|
|
4
4
|
const services_1 = require("../../../services");
|
|
5
5
|
const models_1 = require("../../../../models");
|
|
6
6
|
const zigbeeDevice_1 = require("./zigbeeDevice");
|
|
7
|
+
const DeviceCapability_1 = require("../../DeviceCapability");
|
|
7
8
|
class ZigbeeActuator extends zigbeeDevice_1.ZigbeeDevice {
|
|
8
9
|
constructor(pInfo, type, actuatorOnSwitchID) {
|
|
9
10
|
super(pInfo, type);
|
|
@@ -12,6 +13,7 @@ class ZigbeeActuator extends zigbeeDevice_1.ZigbeeDevice {
|
|
|
12
13
|
this.actuatorOn = false;
|
|
13
14
|
this._turnOffTimeout = undefined;
|
|
14
15
|
this.turnOffTime = 0;
|
|
16
|
+
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.actuator);
|
|
15
17
|
this.actuatorOnSwitchID = actuatorOnSwitchID;
|
|
16
18
|
}
|
|
17
19
|
update(idSplit, state, initial = false, handledByChildObject = false) {
|