From 9b86d7f04968634b6973fe5f80262964a74919af Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Thu, 15 Aug 2024 22:24:28 +0200 Subject: [PATCH] Configurble static duration --- light-loop.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/light-loop.js b/light-loop.js index 3b2dee2..b0e0810 100644 --- a/light-loop.js +++ b/light-loop.js @@ -5,6 +5,8 @@ const latest_color = require("./latest_color.js"); const { getConfig } = require("./get-config.js"); const { lights } = getConfig(); +const DURATION = 0.5; // in seconss + async function send_color( light_data, color, @@ -73,7 +75,7 @@ module.exports = async function light_loop(light_index, max_brightness, debug) { lights[light_index], current_color, max_brightness, - 0.25, + DURATION, debug ); const after = Date.now(); @@ -83,7 +85,7 @@ module.exports = async function light_loop(light_index, max_brightness, debug) { } last_color = current_color; } else { - await sleep(250); + await sleep(DURATION * 1000); } } };