syssi/xiaomi_raw

ERROR (MainThread) [homeassistant.config] Platform error: switch - Exception importing custom_components.xiaomi_miio_raw.switch

Closed this issue · 1 comments

I am on 2024.2.4 HA and the integration can not load throwing below error:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 847, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 864, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 994, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/xiaomi_miio_raw/switch.py", line 59, in <module>
    @asyncio.coroutine
     ^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'. Did you mean: 'coroutines'?

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config.py", line 1518, in async_process_component_config
    platform = p_integration.get_platform(domain)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 856, in get_platform
    raise ImportError(
ImportError: Exception importing custom_components.xiaomi_miio_raw.switch```

I see following on Developer Tools page if I press Check Configuration button:

Configuration warnings

Platform error 'switch' from integration 'xiaomi_miio_raw' - Exception importing custom_components.xiaomi_miio_raw.switch

  • Core 2024.4.2
  • Supervisor 2024.04.0
  • Operating System 12.1
  • Frontend 20240404.1