From 4f3a6214a193e1bb918b4c8c9205aaff34538eaf Mon Sep 17 00:00:00 2001 From: Ranlvor Date: Tue, 7 Aug 2018 21:01:59 +0200 Subject: [PATCH] Changes as requested by @uwap --- config/rzl/utils.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/config/rzl/utils.js b/config/rzl/utils.js index 64eadc6..57321ab 100644 --- a/config/rzl/utils.js +++ b/config/rzl/utils.js @@ -59,12 +59,15 @@ export const tasmota = { [`${name}_online`]: { state: { name: `tele/sonoff${id}/LWT`, - type: types.option({ online: "online", offline: "offline" }) + type: types.string }, defaultValue: "offline" }, }), - icon_color: (name: string, on_color: Color = hex("#00FF00")) => (state: State) => state[`${name}_online`] == "offline" ? hex("#888888") : (state[name] == "on" ? on_color : hex("#000000")) + 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")) + } } export const floalt = { color: (light_id: string) => `floalt_${light_id}_color`,