Closed hawksj closed 8 months ago
@atudor2 Did you ever get a chance to test these changes?
This code has been running in my HA instance for several weeks since my initial PR so I am confident it is working as expected. Will push if there are no complaints.
Hi @hawksj sorry I must admit I forgot - but I refreshed my local HA dev container and tested your change and seems to work as expected my side 👍
Brilliant thanks @atudor2, I will merge this PR.
I'm planning to merge #39 too which will bring it up to date with the changes in #42, which also bumps the version number, hence not bumping it in this PR.
Do you want to test #39 before I merge? It's such a minor change that it may not be necessary but I'd rather get a second opinion first. Cheers
Re-created PR #38 with correct branch
Per https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics
Changed sensor.py to import extra objects from homeassistant.components.sensor to enable the entity to have SensorStateClass and SensorDeviceClass attributes. This allows for statistics graphs on the dashboard such as this:
![image](https://github.com/puttyman/hass-amplifi/assets/58028821/258dc6cb-8f35-42d9-933f-61e78d99e678)
I have tried to match the style of the original code by defining variables outside the function. Please suggest changes if the formatting is not correct.