Power Supply
+Raspberry Pi under-voltage/throttling status (via vcgencmd get_throttled). A marginal power supply is a common cause of visible flicker or dimming on LED panels.
vcgencmd found — this isn\'t a Raspberry Pi, or it\'s not on PATH).';
+ return;
+ }
+
+ const activeNow = power.under_voltage_now || power.throttled_now ||
+ power.freq_capped_now || power.soft_temp_limit_now;
+ const occurredEarlier = power.under_voltage_occurred || power.throttled_occurred ||
+ power.freq_capped_occurred || power.soft_temp_limit_occurred;
+ const summaryColor = activeNow ? 'red' : (occurredEarlier ? 'yellow' : 'green');
+ // _activePowerConditionLabels is defined in base.html's inline script;
+ // both are classic (non-module) scripts sharing the global scope.
+ const activeLabels = (typeof _activePowerConditionLabels === 'function')
+ ? _activePowerConditionLabels(power) : [];
+ const summaryText = activeNow
+ ? `Actively ${activeLabels.length ? activeLabels.join('/') : 'under-voltage/throttled'} right now`
+ : (occurredEarlier ? 'OK right now (but occurred earlier this boot)' : 'OK — no issues detected');
+
+ let html = `
+ - `;
+ for (const [key, label] of FLAG_LABELS) {
+ const set = !!power[key];
+ html += `
- + + ${escHtml(label)} + `; + } + html += `
Consider a higher-amperage 5V supply wired directly to the panel(s), or check for a loose power connector. See the README's Power Supply section for sizing guidance.
`; + } + + panel.innerHTML = html; + } + + if (window.statsSource) { + window.statsSource.addEventListener('message', function(event) { + try { + const data = JSON.parse(event.data); + if (data && 'power' in data) renderPowerInfo(data.power); + } catch (e) { /* ignore malformed frames */ } + }); + } + // Load on first render; HTMX will have already swapped us in by this point. loadGitInfo(); })();