fixed switch

This commit is contained in:
Devaev Maxim 2020-09-07 10:42:54 +03:00
parent 73d0656f64
commit b56ff5034a

View File

@ -48,9 +48,13 @@ export function Gpio() {
for (let type of ["switch", "button"]) {
let el = $(`gpio-${type}-${channel}`);
if (el) {
wm.switchEnabled(el, !state.outputs[channel].busy);
wm.switchEnabled(el, state.outputs[channel].online && !state.outputs[channel].busy);
}
}
let el = $(`gpio-switch-${channel}`);
if (el) {
el.checked = state.outputs[channel].state;
}
}
} else {
for (let el of $$$(".gpio-led")) {