From 4b956fdff0384933de22ce31cf7d85977faedca0 Mon Sep 17 00:00:00 2001 From: Jane Petrovna Date: Fri, 4 Jun 2021 22:21:20 -0400 Subject: [PATCH] access array --- lights.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lights.js b/lights.js index 6a838eb..0d5a7c6 100644 --- a/lights.js +++ b/lights.js @@ -97,10 +97,12 @@ function tick_pattern() { // do the parsing stuff here log.debug("TICKING PATTERN") - if (pattern.length > 0) { + let parsed = pattern.parsed; + + if (parsed.length > 0) { for (let i = 0; i < cfg.leds; i++) { - for (let id in pattern) { - let command = pattern[id]; + for (let id in parsed) { + let command = parsed[id]; log.info(`pattern ${id} ${command}`); let name = command["command"]; log.info(`${name} matches: ${functions[name]}`);