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 {