revert log changes

This commit is contained in:
jane 2021-06-04 22:35:04 -04:00
parent 805d693680
commit 8e4b29a274

View file

@ -98,7 +98,7 @@ function tick_pattern() {
log.debug("TICKING PATTERN")
let parsed = pattern.parsed;
log.info(`${JSON.stringify(pattern)} ${JSON.stringify(parsed)}`);
log.debug(`${JSON.stringify(pattern)} ${JSON.stringify(parsed)}`);
if (parsed && parsed.length > 0) {
for (let i = 0; i < cfg.leds; i++) {
@ -106,23 +106,23 @@ function tick_pattern() {
let command = parsed[id];
log.debug(`pattern ${id} ${command}`);
let name = command["command"];
log.info(`${name} matches: ${functions[name]}`);
log.debug(`${name} matches: ${functions[name]}`);
if (functions[name] != undefined) {
if (functions[name].options && functions[name].options["convert_args"]) {
let param_arg1 = parseInt(command.arg1) || targets[command.arg1];
let param_arg2 = parseInt(command.arg2) || targets[command.arg2];
let result = functions[name].func(i, param_arg1, param_arg2);
log.info(`convert ${command.arg1} ${param_arg1} ${command.arg2} ${param_arg2} ${result}`);
log.debug(`convert ${command.arg1} ${param_arg1} ${command.arg2} ${param_arg2} ${result}`);
targets[command.arg1] = result;
}
else {
let result = functions[name].func(i, command.arg1, command.arg2);
log.info(`no convert ${command.arg1} = ${result}`);
log.debug(`no convert ${command.arg1} = ${result}`);
targets[command.arg1] = result;
}
}
}
log.info(`next: ${targets["r"]}, ${targets["g"]}, ${targets["b"]}`);
log.debug(`next: ${targets["r"]}, ${targets["g"]}, ${targets["b"]}`);
next_pattern[i] = rgb_to_int(targets["r"] || 0, targets["g"] || 0, targets["b"] || 0);
targets["r"] = 0; targets["g"] = 0; targets["b"] = 0;
}