diff --git a/config/rzl/utils.js b/config/rzl/utils.js index 57321ab..11b96c6 100644 --- a/config/rzl/utils.js +++ b/config/rzl/utils.js @@ -64,9 +64,16 @@ export const tasmota = { defaultValue: "offline" }, }), - icon_color: function (name: string, on_color: Color = hex("#00FF00")) { - return (state: State) => - state[`${name}_online`] == "offline" ? hex("#888888") : (state[name] == "on" ? on_color : hex("#000000")) + icon_color: (name: string, on_color: Color = hex("#00FF00")) => function (state: State) { + if (state[`${name}_online`] == "offline") { + return hex("#888888") + } else { + if (state[name] == "on") { + return on_color + } else { + return hex("#000000") + } + } } } export const floalt = {