dylandoamaral / uptime-card

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

Reverse the logic for problem device class #91

Closed tetienne closed 3 years ago

tetienne commented 3 years ago

Most of my binary sensors I used for this card have a device class set problem. From the HA documentation:

problem: on means problem detected, off means no problem (OK)

So it means that out of the box, this card reverse all the states for my binary sensors. I have to set the ok value to off and the ko value to on.

What do you think to apply a specific logic for this device class?

dylandoamaral commented 3 years ago

Hi, I think it is too specific and not very useful since you can still reverse yourself the status using:

type: 'custom:uptime-card'
ko: on
ok: off

Or using the color mapping:

type: 'custom:uptime-card'
color:
  ok: '#C66445'
  ko: '#45C669'

To be more precise, I don't want to make this kind of change because it may surprise the user of this card who expects the basic behaviour.

If you have many uptime card with the same yaml configuration, I suggest you to use: https://github.com/custom-cards/decluttering-card