master
Kuba Orlik 11 months ago
parent 41aceae340
commit b6e684d1f9

@ -47,13 +47,18 @@ module.exports = async function light_loop(light_index, max_brightness, debug) {
const current_color = latest_color.get().slice(from, to); const current_color = latest_color.get().slice(from, to);
let is_changed = false; let is_changed = false;
for (i in last_color) { for (i in last_color) {
if (last_color.get()[i] != current_color[i]) { if (last_color[i] != current_color[i]) {
is_changed = true; is_changed = true;
break; break;
} }
} }
if (is_changed) { if (is_changed) {
await send_color(lights[light_index], current_color); await send_color(
lights[light_index],
current_color,
max_brightness,
debug
);
last_color = current_color; last_color = current_color;
} else { } else {
await sleep(10); await sleep(10);

Loading…
Cancel
Save