make icon_color more readable
This commit is contained in:
parent
4f3a6214a1
commit
172dc5d0c5
1 changed files with 10 additions and 3 deletions
|
|
@ -64,9 +64,16 @@ export const tasmota = {
|
||||||
defaultValue: "offline"
|
defaultValue: "offline"
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
icon_color: function (name: string, on_color: Color = hex("#00FF00")) {
|
icon_color: (name: string, on_color: Color = hex("#00FF00")) => function (state: State) {
|
||||||
return (state: State) =>
|
if (state[`${name}_online`] == "offline") {
|
||||||
state[`${name}_online`] == "offline" ? hex("#888888") : (state[name] == "on" ? on_color : hex("#000000"))
|
return hex("#888888")
|
||||||
|
} else {
|
||||||
|
if (state[name] == "on") {
|
||||||
|
return on_color
|
||||||
|
} else {
|
||||||
|
return hex("#000000")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export const floalt = {
|
export const floalt = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue