hoffmation-base 3.0.0-alpha.74 → 3.0.0-alpha.76
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/base64Image.d.ts +0 -1
- package/lib/server/devices/baseDeviceInterfaces/iHeater.d.ts +0 -1
- package/lib/server/devices/baseDeviceInterfaces/iHumiditySensor.d.ts +0 -1
- package/lib/server/devices/baseDeviceInterfaces/iScene.d.ts +0 -1
- package/lib/server/devices/baseDeviceInterfaces/iTemperatureSensor.d.ts +0 -1
- package/lib/server/devices/dachs/dachsTemperatureSensor.d.ts +0 -1
- package/lib/server/devices/groups/presenceGroup.d.ts +2 -2
- package/lib/server/devices/groups/presenceGroup.js +9 -8
- package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.d.ts +0 -1
- package/lib/server/devices/scene/room-scene.d.ts +0 -1
- package/lib/server/devices/shelly/shellyTrv.d.ts +0 -1
- package/lib/server/devices/smartGarden/smartGardenSensor.d.ts +0 -1
- package/lib/server/devices/zigbee/BaseDevices/zigbeeHeater.d.ts +0 -1
- package/lib/server/devices/zigbee/BaseDevices/zigbeeMotionSensor.d.ts +0 -1
- package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.d.ts +0 -1
- package/lib/server/devices/zigbee/zigbeeAquaraWater.d.ts +0 -1
- package/lib/server/devices/zigbee/zigbeeHeimanSmoke.d.ts +0 -1
- package/lib/server/devices/zigbee/zigbeeSonoffTemp.d.ts +0 -1
- package/lib/server/ioBroker/connection.d.ts +0 -2
- package/lib/server/services/ac/ac-device.js +20 -7
- package/lib/server/services/govee/own-govee-device.js +0 -6
- package/lib/server/services/utils/utils.d.ts +0 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -20
|
@@ -11,10 +11,10 @@ export declare class PresenceGroup extends BaseGroup {
|
|
|
11
11
|
private get lastLeftDelayActive();
|
|
12
12
|
getMotionDetector(): Array<iMotionSensor>;
|
|
13
13
|
initCallbacks(): void;
|
|
14
|
-
|
|
14
|
+
anyPresent(includeMovementResetDelayCheck?: boolean): boolean;
|
|
15
15
|
addLastLeftCallback(cb: (action: PresenceGroupLastLeftAction) => void): void;
|
|
16
16
|
addAnyMovementCallback(cb: (action: PresenceGroupAnyMovementAction) => void): void;
|
|
17
|
-
|
|
17
|
+
private presentAmount;
|
|
18
18
|
private fireFistEnterCBs;
|
|
19
19
|
addFirstEnterCallback(cb: (action: PresenceGroupFirstEnterAction) => void): void;
|
|
20
20
|
private motionSensorOnAnyMovement;
|
|
@@ -18,7 +18,7 @@ class PresenceGroup extends base_group_1.BaseGroup {
|
|
|
18
18
|
this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.MotionDetection, new device_list_1.DeviceList(motionSensorIds));
|
|
19
19
|
}
|
|
20
20
|
get lastLeftDelayActive() {
|
|
21
|
-
return this.
|
|
21
|
+
return this.getTimeAfterReset() < 0;
|
|
22
22
|
}
|
|
23
23
|
getMotionDetector() {
|
|
24
24
|
return this.deviceCluster.getDevicesByType(device_cluster_type_1.DeviceClusterType.MotionDetection);
|
|
@@ -56,8 +56,11 @@ class PresenceGroup extends base_group_1.BaseGroup {
|
|
|
56
56
|
this.getRoom().setLightTimeBased(new models_1.RoomSetLightTimeBasedCommand(action, true));
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
anyPresent(includeMovementResetDelayCheck = false) {
|
|
60
|
+
if (includeMovementResetDelayCheck && this.lastLeftDelayActive) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
return this.presentAmount() > 0;
|
|
61
64
|
}
|
|
62
65
|
addLastLeftCallback(cb) {
|
|
63
66
|
this._lastLeftCbs.push(cb);
|
|
@@ -65,11 +68,8 @@ class PresenceGroup extends base_group_1.BaseGroup {
|
|
|
65
68
|
addAnyMovementCallback(cb) {
|
|
66
69
|
this._anyMovementCbs.push(cb);
|
|
67
70
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return true;
|
|
71
|
-
}
|
|
72
|
-
return this.getMotionDetector().find((b) => b.movementDetected) !== undefined;
|
|
71
|
+
presentAmount() {
|
|
72
|
+
return this.getMotionDetector().filter((b) => b.movementDetected).length;
|
|
73
73
|
}
|
|
74
74
|
fireFistEnterCBs(action) {
|
|
75
75
|
for (const cb of this._firstEnterCbs) {
|
|
@@ -94,6 +94,7 @@ class PresenceGroup extends base_group_1.BaseGroup {
|
|
|
94
94
|
motionSensorOnLastLeft(action) {
|
|
95
95
|
let timeAfterReset = this.getTimeAfterReset();
|
|
96
96
|
if (timeAfterReset > 0) {
|
|
97
|
+
this._lastLeftTimeout = null;
|
|
97
98
|
this.log(models_1.LogLevel.Debug, `Movement reset. Active Motions: ${this.presentAmount()}\tTime after Last Movement including Reset: ${timeAfterReset}`);
|
|
98
99
|
this.executeLastLeftCbs(new models_1.PresenceGroupLastLeftAction(action));
|
|
99
100
|
return;
|
|
@@ -20,13 +20,9 @@ class AcDevice {
|
|
|
20
20
|
* @returns {boolean} True if the AC is allowed to cool
|
|
21
21
|
*/
|
|
22
22
|
get coolingAllowed() {
|
|
23
|
-
var _a, _b;
|
|
24
23
|
if (settings_service_1.SettingsService.heatMode !== config_1.HeatingMode.Summer) {
|
|
25
24
|
return false;
|
|
26
25
|
}
|
|
27
|
-
if (this.settings.noCoolingOnMovement && ((_b = (_a = this.room) === null || _a === void 0 ? void 0 : _a.PraesenzGroup) === null || _b === void 0 ? void 0 : _b.anyPresent(true))) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
26
|
if (weather_1.WeatherService.active &&
|
|
31
27
|
weather_1.WeatherService.todayMaxTemp < this.settings.minOutdoorTempForCooling &&
|
|
32
28
|
weather_1.WeatherService.todayMaxTemp !== devices_1.UNDEFINED_TEMP_VALUE) {
|
|
@@ -128,7 +124,7 @@ class AcDevice {
|
|
|
128
124
|
}
|
|
129
125
|
/** @inheritDoc */
|
|
130
126
|
isAvailableForExcessEnergy() {
|
|
131
|
-
var _a, _b;
|
|
127
|
+
var _a, _b, _c, _d;
|
|
132
128
|
if (this.settings.useAutomatic || (((_b = (_a = this.room) === null || _a === void 0 ? void 0 : _a.HeatGroup) === null || _b === void 0 ? void 0 : _b.settings.automaticMode) && this.settings.heatingAllowed)) {
|
|
133
129
|
return false;
|
|
134
130
|
}
|
|
@@ -138,7 +134,13 @@ class AcDevice {
|
|
|
138
134
|
if (!utils_1.Utils.timeWithinBorders(this.settings.minimumHours, this.settings.minimumMinutes, this.settings.maximumHours, this.settings.maximumMinutes)) {
|
|
139
135
|
return false;
|
|
140
136
|
}
|
|
141
|
-
|
|
137
|
+
const desiredMode = this.calculateDesiredMode();
|
|
138
|
+
if (desiredMode === ac_mode_1.AcMode.Cooling &&
|
|
139
|
+
this.settings.noCoolingOnMovement &&
|
|
140
|
+
((_d = (_c = this.room) === null || _c === void 0 ? void 0 : _c.PraesenzGroup) === null || _d === void 0 ? void 0 : _d.anyPresent(true))) {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
return true;
|
|
142
144
|
}
|
|
143
145
|
/** @inheritDoc */
|
|
144
146
|
calculateDesiredMode() {
|
|
@@ -224,10 +226,17 @@ class AcDevice {
|
|
|
224
226
|
}
|
|
225
227
|
/** @inheritDoc */
|
|
226
228
|
turnOnForExcessEnergy() {
|
|
229
|
+
var _a, _b;
|
|
227
230
|
if (this.blockAutomationHandler.automaticBlockActive) {
|
|
228
231
|
return;
|
|
229
232
|
}
|
|
230
233
|
this._activatedByExcessEnergy = true;
|
|
234
|
+
const desiredMode = this.calculateDesiredMode();
|
|
235
|
+
if (desiredMode === ac_mode_1.AcMode.Cooling &&
|
|
236
|
+
this.settings.noCoolingOnMovement &&
|
|
237
|
+
((_b = (_a = this.room) === null || _a === void 0 ? void 0 : _a.PraesenzGroup) === null || _b === void 0 ? void 0 : _b.anyPresent(true))) {
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
231
240
|
this.setDesiredMode(this.calculateDesiredMode(), false);
|
|
232
241
|
this.turnOn();
|
|
233
242
|
}
|
|
@@ -278,6 +287,7 @@ class AcDevice {
|
|
|
278
287
|
}, 5000, this);
|
|
279
288
|
}
|
|
280
289
|
automaticCheck() {
|
|
290
|
+
var _a, _b;
|
|
281
291
|
if (this.blockAutomationHandler.automaticBlockActive) {
|
|
282
292
|
// We aren't allowed to turn on or off anyway --> exit
|
|
283
293
|
return;
|
|
@@ -288,7 +298,10 @@ class AcDevice {
|
|
|
288
298
|
return;
|
|
289
299
|
}
|
|
290
300
|
this.setDesiredMode(desiredMode, false);
|
|
291
|
-
if (desiredMode == ac_mode_1.AcMode.Off
|
|
301
|
+
if (desiredMode == ac_mode_1.AcMode.Off ||
|
|
302
|
+
(desiredMode === ac_mode_1.AcMode.Cooling &&
|
|
303
|
+
this.settings.noCoolingOnMovement &&
|
|
304
|
+
((_b = (_a = this.room) === null || _a === void 0 ? void 0 : _a.PraesenzGroup) === null || _b === void 0 ? void 0 : _b.anyPresent(true)))) {
|
|
292
305
|
this.turnOff();
|
|
293
306
|
return;
|
|
294
307
|
}
|
|
@@ -192,9 +192,6 @@ class OwnGoveeDevice {
|
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
194
|
turnOn() {
|
|
195
|
-
if (this._actuatorOn) {
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
195
|
this.queuedValue = true;
|
|
199
196
|
govee_service_1.GooveeService.sendCommand(this, `on/true`).then((result) => {
|
|
200
197
|
if (!result) {
|
|
@@ -206,9 +203,6 @@ class OwnGoveeDevice {
|
|
|
206
203
|
});
|
|
207
204
|
}
|
|
208
205
|
turnOff() {
|
|
209
|
-
if (!this._actuatorOn) {
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
206
|
this.queuedValue = false;
|
|
213
207
|
govee_service_1.GooveeService.sendCommand(this, `on/false`).then((result) => {
|
|
214
208
|
if (!result) {
|