hoffmation-base 1.1.4 → 1.1.7
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/persistence/DesiredShutterPosition.d.ts +4 -0
- package/lib/models/persistence/DesiredShutterPosition.js +9 -0
- package/lib/models/persistence/index.d.ts +1 -0
- package/lib/models/persistence/index.js +1 -0
- package/lib/models/rooms/RoomBase.d.ts +2 -2
- package/lib/models/rooms/RoomBase.js +5 -5
- package/lib/server/devices/Griffe.js +2 -2
- package/lib/server/devices/baseDeviceInterfaces/iHandleSensor.d.ts +2 -2
- package/lib/server/devices/baseDeviceInterfaces/iShutter.d.ts +3 -3
- package/lib/server/devices/groups/{Fenster.d.ts → Window.d.ts} +3 -3
- package/lib/server/devices/groups/{Fenster.js → Window.js} +8 -8
- package/lib/server/devices/groups/index.d.ts +2 -2
- package/lib/server/devices/groups/index.js +2 -2
- package/lib/server/devices/groups/praesenzGroup.js +3 -3
- package/lib/server/devices/groups/tasterGroup.js +4 -4
- package/lib/server/devices/groups/{fensterGroup.d.ts → windowGroup.d.ts} +4 -4
- package/lib/server/devices/groups/{fensterGroup.js → windowGroup.js} +15 -15
- package/lib/server/devices/hmIPDevices/hmIpGriff.d.ts +6 -6
- package/lib/server/devices/hmIPDevices/hmIpGriff.js +11 -11
- package/lib/server/devices/hmIPDevices/hmIpRoll.d.ts +5 -5
- package/lib/server/devices/hmIPDevices/hmIpRoll.js +23 -15
- package/lib/server/devices/models/{FensterPosition.d.ts → WindowPosition.d.ts} +1 -1
- package/lib/server/devices/models/WindowPosition.js +9 -0
- package/lib/server/devices/models/index.d.ts +1 -1
- package/lib/server/devices/models/index.js +1 -1
- package/lib/server/devices/zigbee/BaseDevices/ZigbeeActuator.js +1 -0
- package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.d.ts +5 -5
- package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.js +22 -16
- package/lib/server/devices/zigbee/zigbeeAquaraVibra.js +2 -2
- package/lib/server/devices/zigbee/zigbeeIlluLampe.js +0 -1
- package/lib/server/devices/zigbee/zigbeeIlluShutter.js +0 -1
- package/lib/server/services/ShutterService.d.ts +5 -5
- package/lib/server/services/ShutterService.js +3 -3
- package/lib/server/services/Telegram/telegram-Commands.js +2 -2
- package/lib/server/services/dbo/iPersist.d.ts +2 -1
- package/lib/server/services/dbo/postgreSqlPersist.d.ts +2 -1
- package/lib/server/services/dbo/postgreSqlPersist.js +18 -2
- package/lib/server/services/room-service/room-service.js +2 -2
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/lib/server/devices/models/FensterPosition.js +0 -9
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DesiredShutterPosition = void 0;
|
|
4
|
+
class DesiredShutterPosition {
|
|
5
|
+
constructor(desiredPosition) {
|
|
6
|
+
this.desiredPosition = desiredPosition;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.DesiredShutterPosition = DesiredShutterPosition;
|
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./BasicRoomInfo"), exports);
|
|
18
18
|
__exportStar(require("./CurrentIlluminationDataPoint"), exports);
|
|
19
|
+
__exportStar(require("./DesiredShutterPosition"), exports);
|
|
19
20
|
__exportStar(require("./EnergyCalculation"), exports);
|
|
20
21
|
__exportStar(require("./RoomDetailInfo"), exports);
|
|
21
22
|
__exportStar(require("./ShutterCalibration"), exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TimeCallback } from '../timeCallback';
|
|
2
|
-
import { BaseGroup, DeviceCluster,
|
|
2
|
+
import { BaseGroup, DeviceCluster, GroupType, HeatGroup, LampenGroup, PraesenzGroup, SmokeGroup, SpeakerGroup, TasterGroup, WaterGroup, WindowGroup } from '../../server';
|
|
3
3
|
import { RoomSettings } from './RoomSettings';
|
|
4
4
|
import { iRoomBase } from './iRoomBase';
|
|
5
5
|
import { RoomInfo } from './roomInfo';
|
|
@@ -15,7 +15,7 @@ export declare class RoomBase implements iRoomBase {
|
|
|
15
15
|
constructor(roomName: string, settings: RoomSettings, groupMap: Map<GroupType, BaseGroup>);
|
|
16
16
|
protected _deviceCluster: DeviceCluster;
|
|
17
17
|
get deviceCluster(): DeviceCluster;
|
|
18
|
-
get
|
|
18
|
+
get WindowGroup(): WindowGroup | undefined;
|
|
19
19
|
get PraesenzGroup(): PraesenzGroup | undefined;
|
|
20
20
|
get LampenGroup(): LampenGroup | undefined;
|
|
21
21
|
get TasterGroup(): TasterGroup | undefined;
|
|
@@ -23,7 +23,7 @@ class RoomBase {
|
|
|
23
23
|
get deviceCluster() {
|
|
24
24
|
return this._deviceCluster;
|
|
25
25
|
}
|
|
26
|
-
get
|
|
26
|
+
get WindowGroup() {
|
|
27
27
|
return this.groupMap.get(server_1.GroupType.Window);
|
|
28
28
|
}
|
|
29
29
|
get PraesenzGroup() {
|
|
@@ -58,7 +58,7 @@ class RoomBase {
|
|
|
58
58
|
this.log(logLevel_1.LogLevel.Debug, `RoomBase Init für ${this.roomName}`);
|
|
59
59
|
this.recalcTimeCallbacks();
|
|
60
60
|
(_a = this.PraesenzGroup) === null || _a === void 0 ? void 0 : _a.initCallbacks();
|
|
61
|
-
(_b = this.
|
|
61
|
+
(_b = this.WindowGroup) === null || _b === void 0 ? void 0 : _b.initialize();
|
|
62
62
|
(_c = this.TasterGroup) === null || _c === void 0 ? void 0 : _c.initCallbacks();
|
|
63
63
|
(_d = this.HeatGroup) === null || _d === void 0 ? void 0 : _d.initialize();
|
|
64
64
|
if (this.settings.ambientLightAfterSunset && this.settings.lampOffset) {
|
|
@@ -128,8 +128,8 @@ class RoomBase {
|
|
|
128
128
|
? timeCallback_1.TimeOfDay.Night
|
|
129
129
|
: server_1.TimeCallbackService.dayType(this.settings.lampOffset);
|
|
130
130
|
if (timeOfDay === timeCallback_1.TimeOfDay.Daylight &&
|
|
131
|
-
((this.settings.lightIfNoWindows && (!this.
|
|
132
|
-
((_b = this.
|
|
131
|
+
((this.settings.lightIfNoWindows && (!this.WindowGroup || this.WindowGroup.windows.length === 0)) ||
|
|
132
|
+
((_b = this.WindowGroup) === null || _b === void 0 ? void 0 : _b.windows.some((f) => {
|
|
133
133
|
return server_1.ShutterService.anyRolloDown(f.getShutter());
|
|
134
134
|
})))) {
|
|
135
135
|
timeOfDay = timeCallback_1.TimeOfDay.AfterSunset;
|
|
@@ -146,7 +146,7 @@ class RoomBase {
|
|
|
146
146
|
? timeCallback_1.TimeOfDay.Night
|
|
147
147
|
: server_1.TimeCallbackService.dayType(this.settings.lampOffset);
|
|
148
148
|
if (timeOfDay === timeCallback_1.TimeOfDay.Daylight &&
|
|
149
|
-
((_a = this.
|
|
149
|
+
((_a = this.WindowGroup) === null || _a === void 0 ? void 0 : _a.windows.some((f) => {
|
|
150
150
|
return server_1.ShutterService.anyRolloDown(f.getShutter());
|
|
151
151
|
}))) {
|
|
152
152
|
timeOfDay = timeCallback_1.TimeOfDay.AfterSunset;
|
|
@@ -11,9 +11,9 @@ class Griffe {
|
|
|
11
11
|
a.position;
|
|
12
12
|
return b.position - a.position;
|
|
13
13
|
});
|
|
14
|
-
const response = [`
|
|
14
|
+
const response = [`These are the current handle positions:`];
|
|
15
15
|
for (const g of griffe) {
|
|
16
|
-
response.push(`${models_1.
|
|
16
|
+
response.push(`${models_1.WindowPosition[g.position]} Window: "${g.info.customName}"`);
|
|
17
17
|
}
|
|
18
18
|
return response.join('\n');
|
|
19
19
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WindowPosition } from '../models';
|
|
2
2
|
import { iRoomDevice } from './iRoomDevice';
|
|
3
3
|
export interface iHandleSensor extends iRoomDevice {
|
|
4
|
-
position:
|
|
4
|
+
position: WindowPosition;
|
|
5
5
|
minutesOpen: number;
|
|
6
6
|
addOffenCallback(pCallback: (pValue: boolean) => void): void;
|
|
7
7
|
addKippCallback(pCallback: (pValue: boolean) => void): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Window } from '../groups';
|
|
2
2
|
import { iRoomDevice } from './iRoomDevice';
|
|
3
3
|
export interface iShutter extends iRoomDevice {
|
|
4
4
|
currentLevel: number;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
desiredWindowShutterLevel: number;
|
|
6
|
+
window: Window | undefined;
|
|
7
7
|
persist(): void;
|
|
8
8
|
setLevel(pPosition: number, initial: boolean, skipOpenWarning?: boolean): void;
|
|
9
9
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { HmIpGriff } from '../hmIPDevices';
|
|
2
|
-
import {
|
|
2
|
+
import { WindowPosition } from '../models';
|
|
3
3
|
import { WindowSettings } from '../../../models';
|
|
4
4
|
import { iShutter, iVibrationSensor } from '../baseDeviceInterfaces';
|
|
5
5
|
import { BaseGroup } from './base-group';
|
|
6
6
|
import { ZigbeeMagnetContact } from '../zigbee';
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class Window extends BaseGroup {
|
|
8
8
|
noRolloOnSunrise: boolean;
|
|
9
9
|
desiredPosition: number;
|
|
10
10
|
settings: WindowSettings;
|
|
@@ -18,7 +18,7 @@ export declare class Fenster extends BaseGroup {
|
|
|
18
18
|
getMagnetContact(): ZigbeeMagnetContact[];
|
|
19
19
|
getShutter(): iShutter[];
|
|
20
20
|
getVibration(): iVibrationSensor[];
|
|
21
|
-
griffeInPosition(pPosition:
|
|
21
|
+
griffeInPosition(pPosition: WindowPosition): number;
|
|
22
22
|
initialize(): void;
|
|
23
23
|
rolloPositionChange(pValue: number): void;
|
|
24
24
|
restoreDesiredPosition(): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Window = void 0;
|
|
4
4
|
const services_1 = require("../../services");
|
|
5
5
|
const models_1 = require("../models");
|
|
6
6
|
const models_2 = require("../../../models");
|
|
@@ -8,7 +8,7 @@ const base_group_1 = require("./base-group");
|
|
|
8
8
|
const group_type_1 = require("./group-type");
|
|
9
9
|
const device_cluster_type_1 = require("../device-cluster-type");
|
|
10
10
|
const device_list_1 = require("../device-list");
|
|
11
|
-
class
|
|
11
|
+
class Window extends base_group_1.BaseGroup {
|
|
12
12
|
constructor(roomName, handleIds = [], vibrationIds = [], shutterIds = [], magnetIds = [], noRolloOnSunrise = false) {
|
|
13
13
|
super(roomName, group_type_1.GroupType.Window);
|
|
14
14
|
this.noRolloOnSunrise = noRolloOnSunrise;
|
|
@@ -51,7 +51,7 @@ class Fenster extends base_group_1.BaseGroup {
|
|
|
51
51
|
initialize() {
|
|
52
52
|
this.getHandle().forEach((griff) => {
|
|
53
53
|
griff.addKippCallback((kipp) => {
|
|
54
|
-
if (!(kipp && this.griffeInPosition(models_1.
|
|
54
|
+
if (!(kipp && this.griffeInPosition(models_1.WindowPosition.offen) === 0)) {
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
this.getVibration().forEach((element) => {
|
|
@@ -76,8 +76,8 @@ class Fenster extends base_group_1.BaseGroup {
|
|
|
76
76
|
});
|
|
77
77
|
griff.addClosedCallback((geschlossen) => {
|
|
78
78
|
if (geschlossen &&
|
|
79
|
-
this.griffeInPosition(models_1.
|
|
80
|
-
this.griffeInPosition(models_1.
|
|
79
|
+
this.griffeInPosition(models_1.WindowPosition.offen) === 0 &&
|
|
80
|
+
this.griffeInPosition(models_1.WindowPosition.kipp) === 0) {
|
|
81
81
|
const now = new Date().getTime();
|
|
82
82
|
this.getVibration().forEach((element) => {
|
|
83
83
|
this.log(models_2.LogLevel.Debug, `Starte Timeout für Vibrationsdeaktivierung für ${element.info.customName}`);
|
|
@@ -93,10 +93,10 @@ class Fenster extends base_group_1.BaseGroup {
|
|
|
93
93
|
});
|
|
94
94
|
services_1.Utils.guardedTimeout(() => {
|
|
95
95
|
this.getShutter().forEach((shutter) => {
|
|
96
|
-
shutter.
|
|
96
|
+
shutter.window = this;
|
|
97
97
|
});
|
|
98
98
|
this.getHandle().forEach((g) => {
|
|
99
|
-
g.
|
|
99
|
+
g.window = this;
|
|
100
100
|
});
|
|
101
101
|
}, 5, this);
|
|
102
102
|
}
|
|
@@ -110,4 +110,4 @@ class Fenster extends base_group_1.BaseGroup {
|
|
|
110
110
|
services_1.ShutterService.windowAllToPosition(this, this.desiredPosition, false);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
exports.
|
|
113
|
+
exports.Window = Window;
|
|
@@ -15,8 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./base-group"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./Window"), exports);
|
|
19
|
+
__exportStar(require("./windowGroup"), exports);
|
|
20
20
|
__exportStar(require("./group-type"), exports);
|
|
21
21
|
__exportStar(require("./heatGroup"), exports);
|
|
22
22
|
__exportStar(require("./lampenGroup"), exports);
|
|
@@ -28,7 +28,7 @@ class PraesenzGroup extends base_group_1.BaseGroup {
|
|
|
28
28
|
services_1.RoomService.startIntrusionAlarm(this.getRoom(), b);
|
|
29
29
|
}
|
|
30
30
|
if (!b.settings.seesWindow) {
|
|
31
|
-
(_a = this.getRoom().
|
|
31
|
+
(_a = this.getRoom().WindowGroup) === null || _a === void 0 ? void 0 : _a.changeVibrationMotionBlock(true);
|
|
32
32
|
}
|
|
33
33
|
services_1.RoomService.movementHistory.add(`${services_1.Utils.nowString()}: Raum "${this.roomName}" Gerät "${b.info.fullName}"`);
|
|
34
34
|
});
|
|
@@ -78,7 +78,7 @@ class PraesenzGroup extends base_group_1.BaseGroup {
|
|
|
78
78
|
let timeAfterReset = services_1.Utils.nowMS() - this._lastMovement.getTime() - this.getRoom().settings.movementResetTimer * 1000;
|
|
79
79
|
if (timeAfterReset > 0) {
|
|
80
80
|
this.log(models_1.LogLevel.Debug, `Movement reset. Active Motions: ${this.presentAmount()}\tTime after Last Movement including Reset: ${timeAfterReset}`);
|
|
81
|
-
(_a = this.getRoom().
|
|
81
|
+
(_a = this.getRoom().WindowGroup) === null || _a === void 0 ? void 0 : _a.changeVibrationMotionBlock(false);
|
|
82
82
|
cb();
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
@@ -90,7 +90,7 @@ class PraesenzGroup extends base_group_1.BaseGroup {
|
|
|
90
90
|
services_1.Utils.nowMS() - this._lastMovement.getTime() - this.getRoom().settings.movementResetTimer * 1000;
|
|
91
91
|
this.log(models_1.LogLevel.Debug, `Delayed Movement reset. Active Motions: ${this.presentAmount()}\tTime after Last Movement including Reset: ${timeAfterReset}`);
|
|
92
92
|
if (!this.anyPresent() && timeAfterReset > 0) {
|
|
93
|
-
(_a = this.getRoom().
|
|
93
|
+
(_a = this.getRoom().WindowGroup) === null || _a === void 0 ? void 0 : _a.changeVibrationMotionBlock(false);
|
|
94
94
|
cb();
|
|
95
95
|
}
|
|
96
96
|
}, Math.abs(timeAfterReset) + 500, this);
|
|
@@ -20,22 +20,22 @@ class TasterGroup extends base_group_1.BaseGroup {
|
|
|
20
20
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
21
21
|
(_a = t.buttonTopLeft) === null || _a === void 0 ? void 0 : _a.addCb(button_1.ButtonPressType.long, (pValue) => {
|
|
22
22
|
var _a;
|
|
23
|
-
pValue && ((_a = this.getRoom().
|
|
23
|
+
pValue && ((_a = this.getRoom().WindowGroup) === null || _a === void 0 ? void 0 : _a.allRolloDown(false, true));
|
|
24
24
|
}, `Close all Rollos in this room`);
|
|
25
25
|
(_b = t.buttonTopLeft) === null || _b === void 0 ? void 0 : _b.addCb(button_1.ButtonPressType.short, (pValue) => {
|
|
26
26
|
var _a;
|
|
27
|
-
pValue && ((_a = this.getRoom().
|
|
27
|
+
pValue && ((_a = this.getRoom().WindowGroup) === null || _a === void 0 ? void 0 : _a.allRolloToLevel(25, true));
|
|
28
28
|
}, `Nearly closes all Rollos in this room`);
|
|
29
29
|
(_c = t.buttonTopRight) === null || _c === void 0 ? void 0 : _c.addCb(button_1.ButtonPressType.long, (pValue) => {
|
|
30
30
|
var _a;
|
|
31
31
|
if (!pValue) {
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
(_a = this.getRoom().
|
|
34
|
+
(_a = this.getRoom().WindowGroup) === null || _a === void 0 ? void 0 : _a.allRolloUp(true);
|
|
35
35
|
}, `Open all Rollos in this room`);
|
|
36
36
|
(_d = t.buttonTopRight) === null || _d === void 0 ? void 0 : _d.addCb(button_1.ButtonPressType.short, (pValue) => {
|
|
37
37
|
var _a;
|
|
38
|
-
pValue && ((_a = this.getRoom().
|
|
38
|
+
pValue && ((_a = this.getRoom().WindowGroup) === null || _a === void 0 ? void 0 : _a.allRolloToLevel(50, true));
|
|
39
39
|
}, `All Rollos in this room to middle`);
|
|
40
40
|
(_e = t.buttonMidLeft) === null || _e === void 0 ? void 0 : _e.addCb(button_1.ButtonPressType.long, (pValue) => {
|
|
41
41
|
var _a;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Window } from './Window';
|
|
2
2
|
import { BaseGroup } from './base-group';
|
|
3
|
-
export declare class
|
|
4
|
-
|
|
5
|
-
constructor(roomName: string,
|
|
3
|
+
export declare class WindowGroup extends BaseGroup {
|
|
4
|
+
windows: Window[];
|
|
5
|
+
constructor(roomName: string, windows: Window[]);
|
|
6
6
|
allRolloDown(initial?: boolean, savePosition?: boolean): void;
|
|
7
7
|
allRolloUp(savePosition?: boolean): void;
|
|
8
8
|
allRolloToLevel(level: number, savePosition?: boolean): void;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.WindowGroup = void 0;
|
|
4
4
|
const models_1 = require("../../../models");
|
|
5
5
|
const services_1 = require("../../services");
|
|
6
6
|
const models_2 = require("../models");
|
|
7
7
|
const base_group_1 = require("./base-group");
|
|
8
8
|
const group_type_1 = require("./group-type");
|
|
9
|
-
class
|
|
10
|
-
constructor(roomName,
|
|
9
|
+
class WindowGroup extends base_group_1.BaseGroup {
|
|
10
|
+
constructor(roomName, windows) {
|
|
11
11
|
super(roomName, group_type_1.GroupType.WindowGroup);
|
|
12
|
-
this.
|
|
12
|
+
this.windows = windows;
|
|
13
13
|
}
|
|
14
14
|
allRolloDown(initial = false, savePosition = false) {
|
|
15
|
-
this.
|
|
15
|
+
this.windows.forEach((f) => {
|
|
16
16
|
if (savePosition)
|
|
17
17
|
f.desiredPosition = 0;
|
|
18
18
|
services_1.ShutterService.windowAllDown(f, initial);
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
allRolloUp(savePosition = false) {
|
|
22
|
-
this.
|
|
22
|
+
this.windows.forEach((f) => {
|
|
23
23
|
if (savePosition) {
|
|
24
24
|
f.desiredPosition = 100;
|
|
25
25
|
}
|
|
@@ -27,7 +27,7 @@ class FensterGroup extends base_group_1.BaseGroup {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
allRolloToLevel(level, savePosition = false) {
|
|
30
|
-
this.
|
|
30
|
+
this.windows.forEach((f) => {
|
|
31
31
|
if (savePosition) {
|
|
32
32
|
f.desiredPosition = level;
|
|
33
33
|
}
|
|
@@ -65,7 +65,7 @@ class FensterGroup extends base_group_1.BaseGroup {
|
|
|
65
65
|
services_1.Utils.guardedInterval(this.setRolloByWeatherStatus, 15 * 60 * 1000, this, false);
|
|
66
66
|
services_1.Utils.guardedTimeout(this.setRolloByWeatherStatus, 2 * 60 * 1000, this);
|
|
67
67
|
}
|
|
68
|
-
this.
|
|
68
|
+
this.windows.forEach((f) => {
|
|
69
69
|
f.initialize();
|
|
70
70
|
});
|
|
71
71
|
}
|
|
@@ -73,7 +73,7 @@ class FensterGroup extends base_group_1.BaseGroup {
|
|
|
73
73
|
const room = this.getRoom();
|
|
74
74
|
const timeOfDay = services_1.TimeCallbackService.dayType(room.settings.rolloOffset);
|
|
75
75
|
const darkOutside = services_1.TimeCallbackService.darkOutsideOrNight(timeOfDay);
|
|
76
|
-
this.
|
|
76
|
+
this.windows.forEach((f) => {
|
|
77
77
|
var _a, _b, _c, _d;
|
|
78
78
|
if (f.getShutter().length === 0) {
|
|
79
79
|
return;
|
|
@@ -86,17 +86,17 @@ class FensterGroup extends base_group_1.BaseGroup {
|
|
|
86
86
|
if (desiredPos > 0) {
|
|
87
87
|
desiredPos = services_1.WeatherService.weatherRolloPosition(desiredPos, (_b = (_a = room.HeatGroup) === null || _a === void 0 ? void 0 : _a.desiredTemp) !== null && _b !== void 0 ? _b : -99, (_d = (_c = room.HeatGroup) === null || _c === void 0 ? void 0 : _c.temperature) !== null && _d !== void 0 ? _d : -99, this.log.bind(this), f.settings.direction);
|
|
88
88
|
}
|
|
89
|
-
if (f.griffeInPosition(models_2.
|
|
89
|
+
if (f.griffeInPosition(models_2.WindowPosition.offen) > 0 && desiredPos < 100) {
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
|
-
if (f.griffeInPosition(models_2.
|
|
92
|
+
if (f.griffeInPosition(models_2.WindowPosition.kipp) > 0) {
|
|
93
93
|
desiredPos = Math.max(30, desiredPos);
|
|
94
94
|
}
|
|
95
95
|
services_1.ShutterService.windowAllToPosition(f, desiredPos, false, true);
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
sunriseUp(initial = false) {
|
|
99
|
-
this.
|
|
99
|
+
this.windows.forEach((f) => {
|
|
100
100
|
if (f.noRolloOnSunrise || f.getShutter().length === 0) {
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
@@ -106,7 +106,7 @@ class FensterGroup extends base_group_1.BaseGroup {
|
|
|
106
106
|
}
|
|
107
107
|
restoreRolloPosition(recalc = false) {
|
|
108
108
|
if (!recalc) {
|
|
109
|
-
this.
|
|
109
|
+
this.windows.forEach((f) => {
|
|
110
110
|
f.restoreDesiredPosition();
|
|
111
111
|
});
|
|
112
112
|
return;
|
|
@@ -119,7 +119,7 @@ class FensterGroup extends base_group_1.BaseGroup {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
changeVibrationMotionBlock(block) {
|
|
122
|
-
this.
|
|
122
|
+
this.windows.forEach((f) => {
|
|
123
123
|
if (f.getVibration().length === 0) {
|
|
124
124
|
return;
|
|
125
125
|
}
|
|
@@ -137,4 +137,4 @@ class FensterGroup extends base_group_1.BaseGroup {
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
exports.
|
|
140
|
+
exports.WindowGroup = WindowGroup;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
/// <reference types="iobroker" />
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { WindowPosition } from '../models';
|
|
3
|
+
import { Window } from '../groups';
|
|
4
4
|
import { IoBrokerBaseDevice } from '../IoBrokerBaseDevice';
|
|
5
5
|
import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
|
|
6
6
|
import { HmIPDevice } from './hmIpDevice';
|
|
7
7
|
import { iBatteryDevice, iHandleSensor } from '../baseDeviceInterfaces';
|
|
8
8
|
export declare class HmIpGriff extends HmIPDevice implements iHandleSensor, iBatteryDevice {
|
|
9
9
|
battery: number;
|
|
10
|
-
position:
|
|
10
|
+
position: WindowPosition;
|
|
11
11
|
private _kippCallback;
|
|
12
12
|
private _closedCallback;
|
|
13
13
|
private _offenCallback;
|
|
14
14
|
private _iOpenTimeout;
|
|
15
15
|
minutesOpen: number;
|
|
16
|
-
private
|
|
16
|
+
private _window;
|
|
17
17
|
private _helpingRoomTemp;
|
|
18
18
|
constructor(pInfo: IoBrokerDeviceInfo);
|
|
19
|
-
set
|
|
19
|
+
set window(value: Window);
|
|
20
20
|
addOffenCallback(pCallback: (pValue: boolean) => void): void;
|
|
21
21
|
addKippCallback(pCallback: (pValue: boolean) => void): void;
|
|
22
22
|
addClosedCallback(pCallback: (pValue: boolean) => void): void;
|
|
23
23
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
24
|
-
updatePosition(pValue:
|
|
24
|
+
updatePosition(pValue: WindowPosition): void;
|
|
25
25
|
toJSON(): Partial<IoBrokerBaseDevice>;
|
|
26
26
|
}
|
|
@@ -15,18 +15,18 @@ class HmIpGriff extends hmIpDevice_1.HmIPDevice {
|
|
|
15
15
|
constructor(pInfo) {
|
|
16
16
|
super(pInfo, deviceType_1.DeviceType.HmIpGriff);
|
|
17
17
|
this.battery = -99;
|
|
18
|
-
this.position = models_1.
|
|
18
|
+
this.position = models_1.WindowPosition.geschlossen;
|
|
19
19
|
this._kippCallback = [];
|
|
20
20
|
this._closedCallback = [];
|
|
21
21
|
this._offenCallback = [];
|
|
22
22
|
this.minutesOpen = 0;
|
|
23
|
-
this.
|
|
23
|
+
this._window = undefined;
|
|
24
24
|
this._helpingRoomTemp = false;
|
|
25
25
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.handleSensor);
|
|
26
26
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.batteryDriven);
|
|
27
27
|
}
|
|
28
|
-
set
|
|
29
|
-
this.
|
|
28
|
+
set window(value) {
|
|
29
|
+
this._window = value;
|
|
30
30
|
}
|
|
31
31
|
addOffenCallback(pCallback) {
|
|
32
32
|
this._offenCallback.push(pCallback);
|
|
@@ -64,7 +64,7 @@ class HmIpGriff extends hmIpDevice_1.HmIPDevice {
|
|
|
64
64
|
if (pValue === this.position) {
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
this.log(models_2.LogLevel.Trace, `Update
|
|
67
|
+
this.log(models_2.LogLevel.Trace, `Update Windowhandle to position "${models_1.WindowPosition[pValue]}"`);
|
|
68
68
|
this.position = pValue;
|
|
69
69
|
for (const c1 of this._closedCallback) {
|
|
70
70
|
c1(pValue === 0);
|
|
@@ -75,10 +75,10 @@ class HmIpGriff extends hmIpDevice_1.HmIPDevice {
|
|
|
75
75
|
for (const c3 of this._offenCallback) {
|
|
76
76
|
c3(pValue === 2);
|
|
77
77
|
}
|
|
78
|
-
if (pValue === models_1.
|
|
78
|
+
if (pValue === models_1.WindowPosition.geschlossen) {
|
|
79
79
|
if (this._iOpenTimeout !== undefined) {
|
|
80
80
|
clearInterval(this._iOpenTimeout);
|
|
81
|
-
this.log(models_2.LogLevel.Info, `
|
|
81
|
+
this.log(models_2.LogLevel.Info, `Window closed after ${this.minutesOpen} minutes`);
|
|
82
82
|
this.minutesOpen = 0;
|
|
83
83
|
this._iOpenTimeout = undefined;
|
|
84
84
|
}
|
|
@@ -88,7 +88,7 @@ class HmIpGriff extends hmIpDevice_1.HmIPDevice {
|
|
|
88
88
|
this._iOpenTimeout = services_1.Utils.guardedInterval(() => {
|
|
89
89
|
var _a;
|
|
90
90
|
this.minutesOpen++;
|
|
91
|
-
const heatgroup = (_a = this.
|
|
91
|
+
const heatgroup = (_a = this._window) === null || _a === void 0 ? void 0 : _a.getRoom().HeatGroup;
|
|
92
92
|
if (heatgroup !== undefined) {
|
|
93
93
|
const desiredTemp = heatgroup.desiredTemp;
|
|
94
94
|
const currentTemp = heatgroup.temperature;
|
|
@@ -98,7 +98,7 @@ class HmIpGriff extends hmIpDevice_1.HmIPDevice {
|
|
|
98
98
|
const wouldHelp = (desiredTemp < currentTemp && outSideTemp < currentTemp) ||
|
|
99
99
|
(desiredTemp > currentTemp && outSideTemp > currentTemp);
|
|
100
100
|
if (!wouldHelp && this._helpingRoomTemp) {
|
|
101
|
-
const info = `
|
|
101
|
+
const info = `Window should be closed, as it doesn't help reaching target temperature.`;
|
|
102
102
|
this.log(models_2.LogLevel.Info, info);
|
|
103
103
|
services_1.TelegramService.inform(info);
|
|
104
104
|
this._helpingRoomTemp = false;
|
|
@@ -115,7 +115,7 @@ class HmIpGriff extends hmIpDevice_1.HmIPDevice {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
const message = `
|
|
118
|
+
const message = `Window is in position ${models_1.WindowPosition[this.position]} since ${this.minutesOpen} minutes`;
|
|
119
119
|
switch (this.minutesOpen) {
|
|
120
120
|
case 15:
|
|
121
121
|
case 30:
|
|
@@ -133,7 +133,7 @@ class HmIpGriff extends hmIpDevice_1.HmIPDevice {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
toJSON() {
|
|
136
|
-
return lodash_1.default.omit(super.toJSON(), ['
|
|
136
|
+
return lodash_1.default.omit(super.toJSON(), ['_window']);
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
exports.HmIpGriff = HmIpGriff;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="iobroker" />
|
|
2
2
|
import { HmIPDevice } from './hmIpDevice';
|
|
3
|
-
import {
|
|
3
|
+
import { Window } from '../groups';
|
|
4
4
|
import { iShutter } from '../baseDeviceInterfaces';
|
|
5
5
|
import { IoBrokerBaseDevice } from '../IoBrokerBaseDevice';
|
|
6
6
|
import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
|
|
@@ -13,10 +13,10 @@ export declare class HmIpRoll extends HmIPDevice implements iShutter {
|
|
|
13
13
|
private _currentLevel;
|
|
14
14
|
get currentLevel(): number;
|
|
15
15
|
set currentLevel(value: number);
|
|
16
|
-
private
|
|
17
|
-
get
|
|
18
|
-
set
|
|
19
|
-
get
|
|
16
|
+
private _window?;
|
|
17
|
+
get window(): Window | undefined;
|
|
18
|
+
set window(value: Window | undefined);
|
|
19
|
+
get desiredWindowShutterLevel(): number;
|
|
20
20
|
persist(): void;
|
|
21
21
|
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
22
22
|
setLevel(pPosition: number, initial?: boolean, skipOpenWarning?: boolean): void;
|
|
@@ -13,6 +13,7 @@ const lodash_1 = __importDefault(require("lodash"));
|
|
|
13
13
|
const DeviceCapability_1 = require("../DeviceCapability");
|
|
14
14
|
class HmIpRoll extends hmIpDevice_1.HmIPDevice {
|
|
15
15
|
constructor(pInfo) {
|
|
16
|
+
var _a;
|
|
16
17
|
super(pInfo, deviceType_1.DeviceType.HmIpRoll);
|
|
17
18
|
this._firstCommandRecieved = false;
|
|
18
19
|
this._setLevel = -1;
|
|
@@ -20,6 +21,13 @@ class HmIpRoll extends hmIpDevice_1.HmIPDevice {
|
|
|
20
21
|
this._currentLevel = -1;
|
|
21
22
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.shutter);
|
|
22
23
|
this._setLevelSwitchID = `${this.info.fullID}.4.LEVEL`;
|
|
24
|
+
(_a = services_1.Utils.dbo) === null || _a === void 0 ? void 0 : _a.getLastDesiredPosition(this).then((val) => {
|
|
25
|
+
var _a;
|
|
26
|
+
if (val.desiredPosition === -1) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
(_a = this._window) === null || _a === void 0 ? void 0 : _a.setDesiredPosition(val.desiredPosition);
|
|
30
|
+
});
|
|
23
31
|
}
|
|
24
32
|
get currentLevel() {
|
|
25
33
|
if (this._setLevel !== -1 && this._currentLevel !== this._setLevel) {
|
|
@@ -31,26 +39,26 @@ class HmIpRoll extends hmIpDevice_1.HmIPDevice {
|
|
|
31
39
|
if (value !== this._setLevel && services_1.Utils.nowMS() - this._setLevelTime < 60 * 10000) {
|
|
32
40
|
value = this._setLevel;
|
|
33
41
|
}
|
|
34
|
-
if (value !== this._currentLevel && this.
|
|
42
|
+
if (value !== this._currentLevel && this._window) {
|
|
35
43
|
services_1.Utils.guardedNewThread(() => {
|
|
36
44
|
var _a;
|
|
37
|
-
(_a = this.
|
|
45
|
+
(_a = this._window) === null || _a === void 0 ? void 0 : _a.rolloPositionChange(value);
|
|
38
46
|
}, this);
|
|
39
47
|
this.persist();
|
|
40
48
|
}
|
|
41
49
|
this._currentLevel = value;
|
|
42
50
|
}
|
|
43
|
-
get
|
|
44
|
-
return this.
|
|
51
|
+
get window() {
|
|
52
|
+
return this._window;
|
|
45
53
|
}
|
|
46
|
-
set
|
|
47
|
-
this.
|
|
54
|
+
set window(value) {
|
|
55
|
+
this._window = value;
|
|
48
56
|
}
|
|
49
|
-
get
|
|
50
|
-
if (this.
|
|
57
|
+
get desiredWindowShutterLevel() {
|
|
58
|
+
if (this._window === undefined) {
|
|
51
59
|
return -1;
|
|
52
60
|
}
|
|
53
|
-
return this.
|
|
61
|
+
return this._window.desiredPosition;
|
|
54
62
|
}
|
|
55
63
|
persist() {
|
|
56
64
|
var _a;
|
|
@@ -86,17 +94,17 @@ class HmIpRoll extends hmIpDevice_1.HmIPDevice {
|
|
|
86
94
|
if (!this.checkIoConnection(true)) {
|
|
87
95
|
return;
|
|
88
96
|
}
|
|
89
|
-
if (this.
|
|
90
|
-
if (this.
|
|
97
|
+
if (this._window !== undefined) {
|
|
98
|
+
if (this._window.griffeInPosition(models_1.WindowPosition.offen) > 0 && pPosition < 100) {
|
|
91
99
|
if (!skipOpenWarning) {
|
|
92
|
-
this.log(models_2.LogLevel.Alert, `
|
|
100
|
+
this.log(models_2.LogLevel.Alert, `Not closing the shutter, as the window is open!`);
|
|
93
101
|
}
|
|
94
102
|
return;
|
|
95
103
|
}
|
|
96
|
-
if (this.
|
|
104
|
+
if (this._window.griffeInPosition(models_1.WindowPosition.kipp) > 0 && pPosition < 50) {
|
|
97
105
|
pPosition = 50;
|
|
98
106
|
if (!skipOpenWarning) {
|
|
99
|
-
this.log(models_2.LogLevel.Alert, `
|
|
107
|
+
this.log(models_2.LogLevel.Alert, `Not closing the shutter, as the window is half open!`);
|
|
100
108
|
}
|
|
101
109
|
}
|
|
102
110
|
}
|
|
@@ -105,7 +113,7 @@ class HmIpRoll extends hmIpDevice_1.HmIPDevice {
|
|
|
105
113
|
this.setState(this._setLevelSwitchID, pPosition);
|
|
106
114
|
}
|
|
107
115
|
toJSON() {
|
|
108
|
-
return lodash_1.default.omit(super.toJSON(), ['
|
|
116
|
+
return lodash_1.default.omit(super.toJSON(), ['_window']);
|
|
109
117
|
}
|
|
110
118
|
}
|
|
111
119
|
exports.HmIpRoll = HmIpRoll;
|