hoffmation-base 0.1.32 → 0.1.33-4
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/rooms/RoomBase.d.ts +3 -3
- package/lib/models/rooms/RoomBase.js +23 -18
- package/lib/models/rooms/RoomSettings/RoomSettings.d.ts +8 -7
- package/lib/models/rooms/RoomSettings/RoomSettings.js +14 -9
- package/lib/server/devices/DeviceInfo.d.ts +1 -0
- package/lib/server/devices/DeviceInfo.js +7 -0
- package/lib/server/devices/Fenster.js +1 -1
- package/lib/server/devices/IoBrokerBaseDevice.d.ts +1 -0
- package/lib/server/devices/IoBrokerBaseDevice.js +4 -0
- package/lib/server/devices/devices.d.ts +1 -1
- package/lib/server/devices/devices.js +1 -1
- package/lib/server/devices/groups/fensterGroup.js +11 -11
- package/lib/server/devices/groups/praesenzGroup.js +5 -5
- package/lib/server/devices/groups/tasterGroup.js +1 -1
- package/lib/server/devices/hmIPDevices/hmIpBewegung.d.ts +1 -1
- package/lib/server/devices/hmIPDevices/hmIpBewegung.js +4 -4
- package/lib/server/devices/hmIPDevices/hmIpGriff.d.ts +3 -1
- package/lib/server/devices/hmIPDevices/hmIpGriff.js +12 -5
- package/lib/server/devices/hmIPDevices/hmIpLampe.d.ts +1 -1
- package/lib/server/devices/hmIPDevices/hmIpLampe.js +6 -6
- package/lib/server/devices/hmIPDevices/hmIpRoll.d.ts +2 -0
- package/lib/server/devices/hmIPDevices/hmIpRoll.js +7 -0
- package/lib/server/devices/hmIPDevices/hmIpTuer.d.ts +1 -1
- package/lib/server/devices/hmIPDevices/hmIpTuer.js +5 -5
- package/lib/server/devices/zigbee/ZigbeeActuator.d.ts +1 -1
- package/lib/server/devices/zigbee/ZigbeeActuator.js +6 -6
- package/lib/server/devices/zigbee/zigbeeAquaraWater.d.ts +1 -1
- package/lib/server/devices/zigbee/zigbeeAquaraWater.js +6 -6
- package/lib/server/devices/zigbee/zigbeeHeimanSmoke.d.ts +1 -1
- package/lib/server/devices/zigbee/zigbeeHeimanSmoke.js +6 -6
- package/lib/server/devices/zigbee/zigbeeIlluDimmer.d.ts +1 -1
- package/lib/server/devices/zigbee/zigbeeIlluDimmer.js +7 -7
- package/lib/server/devices/zigbee/zigbeeMagnetContact.d.ts +1 -1
- package/lib/server/devices/zigbee/zigbeeMagnetContact.js +5 -5
- package/lib/server/devices/zigbee/zigbeeShutter.d.ts +2 -0
- package/lib/server/devices/zigbee/zigbeeShutter.js +7 -0
- package/lib/server/ioBroker/connection.d.ts +1 -1
- package/lib/server/ioBroker/connection.js +3 -3
- package/lib/server/services/api/api-service.js +3 -0
- package/lib/server/services/dbo/persist.js +2 -2
- package/lib/server/services/room-service/room-service.d.ts +2 -2
- package/lib/server/services/room-service/room-service.js +12 -12
- package/lib/server/services/time-callback-service.d.ts +1 -1
- package/lib/server/services/time-callback-service.js +4 -4
- package/lib/server/services/utils/utils.d.ts +2 -0
- package/lib/server/services/utils/utils.js +22 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -1
|
@@ -13,7 +13,7 @@ import { RoomInfo } from './roomInfo';
|
|
|
13
13
|
import { BaseGroup } from '../../server/devices/groups/base-group';
|
|
14
14
|
import { GroupType } from '../../server/devices/groups/group-type';
|
|
15
15
|
export declare class RoomBase implements iRoomBase {
|
|
16
|
-
|
|
16
|
+
settings: RoomSettings;
|
|
17
17
|
groups: Map<GroupType, BaseGroup>;
|
|
18
18
|
info: RoomInfo;
|
|
19
19
|
get FensterGroup(): FensterGroup | undefined;
|
|
@@ -24,14 +24,13 @@ export declare class RoomBase implements iRoomBase {
|
|
|
24
24
|
get SmokeGroup(): SmokeGroup | undefined;
|
|
25
25
|
get WaterGroup(): WaterGroup | undefined;
|
|
26
26
|
get HeatGroup(): HeatGroup | undefined;
|
|
27
|
-
Settings: RoomSettings;
|
|
28
27
|
sonnenAufgangCallback: TimeCallback | undefined;
|
|
29
28
|
sonnenUntergangCallback: TimeCallback | undefined;
|
|
30
29
|
sonnenAufgangLichtCallback: TimeCallback | undefined;
|
|
31
30
|
skipNextRolloUp: boolean;
|
|
32
31
|
get roomName(): string;
|
|
33
32
|
get etage(): number | undefined;
|
|
34
|
-
constructor(roomName: string,
|
|
33
|
+
constructor(roomName: string, settings: RoomSettings, groups: Map<GroupType, BaseGroup>);
|
|
35
34
|
initializeBase(): void;
|
|
36
35
|
persist(): void;
|
|
37
36
|
recalcTimeCallbacks(): void;
|
|
@@ -41,4 +40,5 @@ export declare class RoomBase implements iRoomBase {
|
|
|
41
40
|
*/
|
|
42
41
|
setLightTimeBased(movementDependant?: boolean): void;
|
|
43
42
|
isNowLightTime(): boolean;
|
|
43
|
+
toJSON(): Partial<RoomBase>;
|
|
44
44
|
}
|
|
@@ -9,14 +9,15 @@ const room_service_1 = require("../../server/services/room-service/room-service"
|
|
|
9
9
|
const roomInfo_1 = require("./roomInfo");
|
|
10
10
|
const group_type_1 = require("../../server/devices/groups/group-type");
|
|
11
11
|
const ShutterService_1 = require("../../server/services/ShutterService");
|
|
12
|
+
const utils_1 = require("../../server/services/utils/utils");
|
|
12
13
|
class RoomBase {
|
|
13
|
-
constructor(roomName,
|
|
14
|
-
this.
|
|
14
|
+
constructor(roomName, settings, groups) {
|
|
15
|
+
this.settings = settings;
|
|
15
16
|
this.groups = groups;
|
|
16
17
|
this.skipNextRolloUp = false;
|
|
17
|
-
this.info = new roomInfo_1.RoomInfo(roomName,
|
|
18
|
-
|
|
19
|
-
this.
|
|
18
|
+
this.info = new roomInfo_1.RoomInfo(roomName, settings);
|
|
19
|
+
settings.roomName = roomName;
|
|
20
|
+
this.settings = settings;
|
|
20
21
|
room_service_1.RoomService.addToRoomList(this);
|
|
21
22
|
}
|
|
22
23
|
get FensterGroup() {
|
|
@@ -62,18 +63,18 @@ class RoomBase {
|
|
|
62
63
|
}
|
|
63
64
|
recalcTimeCallbacks() {
|
|
64
65
|
const now = new Date();
|
|
65
|
-
if (this.sonnenAufgangCallback && this.
|
|
66
|
-
this.sonnenAufgangCallback.minuteOffset = this.
|
|
67
|
-
this.sonnenAufgangCallback.sunTimeOffset = this.
|
|
66
|
+
if (this.sonnenAufgangCallback && this.settings.rolloOffset) {
|
|
67
|
+
this.sonnenAufgangCallback.minuteOffset = this.settings.rolloOffset.sunrise;
|
|
68
|
+
this.sonnenAufgangCallback.sunTimeOffset = this.settings.rolloOffset;
|
|
68
69
|
this.sonnenAufgangCallback.recalcNextToDo(now);
|
|
69
70
|
}
|
|
70
|
-
if (this.sonnenUntergangCallback && this.
|
|
71
|
-
this.sonnenUntergangCallback.minuteOffset = this.
|
|
72
|
-
this.sonnenUntergangCallback.sunTimeOffset = this.
|
|
71
|
+
if (this.sonnenUntergangCallback && this.settings.rolloOffset) {
|
|
72
|
+
this.sonnenUntergangCallback.minuteOffset = this.settings.rolloOffset.sunset;
|
|
73
|
+
this.sonnenUntergangCallback.sunTimeOffset = this.settings.rolloOffset;
|
|
73
74
|
this.sonnenUntergangCallback.recalcNextToDo(now);
|
|
74
75
|
}
|
|
75
|
-
if (this.sonnenAufgangLichtCallback && this.
|
|
76
|
-
this.sonnenAufgangLichtCallback.minuteOffset = this.
|
|
76
|
+
if (this.sonnenAufgangLichtCallback && this.settings.lampOffset) {
|
|
77
|
+
this.sonnenAufgangLichtCallback.minuteOffset = this.settings.lampOffset.sunrise;
|
|
77
78
|
this.sonnenAufgangLichtCallback.recalcNextToDo(now);
|
|
78
79
|
}
|
|
79
80
|
}
|
|
@@ -90,13 +91,13 @@ class RoomBase {
|
|
|
90
91
|
this.LampenGroup.switchAll(false);
|
|
91
92
|
return;
|
|
92
93
|
}
|
|
93
|
-
if (!this.
|
|
94
|
+
if (!this.settings.lampOffset) {
|
|
94
95
|
log_service_1.ServerLogService.writeLog(logLevel_1.LogLevel.Alert, `Beim Aufruf von "setLightTimeBased" im Raum ${this.roomName} liegt kein Lampen Offset vor`);
|
|
95
96
|
return;
|
|
96
97
|
}
|
|
97
|
-
let timeOfDay = time_callback_service_1.TimeCallbackService.dayType(this.
|
|
98
|
+
let timeOfDay = time_callback_service_1.TimeCallbackService.dayType(this.settings.lampOffset);
|
|
98
99
|
if (timeOfDay === time_callback_service_1.TimeOfDay.Daylight &&
|
|
99
|
-
((this.
|
|
100
|
+
((this.settings.lightIfNoWindows && (!this.FensterGroup || this.FensterGroup.fenster.length === 0)) ||
|
|
100
101
|
((_b = this.FensterGroup) === null || _b === void 0 ? void 0 : _b.fenster.some((f) => {
|
|
101
102
|
return ShutterService_1.ShutterService.anyRolloDown(f.getShutter());
|
|
102
103
|
})))) {
|
|
@@ -106,11 +107,11 @@ class RoomBase {
|
|
|
106
107
|
}
|
|
107
108
|
isNowLightTime() {
|
|
108
109
|
var _a;
|
|
109
|
-
if (!this.
|
|
110
|
+
if (!this.settings.lampOffset) {
|
|
110
111
|
log_service_1.ServerLogService.writeLog(logLevel_1.LogLevel.Alert, `Beim Aufruf von "setLightTimeBased" im Raum ${this.roomName} liegt kein Lampen Offset vor`);
|
|
111
112
|
return false;
|
|
112
113
|
}
|
|
113
|
-
let timeOfDay = time_callback_service_1.TimeCallbackService.dayType(this.
|
|
114
|
+
let timeOfDay = time_callback_service_1.TimeCallbackService.dayType(this.settings.lampOffset);
|
|
114
115
|
if (timeOfDay === time_callback_service_1.TimeOfDay.Daylight &&
|
|
115
116
|
((_a = this.FensterGroup) === null || _a === void 0 ? void 0 : _a.fenster.some((f) => {
|
|
116
117
|
return ShutterService_1.ShutterService.anyRolloDown(f.getShutter());
|
|
@@ -119,5 +120,9 @@ class RoomBase {
|
|
|
119
120
|
}
|
|
120
121
|
return time_callback_service_1.TimeCallbackService.darkOutsideOrNight(timeOfDay);
|
|
121
122
|
}
|
|
123
|
+
toJSON() {
|
|
124
|
+
const result = utils_1.Utils.jsonFilter(this);
|
|
125
|
+
return result;
|
|
126
|
+
}
|
|
122
127
|
}
|
|
123
128
|
exports.RoomBase = RoomBase;
|
|
@@ -7,6 +7,13 @@ import { RoomDeviceAddingSettings } from './roomDeviceAddingSettings';
|
|
|
7
7
|
export declare class RoomSettings implements iRoomDefaultSettings, iRoomInitializationSettings {
|
|
8
8
|
shortName: string;
|
|
9
9
|
defaultSettings: iRoomDefaultSettings;
|
|
10
|
+
deviceAddidngSettings?: RoomDeviceAddingSettings;
|
|
11
|
+
radioUrl: string;
|
|
12
|
+
etage: number;
|
|
13
|
+
rolloOffset: SunTimeOffsets;
|
|
14
|
+
lampOffset: SunTimeOffsets;
|
|
15
|
+
roomName?: string;
|
|
16
|
+
rolloHeatReduction: boolean;
|
|
10
17
|
private _lampenBeiBewegung;
|
|
11
18
|
private _lichtSonnenAufgangAus;
|
|
12
19
|
private _sonnenUntergangRollos;
|
|
@@ -19,13 +26,6 @@ export declare class RoomSettings implements iRoomDefaultSettings, iRoomInitiali
|
|
|
19
26
|
private _sonnenAufgangRolloMinTime;
|
|
20
27
|
private _sonnenAufgangLampenDelay;
|
|
21
28
|
private _lightIfNoWindows;
|
|
22
|
-
deviceAddidngSettings?: RoomDeviceAddingSettings;
|
|
23
|
-
radioUrl: string;
|
|
24
|
-
etage: number;
|
|
25
|
-
rolloOffset: SunTimeOffsets;
|
|
26
|
-
lampOffset: SunTimeOffsets;
|
|
27
|
-
room?: RoomBase;
|
|
28
|
-
rolloHeatReduction: boolean;
|
|
29
29
|
constructor(initSettings: iRoomInitializationSettings);
|
|
30
30
|
private recalcRolloOffset;
|
|
31
31
|
private recalcLampOffset;
|
|
@@ -53,4 +53,5 @@ export declare class RoomSettings implements iRoomDefaultSettings, iRoomInitiali
|
|
|
53
53
|
set sonnenAufgangRolloMinTime(value: iTimePair);
|
|
54
54
|
get lightIfNoWindows(): boolean;
|
|
55
55
|
set lightIfNoWindows(value: boolean);
|
|
56
|
+
get room(): RoomBase | undefined;
|
|
56
57
|
}
|
|
@@ -3,9 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RoomSettings = void 0;
|
|
4
4
|
const time_callback_service_1 = require("../../../server/services/time-callback-service");
|
|
5
5
|
const settings_service_1 = require("../../../server/services/settings-service");
|
|
6
|
+
const api_service_1 = require("../../../server/services/api/api-service");
|
|
6
7
|
class RoomSettings {
|
|
7
8
|
constructor(initSettings) {
|
|
8
9
|
this.defaultSettings = settings_service_1.SettingsService.settings.roomDefault;
|
|
10
|
+
this.radioUrl = 'https://hermes.bcs-systems.de/hitradio-rtl_top40_64k_aac'; // Radio RTL
|
|
11
|
+
this.etage = -1;
|
|
12
|
+
this.rolloHeatReduction = this.defaultSettings.rolloHeatReduction;
|
|
9
13
|
this._lampenBeiBewegung = this.defaultSettings.lampenBeiBewegung;
|
|
10
14
|
this._lichtSonnenAufgangAus = this.defaultSettings.lichtSonnenAufgangAus;
|
|
11
15
|
this._sonnenUntergangRollos = this.defaultSettings.sonnenUntergangRollos;
|
|
@@ -18,9 +22,6 @@ class RoomSettings {
|
|
|
18
22
|
this._sonnenAufgangRolloMinTime = this.defaultSettings.sonnenAufgangRolloMinTime;
|
|
19
23
|
this._sonnenAufgangLampenDelay = this.defaultSettings.sonnenAufgangLampenDelay;
|
|
20
24
|
this._lightIfNoWindows = this.defaultSettings.lightIfNoWindows;
|
|
21
|
-
this.radioUrl = 'https://hermes.bcs-systems.de/hitradio-rtl_top40_64k_aac'; // Radio RTL
|
|
22
|
-
this.etage = -1;
|
|
23
|
-
this.rolloHeatReduction = this.defaultSettings.rolloHeatReduction;
|
|
24
25
|
this.shortName = initSettings.shortName;
|
|
25
26
|
this.etage = initSettings.etage;
|
|
26
27
|
this.deviceAddidngSettings = initSettings.deviceAddidngSettings;
|
|
@@ -28,16 +29,14 @@ class RoomSettings {
|
|
|
28
29
|
this.lampOffset = new time_callback_service_1.SunTimeOffsets(this.sonnenAufgangLampenDelay, this.sonnenUntergangLampenDelay);
|
|
29
30
|
}
|
|
30
31
|
recalcRolloOffset() {
|
|
32
|
+
var _a;
|
|
31
33
|
this.rolloOffset = new time_callback_service_1.SunTimeOffsets(this.sonnenAufgangRolloDelay, this.sonnenUntergangRolloDelay, this.sonnenAufgangRolloMinTime.hours, this.sonnenAufgangRolloMinTime.minutes, this.sonnenUntergangRolloMaxTime.hours, this.sonnenUntergangRolloMaxTime.minutes);
|
|
32
|
-
|
|
33
|
-
this.room.recalcTimeCallbacks();
|
|
34
|
-
}
|
|
34
|
+
(_a = this.room) === null || _a === void 0 ? void 0 : _a.recalcTimeCallbacks();
|
|
35
35
|
}
|
|
36
36
|
recalcLampOffset() {
|
|
37
|
+
var _a;
|
|
37
38
|
this.lampOffset = new time_callback_service_1.SunTimeOffsets(this.sonnenAufgangLampenDelay, this.sonnenAufgangRolloDelay);
|
|
38
|
-
|
|
39
|
-
this.room.recalcTimeCallbacks();
|
|
40
|
-
}
|
|
39
|
+
(_a = this.room) === null || _a === void 0 ? void 0 : _a.recalcTimeCallbacks();
|
|
41
40
|
}
|
|
42
41
|
get sonnenAufgangLampenDelay() {
|
|
43
42
|
return this._sonnenAufgangLampenDelay;
|
|
@@ -118,5 +117,11 @@ class RoomSettings {
|
|
|
118
117
|
set lightIfNoWindows(value) {
|
|
119
118
|
this._lightIfNoWindows = value;
|
|
120
119
|
}
|
|
120
|
+
get room() {
|
|
121
|
+
if (!this.roomName) {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
return api_service_1.API.getRoom(this.roomName);
|
|
125
|
+
}
|
|
121
126
|
}
|
|
122
127
|
exports.RoomSettings = RoomSettings;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.DeviceInfo = void 0;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
4
8
|
class DeviceInfo {
|
|
5
9
|
constructor(pDevConf) {
|
|
6
10
|
this.devConf = pDevConf;
|
|
@@ -44,5 +48,8 @@ class DeviceInfo {
|
|
|
44
48
|
}
|
|
45
49
|
return this.fullName;
|
|
46
50
|
}
|
|
51
|
+
toJSON() {
|
|
52
|
+
return lodash_1.default.omit(this, ['devConf']);
|
|
53
|
+
}
|
|
47
54
|
}
|
|
48
55
|
exports.DeviceInfo = DeviceInfo;
|
|
@@ -55,7 +55,7 @@ class Fenster extends base_group_1.BaseGroup {
|
|
|
55
55
|
this.getVibration().forEach((element) => {
|
|
56
56
|
element.vibrationBlocked = true;
|
|
57
57
|
});
|
|
58
|
-
const timeOfDay = time_callback_service_1.TimeCallbackService.dayType(this.getRoom().
|
|
58
|
+
const timeOfDay = time_callback_service_1.TimeCallbackService.dayType(this.getRoom().settings.rolloOffset);
|
|
59
59
|
if (time_callback_service_1.TimeCallbackService.darkOutsideOrNight(timeOfDay)) {
|
|
60
60
|
ShutterService_1.ShutterService.windowAllMiddle(this);
|
|
61
61
|
}
|
|
@@ -46,4 +46,5 @@ export declare abstract class IoBrokerBaseDevice {
|
|
|
46
46
|
* @param onError Callback to run if an error has occurred during writing the data
|
|
47
47
|
*/
|
|
48
48
|
protected setState(pointId: string, state: string | number | boolean | ioBroker.State | ioBroker.SettableState | null, onSuccess?: (() => void) | undefined, onError?: ((error: Error) => void) | undefined): void;
|
|
49
|
+
toJSON(): Partial<IoBrokerBaseDevice>;
|
|
49
50
|
}
|
|
@@ -9,7 +9,7 @@ export declare class Devices {
|
|
|
9
9
|
};
|
|
10
10
|
constructor(pDeviceData: {
|
|
11
11
|
[id: string]: deviceConfig;
|
|
12
|
-
}, pRoomImportEnforcer
|
|
12
|
+
}, pRoomImportEnforcer?: iRoomImportEnforcer);
|
|
13
13
|
static midnightReset(): void;
|
|
14
14
|
static resetPraesenzCount(): void;
|
|
15
15
|
private processZigbeeDevice;
|
|
@@ -34,7 +34,7 @@ const zigbeeSonoffMotion_1 = require("./zigbee/zigbeeSonoffMotion");
|
|
|
34
34
|
class Devices {
|
|
35
35
|
constructor(pDeviceData, pRoomImportEnforcer) {
|
|
36
36
|
// This forces import of rooms at correct timing, to allow devices to land in proper rooms.
|
|
37
|
-
pRoomImportEnforcer.addRoomConstructor();
|
|
37
|
+
pRoomImportEnforcer === null || pRoomImportEnforcer === void 0 ? void 0 : pRoomImportEnforcer.addRoomConstructor();
|
|
38
38
|
log_service_1.ServerLogService.writeLog(logLevel_1.LogLevel.Info, `Constructing devices now`);
|
|
39
39
|
for (const cID in pDeviceData) {
|
|
40
40
|
const cDevConf = pDeviceData[cID];
|
|
@@ -41,7 +41,7 @@ class FensterGroup extends base_group_1.BaseGroup {
|
|
|
41
41
|
}
|
|
42
42
|
initialize() {
|
|
43
43
|
const room = this.getRoom();
|
|
44
|
-
if (room.
|
|
44
|
+
if (room.settings.sonnenAufgangRollos && room.settings.rolloOffset) {
|
|
45
45
|
log_service_1.ServerLogService.writeLog(logLevel_1.LogLevel.Trace, `Sonnenaufgang TimeCallback für ${this.roomName} hinzufügen`);
|
|
46
46
|
room.sonnenAufgangCallback = new timeCallback_1.TimeCallback(`${this.roomName} Sonnenaufgang Rollos`, timeCallback_1.TimeCallbackType.Sunrise, () => {
|
|
47
47
|
if (room.skipNextRolloUp) {
|
|
@@ -49,24 +49,24 @@ class FensterGroup extends base_group_1.BaseGroup {
|
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
this.sunriseUp();
|
|
52
|
-
}, room.
|
|
53
|
-
if (!time_callback_service_1.TimeCallbackService.darkOutsideOrNight(time_callback_service_1.TimeCallbackService.dayType(room.
|
|
52
|
+
}, room.settings.rolloOffset.sunrise, undefined, undefined, room.settings.rolloOffset);
|
|
53
|
+
if (!time_callback_service_1.TimeCallbackService.darkOutsideOrNight(time_callback_service_1.TimeCallbackService.dayType(room.settings.rolloOffset))) {
|
|
54
54
|
this.sunriseUp(true);
|
|
55
55
|
}
|
|
56
56
|
time_callback_service_1.TimeCallbackService.addCallback(room.sonnenAufgangCallback);
|
|
57
57
|
}
|
|
58
|
-
if (room.
|
|
58
|
+
if (room.settings.sonnenUntergangRollos && room.settings.rolloOffset) {
|
|
59
59
|
room.sonnenUntergangCallback = new timeCallback_1.TimeCallback(`${this.roomName} Sonnenuntergang Rollo`, timeCallback_1.TimeCallbackType.SunSet, () => {
|
|
60
60
|
this.sunsetDown();
|
|
61
|
-
}, room.
|
|
62
|
-
if (time_callback_service_1.TimeCallbackService.darkOutsideOrNight(time_callback_service_1.TimeCallbackService.dayType(room.
|
|
61
|
+
}, room.settings.rolloOffset.sunset);
|
|
62
|
+
if (time_callback_service_1.TimeCallbackService.darkOutsideOrNight(time_callback_service_1.TimeCallbackService.dayType(room.settings.rolloOffset))) {
|
|
63
63
|
utils_1.Utils.guardedTimeout(() => {
|
|
64
64
|
this.allRolloDown(true, true);
|
|
65
65
|
}, 60000, this);
|
|
66
66
|
}
|
|
67
67
|
time_callback_service_1.TimeCallbackService.addCallback(room.sonnenUntergangCallback);
|
|
68
68
|
}
|
|
69
|
-
if (room.
|
|
69
|
+
if (room.settings.rolloHeatReduction) {
|
|
70
70
|
utils_1.Utils.guardedInterval(this.setRolloByWeatherStatus, 15 * 60 * 1000, this, true);
|
|
71
71
|
utils_1.Utils.guardedTimeout(this.setRolloByWeatherStatus, 2 * 60 * 1000, this);
|
|
72
72
|
}
|
|
@@ -78,13 +78,13 @@ class FensterGroup extends base_group_1.BaseGroup {
|
|
|
78
78
|
var _a, _b;
|
|
79
79
|
this.allRolloToLevel(0, true);
|
|
80
80
|
const room = this.getRoom();
|
|
81
|
-
if (((_a = room.PraesenzGroup) === null || _a === void 0 ? void 0 : _a.anyPresent()) && room.
|
|
82
|
-
(_b = room.LampenGroup) === null || _b === void 0 ? void 0 : _b.switchTimeConditional(time_callback_service_1.TimeCallbackService.dayType(room.
|
|
81
|
+
if (((_a = room.PraesenzGroup) === null || _a === void 0 ? void 0 : _a.anyPresent()) && room.settings.lampOffset) {
|
|
82
|
+
(_b = room.LampenGroup) === null || _b === void 0 ? void 0 : _b.switchTimeConditional(time_callback_service_1.TimeCallbackService.dayType(room.settings.lampOffset));
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
setRolloByWeatherStatus() {
|
|
86
86
|
const room = this.getRoom();
|
|
87
|
-
const timeOfDay = time_callback_service_1.TimeCallbackService.dayType(room.
|
|
87
|
+
const timeOfDay = time_callback_service_1.TimeCallbackService.dayType(room.settings.rolloOffset);
|
|
88
88
|
const darkOutside = time_callback_service_1.TimeCallbackService.darkOutsideOrNight(timeOfDay);
|
|
89
89
|
this.fenster.forEach((f) => {
|
|
90
90
|
var _a, _b, _c, _d;
|
|
@@ -124,7 +124,7 @@ class FensterGroup extends base_group_1.BaseGroup {
|
|
|
124
124
|
});
|
|
125
125
|
return;
|
|
126
126
|
}
|
|
127
|
-
if (!time_callback_service_1.TimeCallbackService.darkOutsideOrNight(time_callback_service_1.TimeCallbackService.dayType(this.getRoom().
|
|
127
|
+
if (!time_callback_service_1.TimeCallbackService.darkOutsideOrNight(time_callback_service_1.TimeCallbackService.dayType(this.getRoom().settings.rolloOffset))) {
|
|
128
128
|
this.sunriseUp(true);
|
|
129
129
|
}
|
|
130
130
|
else {
|
|
@@ -47,12 +47,12 @@ class PraesenzGroup extends base_group_1.BaseGroup {
|
|
|
47
47
|
room_service_1.RoomService.movementHistory.add(`${utils_1.Utils.nowString()}: Raum "${this.roomName}" Gerät "${b.info.fullName}"`);
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
|
-
if (this.getRoom().
|
|
50
|
+
if (this.getRoom().settings.lichtSonnenAufgangAus && this.getRoom().settings.lampOffset) {
|
|
51
51
|
const cb = new timeCallback_1.TimeCallback(`${this.roomName} Morgens Lampe aus`, timeCallback_1.TimeCallbackType.Sunrise, () => {
|
|
52
52
|
var _a;
|
|
53
53
|
log_service_1.ServerLogService.writeLog(logLevel_1.LogLevel.Info, `Es ist hell genug --> Schalte Lampen im ${this.roomName} aus`);
|
|
54
54
|
(_a = this.getRoom().LampenGroup) === null || _a === void 0 ? void 0 : _a.switchAll(false);
|
|
55
|
-
}, this.getRoom().
|
|
55
|
+
}, this.getRoom().settings.lampOffset.sunrise);
|
|
56
56
|
this.getRoom().sonnenAufgangLichtCallback = cb;
|
|
57
57
|
time_callback_service_1.TimeCallbackService.addCallback(cb);
|
|
58
58
|
}
|
|
@@ -60,7 +60,7 @@ class PraesenzGroup extends base_group_1.BaseGroup {
|
|
|
60
60
|
var _a;
|
|
61
61
|
(_a = this.getRoom().LampenGroup) === null || _a === void 0 ? void 0 : _a.switchAll(false);
|
|
62
62
|
});
|
|
63
|
-
if (this.getRoom().
|
|
63
|
+
if (this.getRoom().settings.lampenBeiBewegung) {
|
|
64
64
|
this.addFirstEnterCallback(() => {
|
|
65
65
|
log_service_1.ServerLogService.writeLog(logLevel_1.LogLevel.DeepTrace, `Bewegung im Raum ${this.roomName} festgestellt --> Licht einschalten`);
|
|
66
66
|
this.getRoom().setLightTimeBased();
|
|
@@ -101,7 +101,7 @@ class PraesenzGroup extends base_group_1.BaseGroup {
|
|
|
101
101
|
if (this.anyPresent()) {
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
|
-
let timeAfterReset = utils_1.Utils.nowMS() - this._lastMovement.getTime() - this.getRoom().
|
|
104
|
+
let timeAfterReset = utils_1.Utils.nowMS() - this._lastMovement.getTime() - this.getRoom().settings.movementResetTimer * 1000;
|
|
105
105
|
if (timeAfterReset > 0) {
|
|
106
106
|
log_service_1.ServerLogService.writeLog(logLevel_1.LogLevel.Debug, `Movement reset in ${this.roomName}.\nActive Motions: ${this.presentAmount()}\nTime after Last Movement including Reset: ${timeAfterReset}`);
|
|
107
107
|
cb();
|
|
@@ -110,7 +110,7 @@ class PraesenzGroup extends base_group_1.BaseGroup {
|
|
|
110
110
|
log_service_1.ServerLogService.writeLog(logLevel_1.LogLevel.Debug, `Movement reset in ${this.roomName} delayed.`);
|
|
111
111
|
utils_1.Utils.guardedTimeout(() => {
|
|
112
112
|
timeAfterReset =
|
|
113
|
-
utils_1.Utils.nowMS() - this._lastMovement.getTime() - this.getRoom().
|
|
113
|
+
utils_1.Utils.nowMS() - this._lastMovement.getTime() - this.getRoom().settings.movementResetTimer * 1000;
|
|
114
114
|
log_service_1.ServerLogService.writeLog(logLevel_1.LogLevel.Debug, `Delayed Movement reset in ${this.roomName}.\nActive Motions: ${this.presentAmount()}\nTime after Last Movement including Reset: ${timeAfterReset}`);
|
|
115
115
|
if (!this.anyPresent() && timeAfterReset > 0) {
|
|
116
116
|
cb();
|
|
@@ -45,7 +45,7 @@ class TasterGroup extends base_group_1.BaseGroup {
|
|
|
45
45
|
const sonosGroup = this.getRoom().SonosGroup;
|
|
46
46
|
if (sonosGroup !== undefined && sonosGroup.getOwnSonosDevices().length > 0) {
|
|
47
47
|
t.tasten.UntenRechts.addLongCallback(() => {
|
|
48
|
-
sonosGroup.trigger(this.getRoom().
|
|
48
|
+
sonosGroup.trigger(this.getRoom().settings.radioUrl);
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
});
|
|
@@ -10,7 +10,7 @@ export declare class HmIpBewegung extends HmIPDevice implements iIlluminationSen
|
|
|
10
10
|
private static MOVEMENT_DETECTION;
|
|
11
11
|
private static CURRENT_ILLUMINATION;
|
|
12
12
|
private initialized;
|
|
13
|
-
private
|
|
13
|
+
private _fallBackTimeout;
|
|
14
14
|
private _currentIllumination;
|
|
15
15
|
get currentIllumination(): number;
|
|
16
16
|
private set currentIllumination(value);
|
|
@@ -91,15 +91,15 @@ class HmIpBewegung extends hmIpDevice_1.HmIPDevice {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
resetFallbackTimeout() {
|
|
94
|
-
if (this.
|
|
94
|
+
if (this._fallBackTimeout) {
|
|
95
95
|
log_service_1.ServerLogService.writeLog(logLevel_1.LogLevel.Trace, `Fallback Timeout für "${this.info.customName}" zurücksetzen`);
|
|
96
|
-
clearTimeout(this.
|
|
96
|
+
clearTimeout(this._fallBackTimeout);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
startFallbackTimeout() {
|
|
100
|
-
this.
|
|
100
|
+
this._fallBackTimeout = utils_1.Utils.guardedTimeout(() => {
|
|
101
101
|
log_service_1.ServerLogService.writeLog(logLevel_1.LogLevel.Debug, `Benötige Fallback Bewegungs Reset für "${this.info.customName}"`);
|
|
102
|
-
this.
|
|
102
|
+
this._fallBackTimeout = undefined;
|
|
103
103
|
this.updateMovement(false);
|
|
104
104
|
}, 270000, this);
|
|
105
105
|
}
|
|
@@ -3,12 +3,13 @@ import { HmIPDevice } from './hmIpDevice';
|
|
|
3
3
|
import { DeviceInfo } from '../DeviceInfo';
|
|
4
4
|
import { FensterPosition } from '../models/FensterPosition';
|
|
5
5
|
import { Fenster } from '../Fenster';
|
|
6
|
+
import { IoBrokerBaseDevice } from '../IoBrokerBaseDevice';
|
|
6
7
|
export declare class HmIpGriff extends HmIPDevice {
|
|
7
8
|
position: FensterPosition;
|
|
8
9
|
private _kippCallback;
|
|
9
10
|
private _closedCallback;
|
|
10
11
|
private _offenCallback;
|
|
11
|
-
private
|
|
12
|
+
private _iOpenTimeout;
|
|
12
13
|
private minutesOpen;
|
|
13
14
|
private _fenster;
|
|
14
15
|
private _helpingRoomTemp;
|
|
@@ -19,4 +20,5 @@ export declare class HmIpGriff extends HmIPDevice {
|
|
|
19
20
|
set Fenster(value: Fenster);
|
|
20
21
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
21
22
|
updatePosition(pValue: FensterPosition): void;
|
|
23
|
+
toJSON(): Partial<IoBrokerBaseDevice>;
|
|
22
24
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.HmIpGriff = void 0;
|
|
4
7
|
const hmIpDevice_1 = require("./hmIpDevice");
|
|
@@ -9,6 +12,7 @@ const weather_service_1 = require("../../services/weather/weather-service");
|
|
|
9
12
|
const telegram_service_1 = require("../../services/Telegram/telegram-service");
|
|
10
13
|
const FensterPosition_1 = require("../models/FensterPosition");
|
|
11
14
|
const logLevel_1 = require("../../../models/logLevel");
|
|
15
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
12
16
|
class HmIpGriff extends hmIpDevice_1.HmIPDevice {
|
|
13
17
|
constructor(pInfo) {
|
|
14
18
|
super(pInfo, deviceType_1.DeviceType.HmIpGriff);
|
|
@@ -59,16 +63,16 @@ class HmIpGriff extends hmIpDevice_1.HmIPDevice {
|
|
|
59
63
|
c3(pValue === 2);
|
|
60
64
|
}
|
|
61
65
|
if (pValue === FensterPosition_1.FensterPosition.geschlossen) {
|
|
62
|
-
if (this.
|
|
63
|
-
clearInterval(this.
|
|
66
|
+
if (this._iOpenTimeout !== undefined) {
|
|
67
|
+
clearInterval(this._iOpenTimeout);
|
|
64
68
|
log_service_1.ServerLogService.writeLog(logLevel_1.LogLevel.Info, `Fenster: "${this.info.customName}" nach ${this.minutesOpen} Minuten geschlossen`);
|
|
65
69
|
this.minutesOpen = 0;
|
|
66
|
-
this.
|
|
70
|
+
this._iOpenTimeout = undefined;
|
|
67
71
|
}
|
|
68
72
|
return;
|
|
69
73
|
}
|
|
70
|
-
else if (this.
|
|
71
|
-
this.
|
|
74
|
+
else if (this._iOpenTimeout === undefined) {
|
|
75
|
+
this._iOpenTimeout = utils_1.Utils.guardedInterval(() => {
|
|
72
76
|
var _a;
|
|
73
77
|
this.minutesOpen++;
|
|
74
78
|
const heatgroup = (_a = this._fenster) === null || _a === void 0 ? void 0 : _a.getRoom().HeatGroup;
|
|
@@ -115,5 +119,8 @@ class HmIpGriff extends hmIpDevice_1.HmIPDevice {
|
|
|
115
119
|
}, 60000, this);
|
|
116
120
|
}
|
|
117
121
|
}
|
|
122
|
+
toJSON() {
|
|
123
|
+
return lodash_1.default.omit(super.toJSON(), ['_fenster']);
|
|
124
|
+
}
|
|
118
125
|
}
|
|
119
126
|
exports.HmIpGriff = HmIpGriff;
|
|
@@ -10,7 +10,7 @@ export declare class HmIpLampe extends HmIPDevice implements iLamp {
|
|
|
10
10
|
isStromStoss: boolean;
|
|
11
11
|
settings: ActuatorSettings;
|
|
12
12
|
private lightOnSwitchID;
|
|
13
|
-
private
|
|
13
|
+
private _turnOffTimeout;
|
|
14
14
|
private turnOffTime;
|
|
15
15
|
constructor(pInfo: DeviceInfo);
|
|
16
16
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
@@ -16,7 +16,7 @@ class HmIpLampe extends hmIpDevice_1.HmIPDevice {
|
|
|
16
16
|
this.isStromStoss = false;
|
|
17
17
|
this.settings = new actuatorSettings_1.ActuatorSettings();
|
|
18
18
|
this.lightOnSwitchID = '';
|
|
19
|
-
this.
|
|
19
|
+
this._turnOffTimeout = undefined;
|
|
20
20
|
this.turnOffTime = 0;
|
|
21
21
|
this.lightOnSwitchID = `${this.info.fullID}.2.STATE`;
|
|
22
22
|
}
|
|
@@ -58,17 +58,17 @@ class HmIpLampe extends hmIpDevice_1.HmIPDevice {
|
|
|
58
58
|
if (this.isStromStoss) {
|
|
59
59
|
timeout = 5000;
|
|
60
60
|
}
|
|
61
|
-
if (this.
|
|
62
|
-
clearTimeout(this.
|
|
63
|
-
this.
|
|
61
|
+
if (this._turnOffTimeout !== undefined) {
|
|
62
|
+
clearTimeout(this._turnOffTimeout);
|
|
63
|
+
this._turnOffTimeout = undefined;
|
|
64
64
|
}
|
|
65
65
|
if (timeout < 0 || !pValue) {
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
68
|
this.turnOffTime = utils_1.Utils.nowMS() + timeout;
|
|
69
|
-
this.
|
|
69
|
+
this._turnOffTimeout = utils_1.Utils.guardedTimeout(() => {
|
|
70
70
|
log_service_1.ServerLogService.writeLog(logLevel_1.LogLevel.Debug, `Delayed Turnoff for "${this.info.customName}" initiated`);
|
|
71
|
-
this.
|
|
71
|
+
this._turnOffTimeout = undefined;
|
|
72
72
|
if (!this.room) {
|
|
73
73
|
this.setLight(false, -1, true);
|
|
74
74
|
}
|
|
@@ -3,6 +3,7 @@ import { HmIPDevice } from './hmIpDevice';
|
|
|
3
3
|
import { DeviceInfo } from '../DeviceInfo';
|
|
4
4
|
import { Fenster } from '../Fenster';
|
|
5
5
|
import { iShutter } from '../iShutter';
|
|
6
|
+
import { IoBrokerBaseDevice } from '../IoBrokerBaseDevice';
|
|
6
7
|
export declare class HmIpRoll extends HmIPDevice implements iShutter {
|
|
7
8
|
get currentLevel(): number;
|
|
8
9
|
set currentLevel(value: number);
|
|
@@ -18,4 +19,5 @@ export declare class HmIpRoll extends HmIPDevice implements iShutter {
|
|
|
18
19
|
constructor(pInfo: DeviceInfo);
|
|
19
20
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
20
21
|
setLevel(pPosition: number, initial?: boolean, skipOpenWarning?: boolean): void;
|
|
22
|
+
toJSON(): Partial<IoBrokerBaseDevice>;
|
|
21
23
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.HmIpRoll = void 0;
|
|
4
7
|
const hmIpDevice_1 = require("./hmIpDevice");
|
|
@@ -7,6 +10,7 @@ const utils_1 = require("../../services/utils/utils");
|
|
|
7
10
|
const log_service_1 = require("../../services/log-service");
|
|
8
11
|
const FensterPosition_1 = require("../models/FensterPosition");
|
|
9
12
|
const logLevel_1 = require("../../../models/logLevel");
|
|
13
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
10
14
|
class HmIpRoll extends hmIpDevice_1.HmIPDevice {
|
|
11
15
|
constructor(pInfo) {
|
|
12
16
|
super(pInfo, deviceType_1.DeviceType.HmIpRoll);
|
|
@@ -94,5 +98,8 @@ class HmIpRoll extends hmIpDevice_1.HmIPDevice {
|
|
|
94
98
|
log_service_1.ServerLogService.writeLog(logLevel_1.LogLevel.Debug, `Fahre Rollo "${this.info.customName}" auf Position ${pPosition}`);
|
|
95
99
|
this.setState(this._setLevelSwitchID, pPosition);
|
|
96
100
|
}
|
|
101
|
+
toJSON() {
|
|
102
|
+
return lodash_1.default.omit(super.toJSON(), ['_fenster']);
|
|
103
|
+
}
|
|
97
104
|
}
|
|
98
105
|
exports.HmIpRoll = HmIpRoll;
|
|
@@ -6,7 +6,7 @@ export declare class HmIpTuer extends HmIPDevice {
|
|
|
6
6
|
position: MagnetPosition;
|
|
7
7
|
private _closedCallback;
|
|
8
8
|
private _openCallback;
|
|
9
|
-
private
|
|
9
|
+
private _iOpenTimeout;
|
|
10
10
|
private minutesOpen;
|
|
11
11
|
constructor(pInfo: DeviceInfo);
|
|
12
12
|
addOpenCallback(pCallback: (pValue: boolean) => void): void;
|
|
@@ -52,8 +52,8 @@ class HmIpTuer extends hmIpDevice_1.HmIPDevice {
|
|
|
52
52
|
c2(pValue === 1);
|
|
53
53
|
}
|
|
54
54
|
if (pValue === MagnetPosition_1.MagnetPosition.closed) {
|
|
55
|
-
if (this.
|
|
56
|
-
clearInterval(this.
|
|
55
|
+
if (this._iOpenTimeout !== undefined) {
|
|
56
|
+
clearInterval(this._iOpenTimeout);
|
|
57
57
|
let message = `${this.info.customName} closed after ${this.minutesOpen} minutes!`;
|
|
58
58
|
if (this.minutesOpen === 0) {
|
|
59
59
|
message = `"${this.info.customName}" just closed`;
|
|
@@ -62,16 +62,16 @@ class HmIpTuer extends hmIpDevice_1.HmIPDevice {
|
|
|
62
62
|
log_service_1.ServerLogService.writeLog(logLevel_1.LogLevel.Info, message);
|
|
63
63
|
telegram_service_1.TelegramService.inform(message);
|
|
64
64
|
this.minutesOpen = 0;
|
|
65
|
-
this.
|
|
65
|
+
this._iOpenTimeout = undefined;
|
|
66
66
|
}
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
else if (this.
|
|
69
|
+
else if (this._iOpenTimeout === undefined) {
|
|
70
70
|
const message = res_1.Res.wasOpened(this.info.customName);
|
|
71
71
|
//const message: string = `Die Tür mit dem Namen "${this.info.customName}" wurde geöfnet!`
|
|
72
72
|
telegram_service_1.TelegramService.inform(message);
|
|
73
73
|
sonos_service_1.SonosService.speakOnAll(message, 40);
|
|
74
|
-
this.
|
|
74
|
+
this._iOpenTimeout = utils_1.Utils.guardedInterval(() => {
|
|
75
75
|
this.minutesOpen++;
|
|
76
76
|
const message = `Contact: "${this.info.customName}" is ${MagnetPosition_1.MagnetPosition[this.position]} since ${this.minutesOpen} minutes`;
|
|
77
77
|
switch (this.minutesOpen) {
|
|
@@ -8,7 +8,7 @@ export declare class ZigbeeActuator extends ZigbeeDevice {
|
|
|
8
8
|
protected readonly actuatorOnSwitchID: string;
|
|
9
9
|
protected queuedValue: boolean | null;
|
|
10
10
|
protected actuatorOn: boolean;
|
|
11
|
-
private
|
|
11
|
+
private _turnOffTimeout;
|
|
12
12
|
private turnOffTime;
|
|
13
13
|
constructor(pInfo: DeviceInfo, type: DeviceType, actuatorOnSwitchID: string);
|
|
14
14
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean, handledByChildObject?: boolean): void;
|