Codegnosis / givtcp-battery-card

A simple battery card for Home Assistant for GivTCP users
MIT License
8 stars 1 forks source link

Pre-calculate battery stats based on GivTCP UoM attribute #22

Closed Codegnosis closed 8 months ago

Codegnosis commented 8 months ago

Resolves #21 - the card did not previously take into account the configurable unit_of_measurement attribute available in the GivTCP entities. This PR fixes the issue, in addition to refactoring the code to pre-calculate all statistics during render time in a single object. Thanks to @gcoan for reporting the issue.