This commit is contained in:
@@ -777,8 +777,8 @@ function renderDevices() {
|
|||||||
if (stateData.status === 'fulfilled') {
|
if (stateData.status === 'fulfilled') {
|
||||||
const checkbox = document.getElementById('dchk-'+i);
|
const checkbox = document.getElementById('dchk-'+i);
|
||||||
if (checkbox) {
|
if (checkbox) {
|
||||||
// stateData.value is the response object, not the boolean
|
// stateData.value is an object {on: false}, need to access the 'on' property
|
||||||
const actualState = !!stateData.value;
|
const actualState = !!stateData.value.on;
|
||||||
checkbox.checked = actualState;
|
checkbox.checked = actualState;
|
||||||
console.log(`[DWM] Device ${d.host}:${d.port} - BinaryState: ${actualState ? 'ON' : 'OFF'}, Last brightness: ${brightnessData.value?.brightness || 'N/A'}%`);
|
console.log(`[DWM] Device ${d.host}:${d.port} - BinaryState: ${actualState ? 'ON' : 'OFF'}, Last brightness: ${brightnessData.value?.brightness || 'N/A'}%`);
|
||||||
console.log(`[DWM] Setting checkbox.checked to: ${actualState}`);
|
console.log(`[DWM] Setting checkbox.checked to: ${actualState}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user