This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user