use types.option instead of types.string for online/offline on tasmota
This commit is contained in:
parent
f1ffe78a40
commit
ba10e8945c
2 changed files with 8 additions and 8 deletions
|
|
@ -59,13 +59,13 @@ export const tasmota = {
|
|||
[`${name}_online`]: {
|
||||
state: {
|
||||
name: `tele/sonoff${id}/LWT`,
|
||||
type: types.string
|
||||
type: types.option({ Online: "on", online: "on", Offline: "off", offline: "off" })
|
||||
},
|
||||
defaultValue: "offline"
|
||||
defaultValue: "off"
|
||||
},
|
||||
}),
|
||||
icon_color: (name: string, on_color: Color = hex("#00FF00")) => (state: State) => {
|
||||
if (state[`${name}_online`] === "offline") {
|
||||
if (state[`${name}_online`] === "off") {
|
||||
return hex("#888888");
|
||||
} else {
|
||||
if (state[name] === "on") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue