hoffmation-base 1.0.41 → 1.0.45
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/index.d.ts +2 -2
- package/lib/models/rooms/RoomBase.d.ts +2 -2
- 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 -2
- package/lib/server/devices/IoBrokerBaseDevice.js +1 -0
- package/lib/server/devices/baseDeviceInterfaces/iAcDevice.d.ts +14 -0
- package/lib/server/devices/baseDeviceInterfaces/iAcDevice.js +2 -0
- 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 -2
- 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 +8 -0
- package/lib/server/devices/baseDeviceInterfaces/iSpeaker.js +2 -0
- 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 +4 -0
- package/lib/server/devices/baseDeviceInterfaces/index.js +4 -0
- package/lib/server/devices/device-cluster.d.ts +4 -5
- package/lib/server/devices/device-cluster.js +6 -0
- package/lib/server/devices/device-list.d.ts +3 -5
- package/lib/server/devices/device-list.js +4 -13
- package/lib/server/devices/deviceUpdater.js +2 -1
- package/lib/server/devices/devices.d.ts +2 -2
- package/lib/server/devices/groups/heatGroup.js +1 -1
- package/lib/server/devices/groups/index.d.ts +1 -1
- package/lib/server/devices/groups/index.js +1 -1
- package/lib/server/devices/groups/lampenGroup.d.ts +3 -3
- package/lib/server/devices/groups/lampenGroup.js +3 -3
- package/lib/server/devices/groups/{sonosGroup.d.ts → speakerGroup.d.ts} +3 -3
- package/lib/server/devices/groups/{sonosGroup.js → speakerGroup.js} +6 -8
- package/lib/server/devices/hmIPDevices/hmIpBewegung.js +3 -0
- 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 -0
- package/lib/server/devices/hmIPDevices/hmIpLampe.js +2 -0
- package/lib/server/devices/hmIPDevices/hmIpPraezenz.js +3 -0
- package/lib/server/devices/hmIPDevices/hmIpRoll.js +2 -0
- package/lib/server/devices/hmIPDevices/hmIpTaster.js +2 -0
- package/lib/server/devices/hmIPDevices/hmIpWippe.js +2 -0
- package/lib/server/devices/jsObject/jsObjectEnergyManager.js +2 -0
- 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/index.d.ts +1 -0
- package/lib/server/devices/zigbee/BaseDevices/index.js +1 -0
- package/lib/server/devices/zigbee/BaseDevices/zigbeeHeater.js +2 -0
- package/lib/server/devices/zigbee/{zigbeeMotionSensor.d.ts → BaseDevices/zigbeeMotionSensor.d.ts} +5 -5
- package/lib/server/devices/zigbee/{zigbeeMotionSensor.js → BaseDevices/zigbeeMotionSensor.js} +6 -4
- package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.js +2 -0
- package/lib/server/devices/zigbee/index.d.ts +0 -1
- package/lib/server/devices/zigbee/index.js +0 -1
- package/lib/server/devices/zigbee/zigbeeAquaraMotion.d.ts +1 -1
- package/lib/server/devices/zigbee/zigbeeAquaraMotion.js +4 -2
- package/lib/server/devices/zigbee/zigbeeAquaraVibra.js +2 -0
- package/lib/server/devices/zigbee/zigbeeBlitzShp.js +2 -0
- 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 -0
- package/lib/server/devices/zigbee/zigbeeIlluLampe.js +2 -0
- package/lib/server/devices/zigbee/zigbeeSonoffMotion.d.ts +1 -1
- package/lib/server/devices/zigbee/zigbeeSonoffMotion.js +2 -2
- package/lib/server/devices/zigbee/zigbeeSonoffTemp.js +3 -0
- package/lib/server/devices/zigbee/zigbeeUbisysShutter.d.ts +1 -1
- package/lib/server/services/Sonos/OwnSonosDevices.d.ts +1 -1
- package/lib/server/services/Sonos/OwnSonosDevices.js +1 -1
- package/lib/server/services/Sonos/index.d.ts +1 -0
- package/lib/server/services/Sonos/index.js +3 -0
- package/lib/server/services/Sonos/own-sonos-device.d.ts +26 -0
- package/lib/server/services/Sonos/own-sonos-device.js +108 -0
- package/lib/server/services/Sonos/sonos-service.d.ts +1 -20
- package/lib/server/services/Sonos/sonos-service.js +5 -94
- package/lib/server/services/ac/ac-device.d.ts +4 -2
- package/lib/server/services/ac/ac-device.js +2 -0
- package/lib/server/services/api/api-service.d.ts +22 -5
- package/lib/server/services/api/api-service.js +47 -5
- package/lib/server/services/calendar/muell-tonne.d.ts +3 -3
- package/lib/server/services/calendar/muell-tonne.js +6 -12
- package/lib/server/services/calendar/m/303/274ll-service.d.ts +3 -3
- package/lib/server/services/calendar/m/303/274ll-service.js +7 -7
- package/lib/server/services/news-service.d.ts +3 -3
- package/lib/server/services/news-service.js +4 -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/server/services/weather/weather-service.d.ts +2 -2
- package/lib/server/services/weather/weather-service.js +14 -15
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Devices, iConfig, ioBrokerMain,
|
|
1
|
+
import { Devices, iConfig, ioBrokerMain, ISpeaker } from './server';
|
|
2
2
|
export * from './models/index';
|
|
3
3
|
export * from './server/index';
|
|
4
4
|
export declare class HoffmationInitializationObject {
|
|
@@ -8,6 +8,6 @@ export declare class HoffmationInitializationObject {
|
|
|
8
8
|
export declare class HoffmationBase {
|
|
9
9
|
static ioMain: ioBrokerMain;
|
|
10
10
|
static initializeBeforeIoBroker(initObject: HoffmationInitializationObject): Promise<void>;
|
|
11
|
-
static initializePostIoBroker(defaultMuellSonos?:
|
|
11
|
+
static initializePostIoBroker(defaultMuellSonos?: ISpeaker): void;
|
|
12
12
|
static startIoBroker(devices: Devices): void;
|
|
13
13
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TimeCallback } from '../timeCallback';
|
|
2
|
-
import { BaseGroup, DeviceCluster, FensterGroup, GroupType, HeatGroup, LampenGroup, PraesenzGroup, SmokeGroup,
|
|
2
|
+
import { BaseGroup, DeviceCluster, FensterGroup, GroupType, HeatGroup, LampenGroup, PraesenzGroup, SmokeGroup, SpeakerGroup, TasterGroup, WaterGroup } from '../../server';
|
|
3
3
|
import { RoomSettings } from './RoomSettings';
|
|
4
4
|
import { iRoomBase } from './iRoomBase';
|
|
5
5
|
import { RoomInfo } from './roomInfo';
|
|
@@ -19,7 +19,7 @@ export declare class RoomBase implements iRoomBase {
|
|
|
19
19
|
get PraesenzGroup(): PraesenzGroup | undefined;
|
|
20
20
|
get LampenGroup(): LampenGroup | undefined;
|
|
21
21
|
get TasterGroup(): TasterGroup | undefined;
|
|
22
|
-
get SonosGroup():
|
|
22
|
+
get SonosGroup(): SpeakerGroup | undefined;
|
|
23
23
|
get SmokeGroup(): SmokeGroup | undefined;
|
|
24
24
|
get WaterGroup(): WaterGroup | undefined;
|
|
25
25
|
get HeatGroup(): HeatGroup | undefined;
|
|
@@ -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,11 +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
|
-
|
|
8
|
+
import { DeviceCapability } from './DeviceCapability';
|
|
9
|
+
export declare abstract class IoBrokerBaseDevice implements iBaseDevice {
|
|
9
10
|
protected _info: IoBrokerDeviceInfo;
|
|
10
11
|
deviceType: DeviceType;
|
|
11
12
|
static roomAddingSettings: {
|
|
@@ -13,6 +14,7 @@ export declare abstract class IoBrokerBaseDevice implements IBaseDevice {
|
|
|
13
14
|
};
|
|
14
15
|
room: RoomBase | undefined;
|
|
15
16
|
battery: number | undefined;
|
|
17
|
+
readonly deviceCapabilities: DeviceCapability[];
|
|
16
18
|
protected constructor(_info: IoBrokerDeviceInfo, deviceType: DeviceType);
|
|
17
19
|
get id(): string;
|
|
18
20
|
/**
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AcSettings } from '../../../models/deviceSettings/acSettings';
|
|
2
|
+
import { AcMode } from '../../services';
|
|
3
|
+
export interface iAcDevice {
|
|
4
|
+
acSettings: AcSettings;
|
|
5
|
+
readonly on: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Disable automatic Turn-On for given amount of ms and turn off immediately.
|
|
8
|
+
* @param {number} timeout
|
|
9
|
+
*/
|
|
10
|
+
deactivateAutomaticTurnOn(timeout: number): void;
|
|
11
|
+
setDesiredMode(mode: AcMode, writeToDevice: boolean): void;
|
|
12
|
+
turnOn(): void;
|
|
13
|
+
turnOff(): void;
|
|
14
|
+
}
|
|
@@ -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,11 +1,13 @@
|
|
|
1
1
|
import { LogLevel, RoomBase } from '../../../models';
|
|
2
2
|
import { DeviceType } from '../deviceType';
|
|
3
3
|
import { DeviceInfo } from '../DeviceInfo';
|
|
4
|
-
|
|
4
|
+
import { DeviceCapability } from '../DeviceCapability';
|
|
5
|
+
export interface iBaseDevice {
|
|
5
6
|
room: RoomBase | undefined;
|
|
6
7
|
deviceType: DeviceType;
|
|
7
8
|
info: DeviceInfo;
|
|
9
|
+
readonly deviceCapabilities: DeviceCapability[];
|
|
8
10
|
readonly id: string;
|
|
9
11
|
log(level: LogLevel, message: string): void;
|
|
10
|
-
toJSON(): Partial<
|
|
12
|
+
toJSON(): Partial<iBaseDevice>;
|
|
11
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;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { iBaseDevice } from './iBaseDevice';
|
|
2
|
+
export interface ISpeaker extends iBaseDevice {
|
|
3
|
+
playOnDevice(mp3Name: string, duration: number, volume?: number, onlyWhenPlaying?: boolean, resolveAfterRevert?: boolean): void;
|
|
4
|
+
playTestMessage(): void;
|
|
5
|
+
playUrl(url: string): void;
|
|
6
|
+
stop(): void;
|
|
7
|
+
speakOnDevice(pMessage: string, volume?: number, onlyWhenPlaying?: boolean, resolveAfterRevert?: boolean): void;
|
|
8
|
+
}
|
|
@@ -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,12 +1,16 @@
|
|
|
1
|
+
export * from './iAcDevice';
|
|
2
|
+
export * from './iActuator';
|
|
1
3
|
export * from './iBaseDevice';
|
|
2
4
|
export * from './iButtonSwitch';
|
|
3
5
|
export * from './iEnergyManager';
|
|
4
6
|
export * from './iExcessEnergyConsumer';
|
|
7
|
+
export * from './iHandleSensor';
|
|
5
8
|
export * from './iHeater';
|
|
6
9
|
export * from './iHumiditySensor';
|
|
7
10
|
export * from './iIlluminationSensor';
|
|
8
11
|
export * from './iLamp';
|
|
9
12
|
export * from './iMotionSensor';
|
|
10
13
|
export * from './iShutter';
|
|
14
|
+
export * from './iSpeaker';
|
|
11
15
|
export * from './iTemperatureSensor';
|
|
12
16
|
export * from './iVibrationSensor';
|
|
@@ -14,15 +14,19 @@ 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
|
+
__exportStar(require("./iAcDevice"), exports);
|
|
18
|
+
__exportStar(require("./iActuator"), exports);
|
|
17
19
|
__exportStar(require("./iBaseDevice"), exports);
|
|
18
20
|
__exportStar(require("./iButtonSwitch"), exports);
|
|
19
21
|
__exportStar(require("./iEnergyManager"), exports);
|
|
20
22
|
__exportStar(require("./iExcessEnergyConsumer"), exports);
|
|
23
|
+
__exportStar(require("./iHandleSensor"), exports);
|
|
21
24
|
__exportStar(require("./iHeater"), exports);
|
|
22
25
|
__exportStar(require("./iHumiditySensor"), exports);
|
|
23
26
|
__exportStar(require("./iIlluminationSensor"), exports);
|
|
24
27
|
__exportStar(require("./iLamp"), exports);
|
|
25
28
|
__exportStar(require("./iMotionSensor"), exports);
|
|
26
29
|
__exportStar(require("./iShutter"), exports);
|
|
30
|
+
__exportStar(require("./iSpeaker"), exports);
|
|
27
31
|
__exportStar(require("./iTemperatureSensor"), exports);
|
|
28
32
|
__exportStar(require("./iVibrationSensor"), exports);
|
|
@@ -1,15 +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 {
|
|
5
|
-
import { IBaseDevice } from './baseDeviceInterfaces';
|
|
4
|
+
import { iBaseDevice } from './baseDeviceInterfaces';
|
|
6
5
|
export declare class DeviceCluster {
|
|
7
6
|
deviceMap: Map<DeviceClusterType, DeviceList>;
|
|
8
7
|
constructor(deviceMap?: Map<DeviceClusterType, DeviceList>);
|
|
9
8
|
getIoBrokerDevicesByType(type: DeviceClusterType): IoBrokerBaseDevice[];
|
|
10
|
-
getDevicesByType(type: DeviceClusterType): Array<
|
|
11
|
-
addByDeviceType(device:
|
|
12
|
-
addToList(type: DeviceClusterType, device:
|
|
9
|
+
getDevicesByType(type: DeviceClusterType): Array<iBaseDevice>;
|
|
10
|
+
addByDeviceType(device: iBaseDevice): void;
|
|
11
|
+
addToList(type: DeviceClusterType, device: iBaseDevice): void;
|
|
13
12
|
toJSON(): Partial<DeviceCluster & {
|
|
14
13
|
deviceDict?: {
|
|
15
14
|
[p: string]: DeviceList;
|
|
@@ -23,6 +23,12 @@ class DeviceCluster {
|
|
|
23
23
|
const type = device.deviceType;
|
|
24
24
|
const clusterTypes = [device_cluster_type_1.DeviceClusterType.all];
|
|
25
25
|
switch (type) {
|
|
26
|
+
case deviceType_1.DeviceType.Daikin:
|
|
27
|
+
clusterTypes.push(device_cluster_type_1.DeviceClusterType.Ac);
|
|
28
|
+
break;
|
|
29
|
+
case deviceType_1.DeviceType.Sonos:
|
|
30
|
+
clusterTypes.push(device_cluster_type_1.DeviceClusterType.Speaker);
|
|
31
|
+
break;
|
|
26
32
|
case deviceType_1.DeviceType.HmIpLampe:
|
|
27
33
|
case deviceType_1.DeviceType.ZigbeeIlluDimmer:
|
|
28
34
|
case deviceType_1.DeviceType.ZigbeeIlluLampe:
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IBaseDevice } from './baseDeviceInterfaces';
|
|
1
|
+
import { iBaseDevice } from './baseDeviceInterfaces';
|
|
3
2
|
export declare class DeviceList {
|
|
4
3
|
private _ids;
|
|
5
|
-
|
|
6
|
-
constructor(_ids?: string[], _isSonos?: boolean);
|
|
4
|
+
constructor(_ids?: string[]);
|
|
7
5
|
get ids(): string[];
|
|
8
|
-
getDevices(): Array<
|
|
6
|
+
getDevices(): Array<iBaseDevice>;
|
|
9
7
|
}
|
|
@@ -3,9 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DeviceList = void 0;
|
|
4
4
|
const services_1 = require("../services");
|
|
5
5
|
class DeviceList {
|
|
6
|
-
constructor(_ids = []
|
|
6
|
+
constructor(_ids = []) {
|
|
7
7
|
this._ids = _ids;
|
|
8
|
-
this._isSonos = _isSonos;
|
|
9
8
|
// Empty
|
|
10
9
|
}
|
|
11
10
|
get ids() {
|
|
@@ -14,17 +13,9 @@ class DeviceList {
|
|
|
14
13
|
getDevices() {
|
|
15
14
|
const result = [];
|
|
16
15
|
for (const dID of this._ids) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
result.push(services_1.OwnSonosDevices.ownDevices[dID]);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
const d = services_1.API.getDevice(dID);
|
|
25
|
-
if (d !== undefined) {
|
|
26
|
-
result.push(d);
|
|
27
|
-
}
|
|
16
|
+
const d = services_1.API.getDevice(dID);
|
|
17
|
+
if (d !== undefined) {
|
|
18
|
+
result.push(d);
|
|
28
19
|
}
|
|
29
20
|
}
|
|
30
21
|
return result;
|
|
@@ -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: {
|
|
@@ -14,7 +14,7 @@ class HeatGroup extends base_group_1.BaseGroup {
|
|
|
14
14
|
this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.Heater, new device_list_1.DeviceList(heaterIds));
|
|
15
15
|
this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.TemperaturSensor, new device_list_1.DeviceList(tempSensorIds));
|
|
16
16
|
this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.HumiditySensor, new device_list_1.DeviceList(humiditySensorIds));
|
|
17
|
-
this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.Ac, new device_list_1.DeviceList(acIds
|
|
17
|
+
this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.Ac, new device_list_1.DeviceList(acIds));
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* The current measured temperature of the room in Celsius
|
|
@@ -22,6 +22,6 @@ __exportStar(require("./heatGroup"), exports);
|
|
|
22
22
|
__exportStar(require("./lampenGroup"), exports);
|
|
23
23
|
__exportStar(require("./praesenzGroup"), exports);
|
|
24
24
|
__exportStar(require("./smokeGroup"), exports);
|
|
25
|
-
__exportStar(require("./
|
|
25
|
+
__exportStar(require("./speakerGroup"), exports);
|
|
26
26
|
__exportStar(require("./tasterGroup"), exports);
|
|
27
27
|
__exportStar(require("./waterGroup"), exports);
|
|
@@ -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
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { OwnSonosDevice } from '../../services';
|
|
2
1
|
import { BaseGroup } from './base-group';
|
|
3
|
-
|
|
2
|
+
import { ISpeaker } from '../baseDeviceInterfaces';
|
|
3
|
+
export declare class SpeakerGroup extends BaseGroup {
|
|
4
4
|
private _playing;
|
|
5
5
|
constructor(roomName: string, speakerIds: string[]);
|
|
6
|
-
getOwnSonosDevices():
|
|
6
|
+
getOwnSonosDevices(): ISpeaker[];
|
|
7
7
|
playRadio(radioUrl: string): void;
|
|
8
8
|
turnOff(): void;
|
|
9
9
|
trigger(track: string): void;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SpeakerGroup = void 0;
|
|
4
4
|
const services_1 = require("../../services");
|
|
5
5
|
const base_group_1 = require("./base-group");
|
|
6
6
|
const device_cluster_type_1 = require("../device-cluster-type");
|
|
7
7
|
const group_type_1 = require("./group-type");
|
|
8
8
|
const device_list_1 = require("../device-list");
|
|
9
|
-
class
|
|
9
|
+
class SpeakerGroup extends base_group_1.BaseGroup {
|
|
10
10
|
constructor(roomName, speakerIds) {
|
|
11
11
|
super(roomName, group_type_1.GroupType.Speaker);
|
|
12
12
|
this._playing = false;
|
|
13
|
-
this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.Speaker, new device_list_1.DeviceList(speakerIds
|
|
13
|
+
this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.Speaker, new device_list_1.DeviceList(speakerIds));
|
|
14
14
|
}
|
|
15
15
|
getOwnSonosDevices() {
|
|
16
16
|
return this.deviceCluster.getDevicesByType(device_cluster_type_1.DeviceClusterType.Speaker);
|
|
@@ -18,16 +18,14 @@ class SonosGroup extends base_group_1.BaseGroup {
|
|
|
18
18
|
playRadio(radioUrl) {
|
|
19
19
|
this.getOwnSonosDevices().forEach((s) => {
|
|
20
20
|
services_1.Utils.guardedTimeout(() => {
|
|
21
|
-
|
|
22
|
-
(_a = s.device) === null || _a === void 0 ? void 0 : _a.SetAVTransportURI(radioUrl);
|
|
21
|
+
s.playUrl(radioUrl);
|
|
23
22
|
}, 1500);
|
|
24
23
|
});
|
|
25
24
|
this._playing = true;
|
|
26
25
|
}
|
|
27
26
|
turnOff() {
|
|
28
27
|
this.getOwnSonosDevices().forEach((s) => {
|
|
29
|
-
|
|
30
|
-
(_a = s.device) === null || _a === void 0 ? void 0 : _a.Stop();
|
|
28
|
+
s.stop();
|
|
31
29
|
});
|
|
32
30
|
this._playing = false;
|
|
33
31
|
}
|
|
@@ -39,4 +37,4 @@ class SonosGroup extends base_group_1.BaseGroup {
|
|
|
39
37
|
this.playRadio(track);
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
|
-
exports.
|
|
40
|
+
exports.SpeakerGroup = SpeakerGroup;
|
|
@@ -5,6 +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 DeviceCapability_1 = require("../DeviceCapability");
|
|
8
9
|
class HmIpBewegung extends hmIpDevice_1.HmIPDevice {
|
|
9
10
|
constructor(pInfo) {
|
|
10
11
|
var _a;
|
|
@@ -16,6 +17,8 @@ class HmIpBewegung extends hmIpDevice_1.HmIPDevice {
|
|
|
16
17
|
this._lastMotionTime = 0;
|
|
17
18
|
this._detectionsToday = 0;
|
|
18
19
|
this._currentIllumination = -1;
|
|
20
|
+
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.motionSensor);
|
|
21
|
+
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.illuminationSensor);
|
|
19
22
|
(_a = services_1.Utils.dbo) === null || _a === void 0 ? void 0 : _a.getCount(this).then((todayCount) => {
|
|
20
23
|
this.detectionsToday = todayCount.counter;
|
|
21
24
|
this.log(models_1.LogLevel.Debug, `Bewegungscounter vorinitialisiert mit ${this.detectionsToday}`);
|