elad-bar / ha-edgeos

Integration with EdgeOS (Ubiquiti)
133 stars 24 forks source link

sensor.xxxx_last_restart has device class None, state class total_increasing since 2023.2.x #94

Closed alvinchen1 closed 1 year ago

alvinchen1 commented 1 year ago

Hello! Looks like there are some recent changes where state class, device class and state are stricter. Since 2023.2.x getting a new Core Log Warning:

Sensor sensor.xxxx_last_restart has device class None, state class total_increasing and unit None thus indicating it has a numeric value; however, it has the non-numeric value: 2023-01-23 19:58:26 (<class 'datetime.datetime'>); Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

Device:

image

Looks like line 849 in https://github.com/elad-bar/ha-edgeos/blob/master/custom_components/edgeos/component/managers/home_assistant.py

state_class=SensorStateClass.TOTAL_INCREASING

Might need to be dropped?

elad-bar commented 1 year ago

released new version with fix for it, v2.0.25, pls check and let me know if works for you

thanks

alvinchen1 commented 1 year ago

Don't see the error anymore. Thanks!