hoffmation-base 2.19.1 → 2.19.2
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/dachs/dachs.d.ts +4 -2
- package/lib/server/devices/dachs/dachs.js +8 -4
- package/lib/server/devices/dachs/{dachsWarmWaterTemperature.d.ts → dachsTemperatureSensor.d.ts} +2 -2
- package/lib/server/devices/dachs/{dachsWarmWaterTemperature.js → dachsTemperatureSensor.js} +8 -8
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -5,18 +5,20 @@ import { LogDebugType, OwnSonosDevice } from '../../services';
|
|
|
5
5
|
import { iDachsSettings } from '../../config/iDachsSettings';
|
|
6
6
|
import { DachsDeviceSettings } from '../../../models/deviceSettings/dachsSettings';
|
|
7
7
|
import { iFlattenedCompleteResponse } from './interfaces';
|
|
8
|
-
import {
|
|
8
|
+
import { DachsTemperatureSensor } from './dachsTemperatureSensor';
|
|
9
9
|
export declare class Dachs implements iBaseDevice, iActuator {
|
|
10
10
|
settings: DachsDeviceSettings;
|
|
11
11
|
readonly deviceType: DeviceType;
|
|
12
12
|
readonly deviceCapabilities: DeviceCapability[];
|
|
13
|
-
readonly warmWaterSensor:
|
|
13
|
+
readonly warmWaterSensor: DachsTemperatureSensor;
|
|
14
|
+
readonly heatStorageTempSensor: DachsTemperatureSensor;
|
|
14
15
|
private readonly client;
|
|
15
16
|
private readonly config;
|
|
16
17
|
fetchedData: iFlattenedCompleteResponse | undefined;
|
|
17
18
|
private readonly _influxClient;
|
|
18
19
|
private _dachsOn;
|
|
19
20
|
private _tempWarmWater;
|
|
21
|
+
private _tempHeatStorage;
|
|
20
22
|
get customName(): string;
|
|
21
23
|
get actuatorOn(): boolean;
|
|
22
24
|
get tempWarmWater(): number;
|
|
@@ -11,7 +11,7 @@ const services_1 = require("../../services");
|
|
|
11
11
|
const lodash_1 = __importDefault(require("lodash"));
|
|
12
12
|
const dachsSettings_1 = require("../../../models/deviceSettings/dachsSettings");
|
|
13
13
|
const lib_1 = require("./lib");
|
|
14
|
-
const
|
|
14
|
+
const dachsTemperatureSensor_1 = require("./dachsTemperatureSensor");
|
|
15
15
|
class Dachs {
|
|
16
16
|
get customName() {
|
|
17
17
|
return this.info.customName;
|
|
@@ -28,6 +28,7 @@ class Dachs {
|
|
|
28
28
|
this.deviceCapabilities = [];
|
|
29
29
|
this._dachsOn = false;
|
|
30
30
|
this._tempWarmWater = 0;
|
|
31
|
+
this._tempHeatStorage = 0;
|
|
31
32
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.actuator);
|
|
32
33
|
this._info = new devices_1.DeviceInfo();
|
|
33
34
|
this._info.fullName = `Dachs`;
|
|
@@ -46,7 +47,8 @@ class Dachs {
|
|
|
46
47
|
};
|
|
47
48
|
this.config = modifiedOptions;
|
|
48
49
|
this.client = new lib_1.DachsHttpClient(this.config.connectionOptions);
|
|
49
|
-
this.warmWaterSensor = new
|
|
50
|
+
this.warmWaterSensor = new dachsTemperatureSensor_1.DachsTemperatureSensor(this.config.roomName, 'ww', 'Water Temperature');
|
|
51
|
+
this.heatStorageTempSensor = new dachsTemperatureSensor_1.DachsTemperatureSensor(this.config.roomName, 'hs', 'Heat Storage Temperature');
|
|
50
52
|
services_1.Utils.guardedInterval(this.loadData, this.config.refreshInterval, this);
|
|
51
53
|
}
|
|
52
54
|
get info() {
|
|
@@ -74,7 +76,7 @@ class Dachs {
|
|
|
74
76
|
});
|
|
75
77
|
}
|
|
76
78
|
toJSON() {
|
|
77
|
-
return services_1.Utils.jsonFilter(lodash_1.default.omit(this, ['room', 'client', 'config', '_influxClient', 'warmWaterSensor']));
|
|
79
|
+
return services_1.Utils.jsonFilter(lodash_1.default.omit(this, ['room', 'client', 'config', '_influxClient', 'warmWaterSensor', 'heatStorageTempSensor']));
|
|
78
80
|
}
|
|
79
81
|
persistDeviceInfo() {
|
|
80
82
|
services_1.Utils.guardedTimeout(() => {
|
|
@@ -87,7 +89,7 @@ class Dachs {
|
|
|
87
89
|
}
|
|
88
90
|
loadData() {
|
|
89
91
|
this.client.fetchAllKeys().then((data) => {
|
|
90
|
-
var _a;
|
|
92
|
+
var _a, _b;
|
|
91
93
|
this.fetchedData = data;
|
|
92
94
|
if (this._influxClient === undefined) {
|
|
93
95
|
return;
|
|
@@ -104,6 +106,8 @@ class Dachs {
|
|
|
104
106
|
this._dachsOn = this.fetchedData['Hka_Mw1.usDrehzahl'] >= 1;
|
|
105
107
|
this._tempWarmWater = (_a = this.fetchedData['Hka_Mw1.Temp.sbZS_Warmwasser']) !== null && _a !== void 0 ? _a : 0;
|
|
106
108
|
this.warmWaterSensor.update(this._tempWarmWater);
|
|
109
|
+
this._tempHeatStorage = (_b = this.fetchedData['Hka_Mw1.Temp.sbFuehler1']) !== null && _b !== void 0 ? _b : 0;
|
|
110
|
+
this.heatStorageTempSensor.update(this._tempHeatStorage);
|
|
107
111
|
this.persist();
|
|
108
112
|
});
|
|
109
113
|
}
|
package/lib/server/devices/dachs/{dachsWarmWaterTemperature.d.ts → dachsTemperatureSensor.d.ts}
RENAMED
|
@@ -5,7 +5,7 @@ import { DeviceCapability } from '../DeviceCapability';
|
|
|
5
5
|
import { DeviceType } from '../deviceType';
|
|
6
6
|
import { DeviceInfo } from '../DeviceInfo';
|
|
7
7
|
import { DeviceSettings, LogLevel, RoomBase } from '../../../models';
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class DachsTemperatureSensor implements iTemperatureSensor {
|
|
9
9
|
settings: DeviceSettings | undefined;
|
|
10
10
|
readonly deviceType: DeviceType;
|
|
11
11
|
readonly deviceCapabilities: DeviceCapability[];
|
|
@@ -13,7 +13,7 @@ export declare class DachsWarmWaterTemperature implements iTemperatureSensor {
|
|
|
13
13
|
private _temperaturCallbacks;
|
|
14
14
|
private _roomTemperature;
|
|
15
15
|
protected _info: DeviceInfo;
|
|
16
|
-
constructor(roomName: string);
|
|
16
|
+
constructor(roomName: string, shortKey: string, longKey: string);
|
|
17
17
|
get customName(): string;
|
|
18
18
|
get info(): DeviceInfo;
|
|
19
19
|
set info(info: DeviceInfo);
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.DachsTemperatureSensor = void 0;
|
|
7
7
|
const baseDeviceInterfaces_1 = require("../baseDeviceInterfaces");
|
|
8
8
|
const services_1 = require("../../services");
|
|
9
9
|
const DeviceCapability_1 = require("../DeviceCapability");
|
|
@@ -11,8 +11,8 @@ const deviceType_1 = require("../deviceType");
|
|
|
11
11
|
const DeviceInfo_1 = require("../DeviceInfo");
|
|
12
12
|
const devices_1 = require("../devices");
|
|
13
13
|
const lodash_1 = __importDefault(require("lodash"));
|
|
14
|
-
class
|
|
15
|
-
constructor(roomName) {
|
|
14
|
+
class DachsTemperatureSensor {
|
|
15
|
+
constructor(roomName, shortKey, longKey) {
|
|
16
16
|
this.settings = undefined;
|
|
17
17
|
this.deviceType = deviceType_1.DeviceType.DachsWarmWaterTemperature;
|
|
18
18
|
this.deviceCapabilities = [];
|
|
@@ -24,9 +24,9 @@ class DachsWarmWaterTemperature {
|
|
|
24
24
|
this._temperature = baseDeviceInterfaces_1.UNDEFINED_TEMP_VALUE;
|
|
25
25
|
this.deviceCapabilities.push(DeviceCapability_1.DeviceCapability.temperatureSensor);
|
|
26
26
|
this._info = new DeviceInfo_1.DeviceInfo();
|
|
27
|
-
this._info.fullName =
|
|
28
|
-
this._info.customName =
|
|
29
|
-
this._info.allDevicesKey = `dachs
|
|
27
|
+
this._info.fullName = longKey;
|
|
28
|
+
this._info.customName = `${longKey} ${roomName}`;
|
|
29
|
+
this._info.allDevicesKey = `dachs-${shortKey}-${roomName}`;
|
|
30
30
|
this._info.room = roomName;
|
|
31
31
|
devices_1.Devices.alLDevices[this._info.allDevicesKey] = this;
|
|
32
32
|
devices_1.Devices.temperatureWarmWater = this;
|
|
@@ -44,7 +44,7 @@ class DachsWarmWaterTemperature {
|
|
|
44
44
|
}
|
|
45
45
|
get id() {
|
|
46
46
|
var _a;
|
|
47
|
-
return (_a = this.info.allDevicesKey) !== null && _a !== void 0 ? _a : `
|
|
47
|
+
return (_a = this.info.allDevicesKey) !== null && _a !== void 0 ? _a : `dachs-${this.info.room}-${this.info.customName}`;
|
|
48
48
|
}
|
|
49
49
|
get name() {
|
|
50
50
|
return this.info.customName;
|
|
@@ -113,4 +113,4 @@ class DachsWarmWaterTemperature {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
exports.
|
|
116
|
+
exports.DachsTemperatureSensor = DachsTemperatureSensor;
|