IvanVojtko / googlefit-homeassistant

MIT License
27 stars 10 forks source link

Add state_class to sensors for long term statistics #15

Open think-nice-things opened 1 year ago

think-nice-things commented 1 year ago

Hi,

attached is a small patch sensor.py.txt which adds "state_class" = "measurement" to the sensor attributes. This will enable Long Term Statistics for the sensors. I made it such that it returns state_class = measurement for all sensors. I'm not sure it this is true for the sensors which increase during the day (like for example distance).

It would be nice if you could merge this.

best,

Johannes.