Configurble static duration

master
Kuba Orlik 3 months ago
parent 279d7e6c88
commit 9b86d7f049

@ -5,6 +5,8 @@ const latest_color = require("./latest_color.js");
const { getConfig } = require("./get-config.js"); const { getConfig } = require("./get-config.js");
const { lights } = getConfig(); const { lights } = getConfig();
const DURATION = 0.5; // in seconss
async function send_color( async function send_color(
light_data, light_data,
color, color,
@ -73,7 +75,7 @@ module.exports = async function light_loop(light_index, max_brightness, debug) {
lights[light_index], lights[light_index],
current_color, current_color,
max_brightness, max_brightness,
0.25, DURATION,
debug debug
); );
const after = Date.now(); const after = Date.now();
@ -83,7 +85,7 @@ module.exports = async function light_loop(light_index, max_brightness, debug) {
} }
last_color = current_color; last_color = current_color;
} else { } else {
await sleep(250); await sleep(DURATION * 1000);
} }
} }
}; };

Loading…
Cancel
Save