Skip to content

Commit

Permalink
fix: missing recurisivity on evaluateJavascript. Closes #40
Browse files Browse the repository at this point in the history
  • Loading branch information
brunosabot committed Jan 28, 2025
1 parent fcae151 commit 04dfc8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/evaluateJavascript-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const evaluateJavascript = (config, hass, variables = {}) => {
let latestError = undefined;
for (let index = 0; index < config[key].length; index += 1) {
if (typeof config[key][index] === "object") {
evaluateJavascript(config[key][index], hass);
evaluateJavascript(config[key][index], hass, variables);
} else if (key.endsWith("_javascript")) {
if (prefix === undefined) {
prefix = getPrefixFromHass(hass, variables);
Expand All @@ -46,7 +46,7 @@ const evaluateJavascript = (config, hass, variables = {}) => {
}
}
} else if (typeof config[key] === "object") {
evaluateJavascript(config[key], hass);
evaluateJavascript(config[key], hass, variables);
} else if (key.endsWith("_javascript")) {
if (prefix === undefined) {
prefix = getPrefixFromHass(hass, variables);
Expand Down

0 comments on commit 04dfc8d

Please sign in to comment.