Skip to content

Commit 1317e14

Browse files
author
anton_artemov
committed
Fix led switch
1 parent 61c95b4 commit 1317e14

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

fs/script.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -787,16 +787,11 @@ function loadLedStatus() {
787787
fetch('/led_status')
788788
.then(response => response.json())
789789
.then(data => {
790-
const {
791-
r,
792-
g,
793-
b,
794-
mode
795-
} = data;
790+
const { r, g, b, use_rgb } = data;
796791
const hex = "#" + [r, g, b].map(x => x.toString(16).padStart(2, '0')).join('');
797792
document.getElementById('ledColorPicker').value = hex;
798793
document.getElementById('colorPreview').style.backgroundColor = hex;
799-
document.getElementById('colorMode').checked = mode === "true";
794+
document.getElementById('colorMode').checked = use_rgb === true;
800795
})
801796
.catch(err => console.error("Failed to load LED status:", err));
802797
}

0 commit comments

Comments
 (0)