Describe the bug
I use two battery-state-cards in my dashboard because they are amazing, however I've been having issues, especially on mobile devices with bloat. Looking at the console logs over a 5 minute period I received nearly a thousand "warn" messages from this card. I do not have anything specifying "state_map" for "unavailable" yet the message is [battery-state-card] Missing option for 'unavailable' in 'state_map.' See screenshot as well.
How to reproduce
have the browser_mod installed, use the following or something similar, any time a browser_mod entity goes "Unavailable" it doesn't matter what you do these "warnings" pop up. You can get rid of the entities showing by using the below but the warnings still continue. So the exclude is just excluding them from view not the processing part of the card. (Should be considered a bug in itself)
`
exclude:
name: state
value: 'Unavailable'
`
Expected behavior
Exclude should happen before card processing and after include/entities. And entities that report 'unavailable' should not be included.
YAML configuration
type: custom:battery-state-card
title: Motion Activated
secondary_info: '{last_changed}'
icon: '{state|equals(off,mdi:motion-sensor-off)|equals(on,mdi:motion-sensor)}'
filter:
include:
- name: attributes.device_class
value: motion
exclude:
- name: attributes.type
value: browser_mod
state_map:
- from: 'off'
to: 0
display: Clear
- from: 'on'
to: 100
display: Motion
bulk_rename:
- from: Motion
- from: Sensor
- from: Front Ring Camera
to: Front Yard
- from: Garage Ring Camera
to: Driveway
- from: Camper Doorbell Camera
to: Alleyway
- from: Front Doorbell Camera
to: Front Door
sort:
- by: state
desc: true
- by: entity.last_changed
desc: true
colors:
steps:
- color: blue
value: 0
- color: '#ff0000'
value: 100
unit: null
collapse: 4
Describe the bug I use two battery-state-cards in my dashboard because they are amazing, however I've been having issues, especially on mobile devices with bloat. Looking at the console logs over a 5 minute period I received nearly a thousand "warn" messages from this card. I do not have anything specifying "state_map" for "unavailable" yet the message is
[battery-state-card] Missing option for 'unavailable' in 'state_map.'
See screenshot as well.How to reproduce have the browser_mod installed, use the following or something similar, any time a browser_mod entity goes "Unavailable" it doesn't matter what you do these "warnings" pop up. You can get rid of the entities showing by using the below but the warnings still continue. So the exclude is just excluding them from view not the processing part of the card. (Should be considered a bug in itself) ` exclude:
Expected behavior Exclude should happen before card processing and after include/entities. And entities that report 'unavailable' should not be included.
YAML configuration
Entity debug data
Dev console errors See screenshot and description
Screenshots
![Screenshot 2024-03-20 103203](https://github.com/maxwroc/battery-state-card/assets/148913404/e8df20cb-0063-4508-bce0-b4a17fc5c1c5)
Version 3.2.1