hoffmation-base 2.16.0 → 2.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/server/devices/IoBrokerDeviceInfo.d.ts +2 -0
- package/lib/server/devices/IoBrokerDeviceInfo.js +11 -1
- package/lib/server/devices/deviceUpdater.js +3 -2
- package/lib/server/devices/shelly/shellyTrv.d.ts +1 -1
- package/lib/server/devices/shelly/shellyTrv.js +11 -4
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -9,6 +9,8 @@ export declare class IoBrokerDeviceInfo extends DeviceInfo {
|
|
|
9
9
|
channel?: number;
|
|
10
10
|
valueName?: string;
|
|
11
11
|
devConf: deviceConfig;
|
|
12
|
+
static idSplitter(id: string): string[];
|
|
13
|
+
private static replaceInvalidIdChars;
|
|
12
14
|
/**
|
|
13
15
|
* Extracts the relevant infos from the passed deviceConfig and combines them in a new Info object
|
|
14
16
|
* @param {deviceConfig} pDevConf The device Config based on the extracted devices.json from ioBroker
|
|
@@ -7,6 +7,16 @@ exports.IoBrokerDeviceInfo = void 0;
|
|
|
7
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
8
|
const DeviceInfo_1 = require("./DeviceInfo");
|
|
9
9
|
class IoBrokerDeviceInfo extends DeviceInfo_1.DeviceInfo {
|
|
10
|
+
static idSplitter(id) {
|
|
11
|
+
const split = id.split('.');
|
|
12
|
+
if (split[2] !== undefined) {
|
|
13
|
+
split[2] = this.replaceInvalidIdChars(split[2]);
|
|
14
|
+
}
|
|
15
|
+
return split;
|
|
16
|
+
}
|
|
17
|
+
static replaceInvalidIdChars(idPart) {
|
|
18
|
+
return idPart.replace(/[#\-]/g, '_');
|
|
19
|
+
}
|
|
10
20
|
/**
|
|
11
21
|
* Extracts the relevant infos from the passed deviceConfig and combines them in a new Info object
|
|
12
22
|
* @param {deviceConfig} pDevConf The device Config based on the extracted devices.json from ioBroker
|
|
@@ -17,7 +27,7 @@ class IoBrokerDeviceInfo extends DeviceInfo_1.DeviceInfo {
|
|
|
17
27
|
super();
|
|
18
28
|
this.devConf = pDevConf;
|
|
19
29
|
this.type = pDevConf.type;
|
|
20
|
-
const idSplit = pDevConf._id
|
|
30
|
+
const idSplit = IoBrokerDeviceInfo.idSplitter(pDevConf._id);
|
|
21
31
|
this.fullID = pDevConf._id;
|
|
22
32
|
this.devID = idSplit[2];
|
|
23
33
|
this.fullName = pDevConf.common.name;
|
|
@@ -5,12 +5,13 @@ const services_1 = require("../services");
|
|
|
5
5
|
const models_1 = require("../../models");
|
|
6
6
|
const devices_1 = require("./devices");
|
|
7
7
|
const mqtt_1 = require("./mqtt");
|
|
8
|
+
const IoBrokerDeviceInfo_1 = require("./IoBrokerDeviceInfo");
|
|
8
9
|
class DeviceUpdater {
|
|
9
10
|
constructor(pDevices) {
|
|
10
11
|
this.devices = pDevices;
|
|
11
12
|
}
|
|
12
13
|
updateObject(pId, pObj) {
|
|
13
|
-
const idSplit =
|
|
14
|
+
const idSplit = IoBrokerDeviceInfo_1.IoBrokerDeviceInfo.idSplitter(pId);
|
|
14
15
|
if (idSplit.length < 2)
|
|
15
16
|
return;
|
|
16
17
|
if (idSplit[0] === devices_1.Devices.IDENTIFIER_HOMEMATIC) {
|
|
@@ -23,7 +24,7 @@ class DeviceUpdater {
|
|
|
23
24
|
// Ignore null states
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
26
|
-
const idSplit =
|
|
27
|
+
const idSplit = IoBrokerDeviceInfo_1.IoBrokerDeviceInfo.idSplitter(id);
|
|
27
28
|
if (idSplit.length < 2)
|
|
28
29
|
return;
|
|
29
30
|
if (idSplit[0] == 'mqtt') {
|
|
@@ -47,7 +47,7 @@ export declare class ShellyTrv extends ShellyDevice implements iHeater {
|
|
|
47
47
|
stopAutomaticCheck(): void;
|
|
48
48
|
onTemperaturChange(newTemperatur: number): void;
|
|
49
49
|
persistHeater(): void;
|
|
50
|
-
update(idSplit: string[], state: ioBroker.State, initial?: boolean
|
|
50
|
+
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
51
51
|
protected getNextPidLevel(): number;
|
|
52
52
|
private checkSeasonTurnOff;
|
|
53
53
|
persistBatteryDevice(): void;
|
|
@@ -123,13 +123,20 @@ class ShellyTrv extends shellyDevice_1.ShellyDevice {
|
|
|
123
123
|
if (!this._initialSeasonCheckDone) {
|
|
124
124
|
this.checkSeasonTurnOff();
|
|
125
125
|
}
|
|
126
|
-
|
|
127
|
-
if (!this.settings.automaticMode || this.seasonTurnOff || (heatGroupSettings === null || heatGroupSettings === void 0 ? void 0 : heatGroupSettings.automaticMode) === false) {
|
|
126
|
+
if (this.seasonTurnOff) {
|
|
128
127
|
return;
|
|
129
128
|
}
|
|
130
129
|
if (!this.settings.useOwnTemperatur && !this.settings.controlByPid) {
|
|
131
130
|
this.setExternalTemperatureEnabled(true);
|
|
132
131
|
}
|
|
132
|
+
const heatGroupSettings = (_b = (_a = this.room) === null || _a === void 0 ? void 0 : _a.HeatGroup) === null || _b === void 0 ? void 0 : _b.settings;
|
|
133
|
+
if ((heatGroupSettings === null || heatGroupSettings === void 0 ? void 0 : heatGroupSettings.automaticMode) == false) {
|
|
134
|
+
this.desiredTemperature = heatGroupSettings.manualTemperature;
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (!this.settings.automaticMode) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
133
140
|
const setting = models_1.TemperatureSettings.getActiveSetting((_f = (_e = (_d = (_c = this.room) === null || _c === void 0 ? void 0 : _c.HeatGroup) === null || _d === void 0 ? void 0 : _d.settings) === null || _e === void 0 ? void 0 : _e.automaticPoints) !== null && _f !== void 0 ? _f : [], new Date());
|
|
134
141
|
if (setting === undefined) {
|
|
135
142
|
this.log(models_1.LogLevel.Warn, `Undefined Heating Timestamp.`);
|
|
@@ -154,7 +161,7 @@ class ShellyTrv extends shellyDevice_1.ShellyDevice {
|
|
|
154
161
|
var _a;
|
|
155
162
|
(_a = services_1.Utils.dbo) === null || _a === void 0 ? void 0 : _a.persistHeater(this);
|
|
156
163
|
}
|
|
157
|
-
update(idSplit, state, initial = false
|
|
164
|
+
update(idSplit, state, initial = false) {
|
|
158
165
|
const fullId = idSplit.join('.');
|
|
159
166
|
switch (fullId) {
|
|
160
167
|
case this._valvePosId:
|
|
@@ -185,7 +192,7 @@ class ShellyTrv extends shellyDevice_1.ShellyDevice {
|
|
|
185
192
|
}
|
|
186
193
|
break;
|
|
187
194
|
}
|
|
188
|
-
super.update(idSplit, state, initial,
|
|
195
|
+
super.update(idSplit, state, initial, true);
|
|
189
196
|
}
|
|
190
197
|
getNextPidLevel() {
|
|
191
198
|
if (this.seasonTurnOff || this._roomTemperature < 0) {
|