dylandoamaral / uptime-card

Minimalistic uptime card for Home Assistant Lovelace UI
266 stars 11 forks source link

Mapping for "none" state. #145

Closed SkeLLLa closed 1 year ago

SkeLLLa commented 1 year ago

Hi. This plugin has an option for "none" color. So I wonder if it's possible to set this state like it's done for ok and ko.

For example let's imagine that there's some sensor with attribute that have values "online", "offline" and "unknown". So it would be nice to have extra mapping for "none" state as well, so "unknown" or whatever could be directly mapped to it.

And current behavior from what I see if I have such 3 states, and map ok -> online, ko -> offline then unknown also displayed as "ko". It's because https://github.com/dylandoamaral/uptime-card/blob/main/src/uptime-card.ts#L247 and the only option is somehow map string attribute to undefined, but I don't see any other options, rather than have none mapping in config.