From 5180b3bce19061e8d835005a33168ce8866f0246 Mon Sep 17 00:00:00 2001 From: Mike Johnston Date: Mon, 30 Mar 2026 23:12:48 -0400 Subject: [PATCH] on off toggle fix --- apps/desktop/resources/web/index.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/desktop/resources/web/index.html b/apps/desktop/resources/web/index.html index 61aa0c5..58ce53b 100644 --- a/apps/desktop/resources/web/index.html +++ b/apps/desktop/resources/web/index.html @@ -724,11 +724,15 @@ function renderDevices() { }) .catch(() => {}); - // Also fetch the actual on/off state to set the toggle correctly + // Also fetch the actual on/off state from the BinaryState response api('GET', `/api/devices/${d.host}/${d.port}/state`) .then((on) => { const checkbox = document.getElementById('dchk-'+i); - if (checkbox) checkbox.checked = !!on; + if (checkbox) { + // Use the actual binary state, not brightness + checkbox.checked = !!on; + console.log(`[DWM] Device ${d.host}:${d.port} - BinaryState: ${on ? 'ON' : 'OFF'}, Last brightness: ${data.brightness}%`); + } }) .catch(() => {}); } else {