maxwroc / battery-state-card

Battery state card for Home Assistant
MIT License
848 stars 38 forks source link

Exception: Cannot read properties of undefined (reading 'battery_level') #696

Closed guber73 closed 6 months ago

guber73 commented 7 months ago

Describe the bug

How to reproduce

Expected behavior

YAML configuration


# please paste here your card config (before backticks below; do not remove them)

Entity debug data

Dev console errors

Screenshots

Version

maxwroc commented 7 months ago

There is only one place where this exception can happen and it would mean that you have an entity which doesn't have any attributes. I thought this cannot happen.

pcampan commented 6 months ago

Similar issue appeared in my instance about 12 hours ago. But I found the entity that had removed and fixed the card. Thanks for the tip to remove the error.

maxwroc commented 6 months ago

Will be fixed in the next release

maxwroc commented 6 months ago

I have realized what was the actual reason of these errors. It was not the case of missing attributes of the entity but missing entity. In the next release when entity is not found you'll be seeing a proper message

https://github.com/maxwroc/battery-state-card/issues/182