hoffmation-base 1.0.44 → 1.0.47
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/server/devices/{DeviceCapabilities.d.ts → DeviceCapability.d.ts} +3 -2
- package/lib/server/devices/DeviceCapability.js +22 -0
- package/lib/server/devices/IoBrokerBaseDevice.d.ts +2 -2
- package/lib/server/devices/baseDeviceInterfaces/iBaseDevice.d.ts +2 -2
- package/lib/server/devices/baseDeviceInterfaces/iSpeaker.d.ts +1 -1
- package/lib/server/devices/groups/speakerGroup.d.ts +2 -2
- package/lib/server/devices/hmIPDevices/hmIpBewegung.js +3 -3
- package/lib/server/devices/hmIPDevices/hmIpGriff.js +2 -0
- 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.js +2 -2
- 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/zigbeeIlluDimmer.js +3 -3
- 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 +4 -4
- package/lib/server/services/Sonos/own-sonos-device.js +2 -2
- package/lib/server/services/ac/ac-device.d.ts +2 -2
- package/lib/server/services/ac/ac-device.js +2 -2
- package/lib/server/services/api/api-service.d.ts +2 -0
- package/lib/server/services/api/api-service.js +28 -6
- package/lib/server/services/calendar/muell-tonne.d.ts +3 -3
- package/lib/server/services/calendar/m/303/274ll-service.d.ts +2 -2
- package/lib/server/services/news-service.d.ts +2 -2
- package/lib/server/services/weather/weather-service.d.ts +2 -2
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/lib/server/devices/DeviceCapabilities.js +0 -21
|
@@ -6,7 +6,7 @@ const models_1 = require("../../../models");
|
|
|
6
6
|
const room_service_1 = require("../room-service");
|
|
7
7
|
const log_service_1 = require("../log-service");
|
|
8
8
|
const ac_1 = require("../ac");
|
|
9
|
-
const
|
|
9
|
+
const DeviceCapability_1 = require("../../devices/DeviceCapability");
|
|
10
10
|
class API {
|
|
11
11
|
/**
|
|
12
12
|
* Gets the instance of an Ac Device identified by id
|
|
@@ -15,7 +15,7 @@ class API {
|
|
|
15
15
|
*/
|
|
16
16
|
static getAc(id) {
|
|
17
17
|
const result = this.getDevice(id);
|
|
18
|
-
if (!result.deviceCapabilities.includes(
|
|
18
|
+
if (!result.deviceCapabilities.includes(DeviceCapability_1.DeviceCapability.ac)) {
|
|
19
19
|
return undefined;
|
|
20
20
|
}
|
|
21
21
|
return result;
|
|
@@ -52,7 +52,7 @@ class API {
|
|
|
52
52
|
log_service_1.ServerLogService.writeLog(models_1.LogLevel.Warn, `AC Device for id ${id} not found`);
|
|
53
53
|
return false;
|
|
54
54
|
}
|
|
55
|
-
if (!d.deviceCapabilities.includes(
|
|
55
|
+
if (!d.deviceCapabilities.includes(DeviceCapability_1.DeviceCapability.ac)) {
|
|
56
56
|
log_service_1.ServerLogService.writeLog(models_1.LogLevel.Warn, `Device for id ${id} is not an ac`);
|
|
57
57
|
return false;
|
|
58
58
|
}
|
|
@@ -82,7 +82,7 @@ class API {
|
|
|
82
82
|
if (d === undefined) {
|
|
83
83
|
return new Error(`Device with ID ${deviceId} not found`);
|
|
84
84
|
}
|
|
85
|
-
if (!d.deviceCapabilities.includes(
|
|
85
|
+
if (!d.deviceCapabilities.includes(DeviceCapability_1.DeviceCapability.lamp)) {
|
|
86
86
|
return new Error(`Device with ID ${deviceId} is no Lamp`);
|
|
87
87
|
}
|
|
88
88
|
d.setLight(state, 60 * 60 * 1000, true);
|
|
@@ -99,7 +99,7 @@ class API {
|
|
|
99
99
|
if (d === undefined) {
|
|
100
100
|
return new Error(`Device with ID ${deviceId} not found`);
|
|
101
101
|
}
|
|
102
|
-
if (!d.deviceCapabilities.includes(
|
|
102
|
+
if (!d.deviceCapabilities.includes(DeviceCapability_1.DeviceCapability.actuator)) {
|
|
103
103
|
return new Error(`Device with ID ${deviceId} is no actuator`);
|
|
104
104
|
}
|
|
105
105
|
d.setActuator(state, 60 * 60 * 1000, true);
|
|
@@ -119,11 +119,33 @@ class API {
|
|
|
119
119
|
if (d === undefined) {
|
|
120
120
|
return new Error(`Device with ID ${deviceId} not found`);
|
|
121
121
|
}
|
|
122
|
-
if (!d.deviceCapabilities.includes(
|
|
122
|
+
if (!d.deviceCapabilities.includes(DeviceCapability_1.DeviceCapability.dimmablelamp)) {
|
|
123
123
|
return new Error(`Device with ID ${deviceId} is no dimmablelamp`);
|
|
124
124
|
}
|
|
125
125
|
d.setLight(state, timeout, true, brightness, transitionTime);
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
|
+
static setShutter(deviceId, level) {
|
|
129
|
+
const d = this.getDevice(deviceId);
|
|
130
|
+
if (d === undefined) {
|
|
131
|
+
return new Error(`Device with ID ${deviceId} not found`);
|
|
132
|
+
}
|
|
133
|
+
if (!d.deviceCapabilities.includes(DeviceCapability_1.DeviceCapability.shutter)) {
|
|
134
|
+
return new Error(`Device with ID ${deviceId} is no Shutter`);
|
|
135
|
+
}
|
|
136
|
+
d.setLevel(level, false);
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
static speakOnDevice(deviceId, message, volume = 30) {
|
|
140
|
+
const d = this.getDevice(deviceId);
|
|
141
|
+
if (d === undefined) {
|
|
142
|
+
return new Error(`Device with ID ${deviceId} not found`);
|
|
143
|
+
}
|
|
144
|
+
if (!d.deviceCapabilities.includes(DeviceCapability_1.DeviceCapability.speaker)) {
|
|
145
|
+
return new Error(`Device with ID ${deviceId} is no speaker`);
|
|
146
|
+
}
|
|
147
|
+
d.speakOnDevice(message, volume);
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
128
150
|
}
|
|
129
151
|
exports.API = API;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { iSpeaker } from '../../devices';
|
|
2
2
|
export declare class MuellTonne {
|
|
3
3
|
name: string;
|
|
4
|
-
ownSpeaker?:
|
|
4
|
+
ownSpeaker?: iSpeaker | undefined;
|
|
5
5
|
static oneDay: number;
|
|
6
6
|
nextDate: Date | undefined;
|
|
7
7
|
dates: Date[];
|
|
8
|
-
constructor(name: string, ownSpeaker?:
|
|
8
|
+
constructor(name: string, ownSpeaker?: iSpeaker | undefined);
|
|
9
9
|
sortDates(): void;
|
|
10
10
|
removePassedDates(): void;
|
|
11
11
|
check(): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TimeCallback } from '../../../models';
|
|
2
2
|
import { iMuellSettings } from '../../config';
|
|
3
3
|
import { MuellTonne } from './muell-tonne';
|
|
4
|
-
import {
|
|
4
|
+
import { iSpeaker } from '../../devices';
|
|
5
5
|
export declare class MuellService {
|
|
6
6
|
static alleTonnen: Array<{
|
|
7
7
|
name: string;
|
|
@@ -19,7 +19,7 @@ export declare class MuellService {
|
|
|
19
19
|
private static _calendarURL;
|
|
20
20
|
private static _active;
|
|
21
21
|
private static defaultSpeaker;
|
|
22
|
-
static intialize(config: iMuellSettings, defaultSpeaker:
|
|
22
|
+
static intialize(config: iMuellSettings, defaultSpeaker: iSpeaker | undefined): void;
|
|
23
23
|
static updateCalendar(checkAfterwards?: boolean): void;
|
|
24
24
|
static checkAll(pRetries?: number): void;
|
|
25
25
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { iNewsSettings } from '../config';
|
|
2
|
-
import {
|
|
2
|
+
import { iSpeaker } from '../devices';
|
|
3
3
|
export declare class NewsService {
|
|
4
4
|
static lastNewsAudioFile: string;
|
|
5
5
|
private static readonly newsFilePrefix;
|
|
@@ -29,7 +29,7 @@ export declare class NewsService {
|
|
|
29
29
|
* @param volume volume to play at
|
|
30
30
|
* @param retries Number of times playing should be tried if there is currently no audio file available
|
|
31
31
|
*/
|
|
32
|
-
static playLastNews(speaker:
|
|
32
|
+
static playLastNews(speaker: iSpeaker, volume?: number, retries?: number): void;
|
|
33
33
|
private static downloadLatestFileFromFeed;
|
|
34
34
|
/**
|
|
35
35
|
* Deletes all files in the given directory that are older than the given age.
|
|
@@ -6,7 +6,7 @@ import { iWeatherSettings } from '../../config';
|
|
|
6
6
|
import { LogLevel } from '../../../models';
|
|
7
7
|
import { LogDebugType } from '../log-service';
|
|
8
8
|
import { WeatherDaily } from './weather-daily';
|
|
9
|
-
import {
|
|
9
|
+
import { iSpeaker } from '../../devices';
|
|
10
10
|
export interface WeatherResponse {
|
|
11
11
|
lat: number;
|
|
12
12
|
lon: number;
|
|
@@ -36,7 +36,7 @@ export declare class WeatherService {
|
|
|
36
36
|
static initialize(config: iWeatherSettings): void;
|
|
37
37
|
static update(): void;
|
|
38
38
|
static stopInterval(): void;
|
|
39
|
-
static playWeatherInfo(speaker:
|
|
39
|
+
static playWeatherInfo(speaker: iSpeaker, volume?: number, short?: boolean, retries?: number): void;
|
|
40
40
|
static processHourlyWeather(): void;
|
|
41
41
|
static getCurrentTemp(): number;
|
|
42
42
|
static willOutsideBeWarmer(referenceTemperature: number, logger: (level: LogLevel, message: string, debugType?: LogDebugType) => void): boolean;
|