al-one / hass-miio-yeelink

Xiaomi Miio Yeelink/Yeelight devices for Home Assistant
178 stars 29 forks source link

Doesn't work on HA 2024.2.1 #82

Closed Forinil closed 9 months ago

Forinil commented 9 months ago

After updating Home Assistant 2024.2.1, the integration doesn't start.

The logs show the following error:

2024-02-11 14:32:19.033 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration 'miio_yeelink': Unable to import component: No module named 'imp'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 251, in _async_setup_component
    component = integration.get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 827, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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/miio_yeelink/__init__.py", line 38, in <module>
    from miio import (
  File "/usr/local/lib/python3.12/site-packages/miio/__init__.py", line 12, in <module>
    from miio.device import Device, DeviceStatus  # isort: skip
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/miio/device.py", line 13, in <module>
    from .miioprotocol import MiIOProtocol
  File "/usr/local/lib/python3.12/site-packages/miio/miioprotocol.py", line 13, in <module>
    import construct
  File "/usr/local/lib/python3.12/site-packages/construct/__init__.py", line 22, in <module>
    from construct.core import *
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 3, in <module>
    import struct, io, binascii, itertools, collections, pickle, sys, os, tempfile, hashlib, importlib, imp
ModuleNotFoundError: No module named 'imp'
olegborushko commented 9 months ago

I also have the same problem

alirezadigi commented 9 months ago

I also have the same problem Any solutions?

olegborushko commented 9 months ago

У меня тоже такая же проблема. Есть решения?

I restarted Home assistant and for some reason the integration worked

alirezadigi commented 9 months ago

@olegborushko thanks for idea,i can also confirm that it works but we still have #83 problem

olegborushko commented 9 months ago

@olegborushko thanks for idea,i can also confirm that it works but we still have #83 problem

Maybe by this time the developers will have finalized the official integration so that it supports all devices Yeelink

Forinil commented 9 months ago

Updating HA to version 2024.2.2 seems to have fixed the issue.

yiskang commented 9 months ago

Upgrading to HA v2024.2.3, the error came back ...

It is most like related to construct, according to this thread. Some say upgrading construct works, but some said it didn't work.

image
juhacz commented 5 months ago

In HA 2024.6.4 I have erro in log: 2024-06-23 22:28:50.492 WARNING (MainThread) [homeassistant.components.light] None (<class 'custom_components.miio_yeelink.YeelightEntity'>) does not set supported color modes, this will stop working in Home Assistant Core 2025.3, please create a bug report at https://github.com/al-one/hass-miio-yeelink/issues