hoffmation-base 3.2.10-alpha.5 → 3.2.10
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/devices/device-cluster.js +1 -0
- package/lib/devices/devices.js +3 -0
- package/lib/devices/zigbee/index.d.ts +1 -0
- package/lib/devices/zigbee/index.js +1 -0
- package/lib/devices/zigbee/zigbeeAqaraPresence.d.ts +7 -0
- package/lib/devices/zigbee/zigbeeAqaraPresence.js +22 -0
- package/lib/enums/deviceType.d.ts +1 -0
- package/lib/enums/deviceType.js +1 -0
- package/lib/services/weather/weather-service.d.ts +13 -0
- package/lib/services/weather/weather-service.js +31 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -78,6 +78,7 @@ class DeviceCluster {
|
|
|
78
78
|
break;
|
|
79
79
|
case enums_1.DeviceType.HmIpBewegung:
|
|
80
80
|
case enums_1.DeviceType.ZigbeeAquaraMotion:
|
|
81
|
+
case enums_1.DeviceType.ZigbeeAqaraPresence:
|
|
81
82
|
case enums_1.DeviceType.ZigbeeSonoffMotion:
|
|
82
83
|
case enums_1.DeviceType.ZigbeeTuyaMotion:
|
|
83
84
|
case enums_1.DeviceType.HmIpPraezenz:
|
package/lib/devices/devices.js
CHANGED
|
@@ -158,6 +158,9 @@ class Devices {
|
|
|
158
158
|
case 'AquaraMotion':
|
|
159
159
|
d = new zigbee_1.ZigbeeAquaraMotion(zigbeeInfo);
|
|
160
160
|
break;
|
|
161
|
+
case 'AqaraFp1':
|
|
162
|
+
d = new zigbee_1.ZigbeeAqaraPresence(zigbeeInfo);
|
|
163
|
+
break;
|
|
161
164
|
case 'AquaraVibra':
|
|
162
165
|
d = new zigbee_1.ZigbeeAquaraVibra(zigbeeInfo);
|
|
163
166
|
break;
|
|
@@ -2,6 +2,7 @@ export * from './BaseDevices';
|
|
|
2
2
|
export * from './zigbeeAqaraMagnetContact';
|
|
3
3
|
export * from './zigbeeAqaraOpple3Switch';
|
|
4
4
|
export * from './zigbeeAquaraMotion';
|
|
5
|
+
export * from './zigbeeAqaraPresence';
|
|
5
6
|
export * from './zigbeeAquaraVibra';
|
|
6
7
|
export * from './zigbeeAquaraWater';
|
|
7
8
|
export * from './zigbeeBlitzShp';
|
|
@@ -19,6 +19,7 @@ __exportStar(require("./BaseDevices"), exports);
|
|
|
19
19
|
__exportStar(require("./zigbeeAqaraMagnetContact"), exports);
|
|
20
20
|
__exportStar(require("./zigbeeAqaraOpple3Switch"), exports);
|
|
21
21
|
__exportStar(require("./zigbeeAquaraMotion"), exports);
|
|
22
|
+
__exportStar(require("./zigbeeAqaraPresence"), exports);
|
|
22
23
|
__exportStar(require("./zigbeeAquaraVibra"), exports);
|
|
23
24
|
__exportStar(require("./zigbeeAquaraWater"), exports);
|
|
24
25
|
__exportStar(require("./zigbeeBlitzShp"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
|
|
2
|
+
import { ZigbeeMotionSensor } from './BaseDevices';
|
|
3
|
+
export declare class ZigbeeAqaraPresence extends ZigbeeMotionSensor {
|
|
4
|
+
constructor(pInfo: IoBrokerDeviceInfo);
|
|
5
|
+
/** @inheritDoc */
|
|
6
|
+
update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ZigbeeAqaraPresence = void 0;
|
|
4
|
+
const BaseDevices_1 = require("./BaseDevices");
|
|
5
|
+
const enums_1 = require("../../enums");
|
|
6
|
+
class ZigbeeAqaraPresence extends BaseDevices_1.ZigbeeMotionSensor {
|
|
7
|
+
constructor(pInfo) {
|
|
8
|
+
super(pInfo, enums_1.DeviceType.ZigbeeAqaraPresence);
|
|
9
|
+
}
|
|
10
|
+
/** @inheritDoc */
|
|
11
|
+
update(idSplit, state, initial = false) {
|
|
12
|
+
this.log(enums_1.LogLevel.DeepTrace, `Motion update: ID: ${idSplit.join('.')} JSON: ${JSON.stringify(state)}`);
|
|
13
|
+
super.update(idSplit, state, initial, true);
|
|
14
|
+
switch (idSplit[3]) {
|
|
15
|
+
case 'presence':
|
|
16
|
+
this.log(enums_1.LogLevel.Trace, `Motion sensor: Update for motion of ${this.info.customName}: ${state.val}`);
|
|
17
|
+
this.updateMovement(state.val);
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.ZigbeeAqaraPresence = ZigbeeAqaraPresence;
|
package/lib/enums/deviceType.js
CHANGED
|
@@ -44,6 +44,7 @@ var DeviceType;
|
|
|
44
44
|
DeviceType[DeviceType["ZigbeeInnr142C"] = 226] = "ZigbeeInnr142C";
|
|
45
45
|
DeviceType[DeviceType["ZigbeeSodaHandle"] = 227] = "ZigbeeSodaHandle";
|
|
46
46
|
DeviceType[DeviceType["ZigbeeTuyaMotion"] = 228] = "ZigbeeTuyaMotion";
|
|
47
|
+
DeviceType[DeviceType["ZigbeeAqaraPresence"] = 229] = "ZigbeeAqaraPresence";
|
|
47
48
|
DeviceType[DeviceType["JsEnergyManager"] = 301] = "JsEnergyManager";
|
|
48
49
|
DeviceType[DeviceType["RoomScene"] = 401] = "RoomScene";
|
|
49
50
|
DeviceType[DeviceType["ShellyTrv"] = 402] = "ShellyTrv";
|
|
@@ -23,6 +23,14 @@ export declare class WeatherService {
|
|
|
23
23
|
private static latitude;
|
|
24
24
|
private static longitude;
|
|
25
25
|
private static appID?;
|
|
26
|
+
/**
|
|
27
|
+
* The highest maximum temperature forecast for today (prevents oscillation)
|
|
28
|
+
*/
|
|
29
|
+
private static _todayMaxMaxTemperature;
|
|
30
|
+
/**
|
|
31
|
+
* The date of the last weather update (for daily reset)
|
|
32
|
+
*/
|
|
33
|
+
private static _lastUpdateDate;
|
|
26
34
|
static addWeatherUpdateCb(name: string, cb: () => void): void;
|
|
27
35
|
static get todayMaxTemp(): number;
|
|
28
36
|
static get todayCloudiness(): number | undefined;
|
|
@@ -31,6 +39,11 @@ export declare class WeatherService {
|
|
|
31
39
|
static stopInterval(): void;
|
|
32
40
|
static playWeatherInfo(speaker: iSpeaker, volume?: number, short?: boolean, retries?: number): void;
|
|
33
41
|
static processHourlyWeather(response: WeatherResponse): void;
|
|
42
|
+
/**
|
|
43
|
+
* Updates the daily maximum temperature to prevent shutter oscillation
|
|
44
|
+
* Tracks the highest forecasted maximum temperature for today
|
|
45
|
+
*/
|
|
46
|
+
private static updateDailyMaxTemperature;
|
|
34
47
|
static get currentHumidity(): number;
|
|
35
48
|
static get currentTemp(): number;
|
|
36
49
|
static willOutsideBeWarmer(referenceTemperature: number, logger: (level: LogLevel, message: string, debugType?: LogDebugType) => void): boolean;
|
|
@@ -18,7 +18,9 @@ class WeatherService {
|
|
|
18
18
|
}
|
|
19
19
|
static get todayMaxTemp() {
|
|
20
20
|
var _a, _b, _c;
|
|
21
|
-
return
|
|
21
|
+
return this._todayMaxMaxTemperature !== interfaces_1.UNDEFINED_TEMP_VALUE
|
|
22
|
+
? this._todayMaxMaxTemperature
|
|
23
|
+
: ((_c = (_b = (_a = WeatherService.lastResponse) === null || _a === void 0 ? void 0 : _a.daily[0]) === null || _b === void 0 ? void 0 : _b.temp.max) !== null && _c !== void 0 ? _c : interfaces_1.UNDEFINED_TEMP_VALUE);
|
|
22
24
|
}
|
|
23
25
|
static get todayCloudiness() {
|
|
24
26
|
var _a, _b;
|
|
@@ -111,6 +113,8 @@ class WeatherService {
|
|
|
111
113
|
}
|
|
112
114
|
static processHourlyWeather(response) {
|
|
113
115
|
this.lastResponse = response;
|
|
116
|
+
// Update daily maximum temperature to prevent shutter oscillation
|
|
117
|
+
this.updateDailyMaxTemperature();
|
|
114
118
|
logging_1.ServerLogService.writeLog(enums_1.LogLevel.Info, `Es sind gerade ${this.lastResponse.current.temp} Grad (gefühlt ${this.lastResponse.current.feels_like}).`);
|
|
115
119
|
if (this.lastResponse.alerts !== undefined && this.lastResponse.alerts.length > 0) {
|
|
116
120
|
const message = ['Es gibt folgende Wetterwarnungen:'];
|
|
@@ -120,6 +124,24 @@ class WeatherService {
|
|
|
120
124
|
logging_1.ServerLogService.writeLog(enums_1.LogLevel.Info, message.join('\n'));
|
|
121
125
|
}
|
|
122
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Updates the daily maximum temperature to prevent shutter oscillation
|
|
129
|
+
* Tracks the highest forecasted maximum temperature for today
|
|
130
|
+
*/
|
|
131
|
+
static updateDailyMaxTemperature() {
|
|
132
|
+
var _a, _b, _c, _d;
|
|
133
|
+
if (!((_d = (_c = (_b = (_a = this.lastResponse) === null || _a === void 0 ? void 0 : _a.daily) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.temp) === null || _d === void 0 ? void 0 : _d.max)) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const today = new Date().toDateString();
|
|
137
|
+
const currentForecastMax = this.lastResponse.daily[0].temp.max;
|
|
138
|
+
if (this._lastUpdateDate === today && currentForecastMax < this._todayMaxMaxTemperature) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
this._todayMaxMaxTemperature = currentForecastMax;
|
|
142
|
+
this._lastUpdateDate = today;
|
|
143
|
+
logging_1.ServerLogService.writeLog(enums_1.LogLevel.Debug, `Daily max temperature updated to ${currentForecastMax}°C`);
|
|
144
|
+
}
|
|
123
145
|
static get currentHumidity() {
|
|
124
146
|
var _a;
|
|
125
147
|
if (((_a = WeatherService.lastResponse) === null || _a === void 0 ? void 0 : _a.current) === undefined) {
|
|
@@ -264,3 +286,11 @@ WeatherService.active = false;
|
|
|
264
286
|
*/
|
|
265
287
|
WeatherService.oneDay = 1000 * 60 * 60 * 24;
|
|
266
288
|
WeatherService._dataUpdateCbs = {};
|
|
289
|
+
/**
|
|
290
|
+
* The highest maximum temperature forecast for today (prevents oscillation)
|
|
291
|
+
*/
|
|
292
|
+
WeatherService._todayMaxMaxTemperature = interfaces_1.UNDEFINED_TEMP_VALUE;
|
|
293
|
+
/**
|
|
294
|
+
* The date of the last weather update (for daily reset)
|
|
295
|
+
*/
|
|
296
|
+
WeatherService._lastUpdateDate = '';
|