home-assistant-vacuum-styj02ym icon indicating copy to clipboard operation
home-assistant-vacuum-styj02ym copied to clipboard

Cannot import name 'FanZA5'

Open Kire88Visser opened this issue 3 years ago • 6 comments

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)

Kire88Visser avatar Dec 13 '21 14:12 Kire88Visser

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.)

va77 avatar Dec 16 '21 20:12 va77

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.

Kire88Visser avatar Dec 17 '21 12:12 Kire88Visser

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?

dibyadip-das avatar Jan 08 '22 07:01 dibyadip-das

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)

monro93 avatar Jan 09 '22 00:01 monro93

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

Kire88Visser avatar Jan 10 '22 12:01 Kire88Visser

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

dibyadip-das avatar Jan 10 '22 14:01 dibyadip-das