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

Cannot import name 'FanZA5' #52

Open
Kire88Visser opened this issue Dec 13, 2021 · 6 comments
Open

Cannot import name 'FanZA5' #52

Kire88Visser opened this issue Dec 13, 2021 · 6 comments

Comments

@Kire88Visser
Copy link

I am consistently getting the following error in my Home Assistant error log:
Logger: homeassistant.config_entries
Source: config_entries.py:720
First occurred: 3:11:36 PM (8 occurrences)
Last logged: 3:29:44 PM

Error occurred loading configuration flow for integration xiaomi_miio: cannot import name 'FanZA5' from 'miio' (/usr/local/lib/python3.9/site-packages/miio/init.py)

@va77
Copy link

va77 commented Dec 16, 2021

Most likely misconfiguration in python-miio dependency.
Check all manifest files from all custom integrations, all integrations must have the same version in dependencies. (for example python miio greate or equal 0.56.)

@Kire88Visser
Copy link
Author

This is the code I currently see in the miio2 manifest.json file:
{ "domain": "miio2", "name": "Xiaomi miio vacuum STYJ02YM", "version": "1.0.0", "documentation": "", "requirements": [ "construct==2.10.56", "python-miio==0.5.6" ], "dependencies": [], "codeowners": [] }

The dependencies section is currently blank as you can see.

@dibyadip-das
Copy link

My issue got resolved after changing the python-miio version from python-miio==0.5.6 to python-miio>=0.5.6 in manifest.json

Refer to the below image:

image

@nqkdev Can you please update the manifest.json if the fix works for others too?

@monro93
Copy link

monro93 commented Jan 9, 2022

It worked to me too the workarround @dibyadip-das! thanks!
I see some deprecations warnings in the console now, tho.

/config/custom_components/miio2/vacuum.py:137: DeprecationWarning: Call to deprecated function __init__ (This class will become the base class for all vacuum implementations. Use RoborockVacuum to control roborock vacuums.).
  vacuum = Vacuum(host, token)
/usr/local/lib/python3.9/site-packages/hyperframe/flags.py:14: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
  class Flags(collections.MutableSet):
/usr/local/lib/python3.9/site-packages/h2/settings.py:154: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
  class Settings(collections.MutableMapping):
/usr/local/lib/python3.9/asyncio/base_events.py:1460: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
  infos = await tasks.gather(*fs, loop=self)

@Kire88Visser
Copy link
Author

I also tried the workaround from @dibyadip-das.
Unfortunately I am still getting the same error.

@dibyadip-das
Copy link

@Kire88Visser I also have the Xiaomi Cloud Map Extractor custom component installed. Not sure if that did some magic.

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

No branches or pull requests

4 participants