Battery icon shows red low battery state when just unavailable
magune opened this issue · comments
magune commented
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.
Olen commented
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.