Fix wrong color

master
Kuba Orlik 11 months ago
parent ce5083d7b7
commit 0add9cb003

@ -17,14 +17,10 @@ async function send_color(light_data, color, max_brightness, debug) {
if (light_data.type == "rgb") {
body.rgb_color = color;
body.brightness = Math.floor(
Math.max(...latest_color.get()) * max_brightness
);
body.brightness = Math.floor(Math.max(...color) * max_brightness);
} else {
// body.brightness = Math.max(1, Math.round(255 * brightness)); // 0 seems to turn it off and make it slower to react
body.brightness = Math.floor(
Math.max(...latest_color.get()) * max_brightness
);
body.brightness = Math.floor(Math.max(...color) * max_brightness);
}
if (debug) {

Loading…
Cancel
Save