iobroker.poolcontrol 1.2.2 → 1.2.3
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/README.md +19 -2
- package/io-package.json +14 -1
- package/lib/helpers/actuatorsHelper.js +16 -2
- package/lib/helpers/controlHelper.js +19 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -195,7 +195,24 @@ New features are added regularly – please refer to the changelog.
|
|
|
195
195
|
---
|
|
196
196
|
|
|
197
197
|
## Changelog
|
|
198
|
-
|
|
198
|
+
|
|
199
|
+
### 1.2.3
|
|
200
|
+
Released: 06.03.2026
|
|
201
|
+
- Replaced native timers (setTimeout / setInterval) with adapter timers (adapter.setTimeout / adapter.setInterval)
|
|
202
|
+
- Added proper cleanup of timers on adapter unload
|
|
203
|
+
- Internal code cleanup and maintenance improvements
|
|
204
|
+
|
|
205
|
+
### 1.2.2
|
|
206
|
+
Released: 06.03.2026
|
|
207
|
+
- Raised required admin version to >=7.6.20
|
|
208
|
+
- Updated translations after jsonConfig i18n refactoring
|
|
209
|
+
- Maintenance update (no functional changes)
|
|
210
|
+
|
|
211
|
+
### 1.2.1
|
|
212
|
+
Released: 06.03.2026
|
|
213
|
+
- Migration of admin configuration to i18n translation environment
|
|
214
|
+
- jsonConfig now uses English labels with translations managed in admin/i18n
|
|
215
|
+
- Translations generated using `npm run translate`
|
|
199
216
|
|
|
200
217
|
### 1.2.0
|
|
201
218
|
Released: 15.02.2026
|
|
@@ -245,7 +262,7 @@ Released: 15.02.2026
|
|
|
245
262
|
- Purely optional system extension
|
|
246
263
|
|
|
247
264
|
|
|
248
|
-
## v0.9.0
|
|
265
|
+
## v0.9.0
|
|
249
266
|
- Introduction of heating / heat pump control (`heatHelper`)
|
|
250
267
|
- Automatic heating request based on pool temperature
|
|
251
268
|
- Target and maximum temperature configurable
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "poolcontrol",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.3",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.2.3": {
|
|
7
|
+
"en": "Replaced native timers with adapter timers and improved timer cleanup",
|
|
8
|
+
"de": "Native Timer durch Adapter-Timer ersetzt und Timer-Cleanup verbessert",
|
|
9
|
+
"ru": "Заменены собственные таймеры на таймеры адаптера и улучшена очистка таймера.",
|
|
10
|
+
"pt": "Temporizadores nativos substituídos por temporizadores de adaptador e limpeza aprimorada do temporizador",
|
|
11
|
+
"nl": "Native timers vervangen door adaptertimers en verbeterde timeropschoning",
|
|
12
|
+
"fr": "Remplacement des minuteries natives par des minuteries d'adaptateur et un nettoyage amélioré des minuteries",
|
|
13
|
+
"it": "Sostituiti i timer nativi con timer adattatori e migliorata la pulizia dei timer",
|
|
14
|
+
"es": "Se reemplazaron los temporizadores nativos con temporizadores adaptadores y se mejoró la limpieza del temporizador.",
|
|
15
|
+
"pl": "Zastąpiono liczniki czasu natywnego licznikami adaptera i ulepszono czyszczenie licznika czasu",
|
|
16
|
+
"uk": "Вбудовані таймери замінено на адаптерні та покращено очищення таймерів",
|
|
17
|
+
"zh-cn": "用适配器计时器替换了本机计时器并改进了计时器清理"
|
|
18
|
+
},
|
|
6
19
|
"1.2.2": {
|
|
7
20
|
"en": "Maintenance update: Raised required admin version to >=7.6.20 and refreshed translations after jsonConfig i18n changes.",
|
|
8
21
|
"de": "Wartungsupdate: Mindestversion für admin auf >=7.6.20 erhöht und Übersetzungen nach jsonConfig-i18n-Änderungen aktualisiert.",
|
|
@@ -166,7 +166,7 @@ const actuatorsHelper = {
|
|
|
166
166
|
await this._set(`${base}.remaining_minutes`, remaining);
|
|
167
167
|
await this._set(`${base}.status`, `EIN (noch ${remaining} min)`);
|
|
168
168
|
|
|
169
|
-
this._timers[base] = setInterval(async () => {
|
|
169
|
+
this._timers[base] = this.adapter.setInterval(async () => {
|
|
170
170
|
try {
|
|
171
171
|
remaining--;
|
|
172
172
|
|
|
@@ -187,7 +187,7 @@ const actuatorsHelper = {
|
|
|
187
187
|
|
|
188
188
|
async _stopTimer(base) {
|
|
189
189
|
if (this._timers[base]) {
|
|
190
|
-
clearInterval(this._timers[base]);
|
|
190
|
+
this.adapter.clearInterval(this._timers[base]);
|
|
191
191
|
delete this._timers[base];
|
|
192
192
|
}
|
|
193
193
|
},
|
|
@@ -254,6 +254,20 @@ const actuatorsHelper = {
|
|
|
254
254
|
return fallback;
|
|
255
255
|
}
|
|
256
256
|
},
|
|
257
|
+
|
|
258
|
+
cleanup() {
|
|
259
|
+
try {
|
|
260
|
+
for (const base of Object.keys(this._timers)) {
|
|
261
|
+
if (this._timers[base]) {
|
|
262
|
+
this.adapter.clearInterval(this._timers[base]);
|
|
263
|
+
delete this._timers[base];
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
this.adapter.log.debug('[actuatorsHelper] cleanup done');
|
|
267
|
+
} catch (err) {
|
|
268
|
+
this.adapter.log.debug(`[actuatorsHelper] cleanup error: ${err.message}`);
|
|
269
|
+
}
|
|
270
|
+
},
|
|
257
271
|
};
|
|
258
272
|
|
|
259
273
|
module.exports = actuatorsHelper;
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
let adapter;
|
|
13
13
|
let backwashTimer = null;
|
|
14
14
|
let dailyTimer = null;
|
|
15
|
+
let autoPumpingInterval = null; // FIX
|
|
15
16
|
let previousPumpMode = null;
|
|
16
17
|
|
|
17
18
|
/**
|
|
@@ -44,7 +45,7 @@ function init(a) {
|
|
|
44
45
|
async function _scheduleDailyCheck() {
|
|
45
46
|
try {
|
|
46
47
|
if (dailyTimer) {
|
|
47
|
-
clearTimeout(dailyTimer);
|
|
48
|
+
adapter.clearTimeout(dailyTimer);
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
const timeStr = (await adapter.getStateAsync('control.circulation.check_time'))?.val || '18:00';
|
|
@@ -60,7 +61,7 @@ async function _scheduleDailyCheck() {
|
|
|
60
61
|
const diffMs = next - now;
|
|
61
62
|
adapter.log.debug(`[controlHelper] next daily circulation check scheduled for ${next.toLocaleTimeString()}`);
|
|
62
63
|
|
|
63
|
-
dailyTimer = setTimeout(async () => {
|
|
64
|
+
dailyTimer = adapter.setTimeout(async () => {
|
|
64
65
|
await _runDailyCirculationCheck();
|
|
65
66
|
await _scheduleDailyCheck();
|
|
66
67
|
}, diffMs);
|
|
@@ -150,12 +151,18 @@ async function _startAutoPumping(missingLiter) {
|
|
|
150
151
|
await _sendSpeech(`Automatisches Nachpumpen gestartet. Es fehlen ${missingLiter} Liter.`);
|
|
151
152
|
}
|
|
152
153
|
|
|
153
|
-
|
|
154
|
+
if (autoPumpingInterval) {
|
|
155
|
+
adapter.clearInterval(autoPumpingInterval);
|
|
156
|
+
autoPumpingInterval = null;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
autoPumpingInterval = adapter.setInterval(async () => {
|
|
154
160
|
const total = Math.round((await adapter.getStateAsync('circulation.daily_total'))?.val || 0);
|
|
155
161
|
const required = Math.round((await adapter.getStateAsync('circulation.daily_required'))?.val || 0);
|
|
156
162
|
|
|
157
163
|
if (total >= required) {
|
|
158
|
-
clearInterval(
|
|
164
|
+
adapter.clearInterval(autoPumpingInterval);
|
|
165
|
+
autoPumpingInterval = null;
|
|
159
166
|
await adapter.setStateAsync('pump.pump_switch', { val: false, ack: false });
|
|
160
167
|
await adapter.setStateAsync('pump.mode', { val: previousPumpMode, ack: true });
|
|
161
168
|
await adapter.setStateAsync('pump.active_helper', { val: '', ack: true });
|
|
@@ -248,9 +255,9 @@ async function handleStateChange(id, state) {
|
|
|
248
255
|
}
|
|
249
256
|
|
|
250
257
|
if (backwashTimer) {
|
|
251
|
-
clearTimeout(backwashTimer);
|
|
258
|
+
adapter.clearTimeout(backwashTimer);
|
|
252
259
|
}
|
|
253
|
-
backwashTimer = setTimeout(
|
|
260
|
+
backwashTimer = adapter.setTimeout(
|
|
254
261
|
async () => {
|
|
255
262
|
try {
|
|
256
263
|
await adapter.setStateAsync('pump.pump_switch', { val: false, ack: false });
|
|
@@ -333,13 +340,17 @@ async function _sendSpeech(text) {
|
|
|
333
340
|
*/
|
|
334
341
|
function cleanup() {
|
|
335
342
|
if (backwashTimer) {
|
|
336
|
-
clearTimeout(backwashTimer);
|
|
343
|
+
adapter.clearTimeout(backwashTimer);
|
|
337
344
|
backwashTimer = null;
|
|
338
345
|
}
|
|
339
346
|
if (dailyTimer) {
|
|
340
|
-
clearTimeout(dailyTimer);
|
|
347
|
+
adapter.clearTimeout(dailyTimer);
|
|
341
348
|
dailyTimer = null;
|
|
342
349
|
}
|
|
350
|
+
if (autoPumpingInterval) {
|
|
351
|
+
adapter.clearInterval(autoPumpingInterval);
|
|
352
|
+
autoPumpingInterval = null;
|
|
353
|
+
}
|
|
343
354
|
previousPumpMode = null;
|
|
344
355
|
}
|
|
345
356
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.poolcontrol",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Steuerung & Automatisierung für den Pool (Pumpe, Heizung, Ventile, Sensoren).",
|
|
5
5
|
"author": "DasBo1975 <dasbo1975@outlook.de>",
|
|
6
6
|
"homepage": "https://github.com/DasBo1975/ioBroker.poolcontrol",
|