sanjoyg / dirigera_platform

HomeAssistant Integration for Dirigera Platform
MIT License
122 stars 16 forks source link

Does the battery percentage ever get updated? #82

Closed sg26565 closed 1 month ago

sg26565 commented 1 month ago

From what I see in the code, the battery percentage is loaded from the hub when the entries are initialized in sensors.async_setup_entry(). Afterwards, it seems the value is never updated, because the battery percentage is not part of the normal event data. Would it make sense to re-fetch the data via hub.get_xxx_sensors() regularly (e.g. every hour)?

bzh49 commented 1 month ago

the device_class of the sensor.battery_percentage object reported is "diagnostic" and not "battery" as in the official integration which prevents the icon from changing depending on the battery level

sanjoyg commented 1 month ago

This was changed for issue #44. How would you want it changed?

bzh49 commented 1 month ago

I think that if the device_class is battery and not diagnostic the correct icon will come up depending on the value of the battery percentage as in the original add-on.

bzh49 commented 1 month ago

to complete my reply, all battery level coming from any device are sensors , so I don't really understand the #44 request

sanjoyg commented 1 month ago

The abttery % are updated and now are dynamic please do test and let me know will close the issue. Please re-open if it doesnt work