Skip to content

Commit 3cb5fed

Browse files
committed
4.0.21
1 parent ef77845 commit 3cb5fed

File tree

3 files changed

+32
-39
lines changed

3 files changed

+32
-39
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66

77
# CHANGELOG
88

9-
**Version 4.0.20** - October 2025<br/>
10-
- NEW: Added **KNX Debug** sidebar tab featuring a live 5 000-line rolling buffer of every KNX log entry, colour-coded by severity, auto-refresh, manual refresh, and one-click copy to clipboard.<br/>
9+
**Version 4.0.21** - October 2025<br/>
10+
- FIX: Restored the `knxUltimateHueLight` implementation to the stable 4.0.16 baseline to stop Hue `grouped_light` devices from switching off immediately.<br/>
11+
- FIX: Hardened the **KNX Debug** sidebar by replacing the timer logic with an HTML-driven poll loop and keeping the *Auto* option disabled by default.<br/>
12+
1113

1214
**Version 4.0.19** - October 2025<br/>
1315
- Hue Light node: the `Locate` button now runs as a toggle — it starts a bridge identify loop that replays the Hue `identify` command every second, switches the icon to “stop”, and halts immediately when pressed again or automatically after 10 minutes.<br/>

nodes/plugins/knxUltimateMonitor-sidebar-plugin.html

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
let debugEntries = [];
207207
let debugActive = false;
208208
let debugLatestSeq = 0;
209-
let debugPollHandle = null;
209+
let debugAutoRefreshHandle = null;
210210
let debugLimit = 5000;
211211
let debugStatusEl = null;
212212
let debugInfoCounter = null;
@@ -219,11 +219,11 @@
219219
try {
220220
if (window.localStorage) {
221221
const stored = window.localStorage.getItem(debugAutoStorageKey);
222-
if (stored === 'false') return false;
223222
if (stored === 'true') return true;
223+
if (stored === 'false') return false;
224224
}
225225
} catch (error) { }
226-
return true;
226+
return false;
227227
};
228228

229229
const storeDebugAutoPreference = (value) => {
@@ -308,33 +308,25 @@
308308
}
309309
};
310310

311-
const scheduleNextDebugFetch = (delay = DEBUG_REFRESH_INTERVAL) => {
312-
if (debugPollHandle) {
313-
clearTimeout(debugPollHandle);
314-
debugPollHandle = null;
311+
const stopDebugAutoRefresh = () => {
312+
if (debugAutoRefreshHandle) {
313+
clearInterval(debugAutoRefreshHandle);
314+
debugAutoRefreshHandle = null;
315315
}
316-
const safeDelay = Math.max(0, Number(delay) || 0);
317-
debugPollHandle = setTimeout(() => {
318-
debugPollHandle = null;
319-
if (!debugActive) return;
320-
if (!debugAutoCheckbox || !debugAutoCheckbox.is(':checked')) return;
321-
if (debugFetching) {
322-
scheduleNextDebugFetch(DEBUG_REFRESH_INTERVAL);
323-
return;
324-
}
325-
fetchDebugLog({ triggeredByTimer: true });
326-
}, safeDelay);
327-
};
328-
329-
const startDebugTimer = () => {
330-
scheduleNextDebugFetch(0);
331316
};
332317

333-
const stopDebugTimer = () => {
334-
if (debugPollHandle) {
335-
clearTimeout(debugPollHandle);
336-
debugPollHandle = null;
337-
}
318+
const ensureDebugAutoRefresh = () => {
319+
if (debugAutoRefreshHandle) return;
320+
if (!debugAutoCheckbox || !debugAutoCheckbox.is(':checked')) return;
321+
debugAutoRefreshHandle = setInterval(() => {
322+
if (!debugAutoCheckbox || !debugAutoCheckbox.is(':checked')) {
323+
stopDebugAutoRefresh();
324+
return;
325+
}
326+
if (!debugActive) return;
327+
if (debugFetching) return;
328+
fetchDebugLog({ triggeredByTimer: true, forceFull: true });
329+
}, DEBUG_REFRESH_INTERVAL);
338330
};
339331

340332
const copyDebugToClipboard = () => {
@@ -426,9 +418,9 @@
426418
}).always(function () {
427419
debugFetching = false;
428420
if (debugActive && debugAutoCheckbox && debugAutoCheckbox.is(':checked')) {
429-
scheduleNextDebugFetch(DEBUG_REFRESH_INTERVAL);
421+
ensureDebugAutoRefresh();
430422
} else {
431-
stopDebugTimer();
423+
stopDebugAutoRefresh();
432424
}
433425
if (debugPendingForceRefresh) {
434426
debugPendingForceRefresh = false;
@@ -465,12 +457,11 @@
465457
const enabled = $(this).is(':checked');
466458
storeDebugAutoPreference(enabled);
467459
if (enabled) {
468-
if (debugActive) {
469-
fetchDebugLog({ incremental: true });
470-
startDebugTimer();
471-
}
460+
debugActive = true;
461+
fetchDebugLog({ forceFull: true });
462+
ensureDebugAutoRefresh();
472463
} else {
473-
stopDebugTimer();
464+
stopDebugAutoRefresh();
474465
}
475466
});
476467

@@ -496,10 +487,10 @@
496487
const shouldForceFull = debugEntries.length === 0;
497488
fetchDebugLog({ forceFull: shouldForceFull });
498489
if (debugAutoCheckbox && debugAutoCheckbox.is(':checked')) {
499-
startDebugTimer();
490+
ensureDebugAutoRefresh();
500491
}
501492
} else {
502-
stopDebugTimer();
493+
stopDebugAutoRefresh();
503494
}
504495
}
505496
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"engines": {
44
"node": ">=20.18.1"
55
},
6-
"version": "4.0.20",
6+
"version": "4.0.21",
77
"description": "Control your KNX and KNX Secure intallation via Node-Red! A bunch of KNX nodes, with integrated Philips HUE control and ETS group address importer. Easy to use and highly configurable.",
88
"dependencies": {
99
"binary-parser": "2.2.1",

0 commit comments

Comments
 (0)