Changes as requested by @uwap

This commit is contained in:
Ranlvor 2018-08-07 21:01:59 +02:00
parent 13edfeb154
commit 4f3a6214a1
Signed by untrusted user who does not match committer: Ranlvor
GPG key ID: 5E12D04750EF6F8E

View file

@ -59,12 +59,15 @@ export const tasmota = {
[`${name}_online`]: { [`${name}_online`]: {
state: { state: {
name: `tele/sonoff${id}/LWT`, name: `tele/sonoff${id}/LWT`,
type: types.option({ online: "online", offline: "offline" }) type: types.string
}, },
defaultValue: "offline" 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 = { export const floalt = {
color: (light_id: string) => `floalt_${light_id}_color`, color: (light_id: string) => `floalt_${light_id}_color`,