homeassistant-midea-dehumidifier
homeassistant-midea-dehumidifier copied to clipboard
Usage of device_state_attributes is deprecated in Home Assistant 2021.12.0
According to Home Assistant 2021.12.0, the use of device_state_attributes has been deprecated. I think extra_state_attributes should be used from now on (see Home Assistant's Github Beta channel for more info).
Environment Supervised home assistant 2021.12.0
Steps to reproduce Upgrade from Home Assistant 2021.11.5 to 2021.12.0 In the log log is the following error:
Logger: homeassistant.helpers.entity Source: helpers / entity.py: 549 First occurred: 14:33:13 (5 occurrences) Last logged: 14:35:13
Entity humidifier.midea_dehumidifier_xxxxxxxxxxxxxx (<class 'custom_components.midea_dehumidifier.humidifier.MideaDehumidifierDevice'>) implements device_state_attributes. Please report it to the custom component author.
Do you know if we can just replace the code on entity.py and fix it?
I solved by reading this post:
https://github.com/thomasloven/hass-browser_mod/pull/276
and changing line 272 of the humidifier.py file from
def device_state_attributes(self):
to
def extra_state_attributes(self):
after a restart of HA the error is gone!
I made a PR #42 for it already a month ago when this change was still in the dev branch but unfortunately @barban-dev hasn't updated the code yet
You saved my life ;-) Or rather, my basement is saved! Many Thanks
merged