From 4a7185a1a5a8924621df5a58f9d560c2cfe8bbb9 Mon Sep 17 00:00:00 2001 From: Christian Weimann Date: Sun, 12 Jan 2025 19:19:57 +0100 Subject: [PATCH] feat(timers): allow passing additional parameters to timers --- utils/TimerMgr.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/TimerMgr.js b/utils/TimerMgr.js index b868f3d..886c4af 100644 --- a/utils/TimerMgr.js +++ b/utils/TimerMgr.js @@ -9,13 +9,13 @@ class TimerMgr { log.info('Initialization of TimerMgr helper class'); } - create(id, timeout, func) { + create(id, timeout, func, ...params) { if (this.hasTimer(id)) { log.error(`Timer with id ${id} already exists`); return; } log.debug("Create timer with id " + id); - this.#timers[id] = actions.ScriptExecution.createTimer(id, timeout, func); + this.#timers[id] = actions.ScriptExecution.createTimer(id, timeout, func, ...params); } cancel(id) {