holy shit toggle button
Build Images and Deploy / Update-PROD-Stack (push) Successful in 19s

This commit is contained in:
2026-03-30 23:15:35 -04:00
parent 5180b3bce1
commit 0a4ff9bf76
+8 -2
View File
@@ -730,8 +730,10 @@ function renderDevices() {
const checkbox = document.getElementById('dchk-'+i);
if (checkbox) {
// Use the actual binary state, not brightness
checkbox.checked = !!on;
const shouldBeChecked = !!on;
checkbox.checked = shouldBeChecked;
console.log(`[DWM] Device ${d.host}:${d.port} - BinaryState: ${on ? 'ON' : 'OFF'}, Last brightness: ${data.brightness}%`);
console.log(`[DWM] Setting checkbox.checked to: ${shouldBeChecked}, actual checkbox.checked: ${checkbox.checked}`);
}
})
.catch(() => {});
@@ -740,7 +742,11 @@ function renderDevices() {
api('GET', `/api/devices/${d.host}/${d.port}/state`)
.then((on) => {
const c = document.getElementById('dchk-'+i);
if (c) c.checked = !!on;
if (c) {
const shouldBeChecked = !!on;
c.checked = shouldBeChecked;
console.log(`[DWM] Non-dimmer device ${d.host}:${d.port} - State: ${on ? 'ON' : 'OFF'}, Setting checkbox to: ${shouldBeChecked}`);
}
})
.catch(() => {});
}