home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.57k stars 29.91k forks source link

Cannot add 3h gen air purifier at 0.109.0b0 #34567

Closed nhok3296 closed 4 years ago

nhok3296 commented 4 years ago

The problem

Environment

fan:
  - platform: xiaomi_miio
    host: 192.168.31.21
    token: YOUR_TOKEN
    model: zhimi.airpurifier.mb3
    name: Xiaomi Air Purifier 3H

Traceback/Error logs

Platform error fan.xiaomi_miio - cannot import name 'AirPurifierMiot' from 'miio' (/usr/local/lib/python3.7/site-packages/miio/__init__.py)

Additional information

probot-home-assistant[bot] commented 4 years ago

Hey there @rytilahti, @syssi, mind taking a look at this issue as its been labeled with a integration (xiaomi_miio) you are listed as a codeowner for? Thanks!

rytilahti commented 4 years ago

Could you check what version.py says in that miio directory? And whether the __init__.py and the rest of the module dir looks correct?

According to https://github.com/home-assistant/core/blob/0.109.0b0/requirements_all.txt#L1655 it should be 0.5.0.1 which is correct. Now, going to https://pypi.org/project/python-miio/#files and downloading the package also shows that miio module has exported AirPurifierMiot as it should be.

nhok3296 commented 4 years ago

Bạn có thể kiểm tra những gì version.pynói trong thư mục miio đó? Và liệu __init__.pyphần còn lại của mô-đun dir có đúng không?

Theo https://github.com/home-assistant/core/blob/0.109.0b0/requirements_all.txt#L1655 thì phải là 0.5.0.1 là đúng. Bây giờ, truy cập https://pypi.org/project/python-miio/#files và tải xuống gói cũng cho thấy mô-đun miio đã xuất AirPurifierMiotnhư mong muốn.

Thank you it worked

rschoell commented 4 years ago

I can confirm it working in 0.109.0b0. What would be nice though is to change the operating modes directly on lovelace. But a very good start

rytilahti commented 4 years ago

Feel free to open a PR or suggest a feature on the community forums, this issue can be closed now as solved.