barleybobs / homeassistant-ecowater-softener

A Homeassistant custom component to integrate Ecowater water softeners
https://github.com/barleybobs/homeassistant-ecowater-softener
MIT License
33 stars 10 forks source link

Update sensor.py #32

Closed figorr closed 9 months ago

figorr commented 1 year ago

According to the new HA update to 2023.2 … there is an error at log.

The log is showing entity “water_available” has device class as “water” and “water” cannot have “measure” as state class.

Logger: homeassistant.components.sensor Source: components/sensor/init.py:503 Integration: Sensor (documentation, issues) First occurred: 08:14:16 (1 occurrences) Last logged: 08:14:16

Entity sensor.ecowater_xxxxxxxxxxxxxxx_water_available (<class 'custom_components.ecowater_softener.sensor.EcowaterSensor'>) is using state class 'measurement' which is impossible considering device class ('water') it is using; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

This warning it is shown at HA restarts.

So removing device _class and state_class for the key=WATER_AVAILABLE could be a temporary solution.