From 0a4ff9bf76bc43d133c639157a96b36193702a85 Mon Sep 17 00:00:00 2001 From: Mike Johnston Date: Mon, 30 Mar 2026 23:15:35 -0400 Subject: [PATCH] holy shit toggle button --- apps/desktop/resources/web/index.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/desktop/resources/web/index.html b/apps/desktop/resources/web/index.html index 58ce53b..d863024 100644 --- a/apps/desktop/resources/web/index.html +++ b/apps/desktop/resources/web/index.html @@ -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(() => {}); }