Olen / lovelace-flower-card

Lovelace Flower Card to match the custom plant integration

Home Page:https://github.com/Olen/homeassistant-plant/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Battery icon shows red low battery state when just unavailable

magune opened this issue · comments

The battery icon shows in red if battery% is low, which is expected. But if the battery sensor is just unavailable, it also shows in red indicating poor battery level. Gray color would be better if battery sensor is unavailable.

Hm

There is code to supposedly handle it:

            case this._hass.states[battery_sensor].state == 'unavailable':
              var icon = "mdi:battery-off-outline";
              var battery_color = "rgba(158,158,158,1)";
              var value =  this._hass.localize('state.default.unavailable');
              break;

Do you know what the actual state of the battery sensor is?

I made a quick fix in https://github.com/Olen/lovelace-flower-card/tree/battery_indicator
That should probably take care of it, but it might lead to some other issues.