Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HA 2021.9.2 (nwt.derh.wdh318efw1) - AttributeError: 'AirDehumidifier' object has no attribute 'device_info #206

Closed
peterhoe opened this issue Sep 4, 2021 · 9 comments
Labels

Comments

@peterhoe
Copy link

peterhoe commented Sep 4, 2021

Have tried with both V0.6.11 & V0.6.12

Was functioning fine with HaasV2021.8.8 using V0.6.11

On updating to HaasV2021.9.2 i started seeing this error

Error message as follows

Logger: homeassistant.components.climate
Source: custom_components/xiaomi_miio_airpurifier/climate.py:435
Integration: Climate (documentation, issues)
First occurred: 16:40:41 (2 occurrences)
Last logged: 16:40:41

xiaomi_miio_airpurifier: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 633, in async_device_update
await task
File "/config/custom_components/xiaomi_miio_airpurifier/climate.py", line 435, in async_update
state = await self.hass.async_add_executor_job(self._device.status)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/miio/airdehumidifier.py", line 201, in status
if self.device_info is None:
AttributeError: 'AirDehumidifier' object has no attribute 'device_info'

@syssi
Copy link
Owner

syssi commented Sep 4, 2021

pythion-miio has changed a bit. This custom component needs to be updated to be compatible again.

@tehnoinstyle
Copy link

tehnoinstyle commented Sep 4, 2021

Same problem on deerma.humidifier.mjjsq after update HA on V2021.9.2

Not work Xiaomi Air Humidifier and in log error:

Logger: custom_components.xiaomi_miio_airpurifier.fan
Source: custom_components/xiaomi_miio_airpurifier/fan.py:1674
Integration: xiaomi_miio_airpurifier (documentation, issues)
First occurred: 12:59:30 (2 occurrences)
Last logged: 13:00:00

Got exception while fetching the state: {'code': -10000, 'message': 'Resp general error.'}

with both V0.6.11 & V0.6.12

@peterhoe peterhoe changed the title Error on Device update Haas V 2021.9.2 - nwt.derh.wdh318efw1 Error on Device update Haas V 2021.9.2 - nwt.derh.wdh318efw1 - AttributeError: 'AirDehumidifier' object has no attribute 'device_info Sep 6, 2021
@peterhoe
Copy link
Author

pythion-miio has changed a bit. This custom component needs to be updated to be compatible again.

Anything I can do to help?

If you give me an example on one device what changes are required, perhaps I can go through and amend?

@syssi
Copy link
Owner

syssi commented Sep 12, 2021

Go to the release page of the python-miio repository and take a look at the diff file of the last releases. device_info should be mentioned here. Was it removed or moved? Adapt the custom component to access device_info properly again.

@syssi
Copy link
Owner

syssi commented Sep 12, 2021

@rytilahti Could you help me here? It looks like device_info isn't available anymore as property of the AirDehumidifier device class. Probably just an initialization is missing? I don't understand this line because of my limited python skills:

https://github.com/rytilahti/python-miio/blob/master/miio/airdehumidifier.py#L177

I would like to replace this line by

        self.device_info = None

to fix the issue.

@syssi syssi added the bug label Sep 12, 2021
@syssi syssi changed the title Error on Device update Haas V 2021.9.2 - nwt.derh.wdh318efw1 - AttributeError: 'AirDehumidifier' object has no attribute 'device_info HA 2021.9.2 (nwt.derh.wdh318efw1) - AttributeError: 'AirDehumidifier' object has no attribute 'device_info Sep 12, 2021
@rytilahti
Copy link

@syssi oops, the initialization is indeed missing, that slipped somehow through the cracks when the variable got type hinted. It should look like this: https://github.com/rytilahti/python-miio/blob/master/miio/airhumidifier.py#L265

@nielsfaber
Copy link

Having the same problem here.
If I understand correctly, the problem is caused by the version of python-miio which is included with HA?
Is there any way to quick-fix this myself locally?

@syssi
Copy link
Owner

syssi commented Dec 18, 2021

Fixed.

@syssi syssi closed this as completed Dec 18, 2021
@peterhoe
Copy link
Author

peterhoe commented Dec 18, 2021

Confirmed functional with V0.6.16 & Haas V 2021.12.3
Thanks Syssi & rytilahti

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants