This commit is contained in:
@@ -730,8 +730,10 @@ function renderDevices() {
|
|||||||
const checkbox = document.getElementById('dchk-'+i);
|
const checkbox = document.getElementById('dchk-'+i);
|
||||||
if (checkbox) {
|
if (checkbox) {
|
||||||
// Use the actual binary state, not brightness
|
// 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] 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(() => {});
|
.catch(() => {});
|
||||||
@@ -740,7 +742,11 @@ function renderDevices() {
|
|||||||
api('GET', `/api/devices/${d.host}/${d.port}/state`)
|
api('GET', `/api/devices/${d.host}/${d.port}/state`)
|
||||||
.then((on) => {
|
.then((on) => {
|
||||||
const c = document.getElementById('dchk-'+i);
|
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(() => {});
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user