al-one / hass-miio-yeelink

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

yeelink.light.bslamp1 stopped working with 2024.7.2 #91

Open bombaata opened 4 months ago

bombaata commented 4 months ago

Hi, yeelink.light.bslamp1 stopped working with 2024.7.2 and Miio for Yeelight 0.1.13. Debug logs below.

The device is connected to the Wi-Fi network and the light works.


2024-07-15 20:12:19.305 INFO (MainThread) [custom_components.miio_yeelink] Initializing with host 192.168.1.119 (token 03b69...)
2024-07-15 20:12:19.455 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open with args ('/usr/local/lib/python3.12/site-packages/miio/integrations/light/yeelight/specs.yaml',) inside the event loop by custom integration 'miio_yeelink' at custom_components/miio_yeelink/__init__.py, line 428: self._device = Yeelight(ip=host, token=token) (offender: /usr/local/lib/python3.12/site-packages/miio/integrations/light/yeelight/spec_helper.py, line 56: with open(os.path.dirname(__file__) + "/specs.yaml") as filedata:), please create a bug report at https://github.com/al-one/hass-miio-yeelink/issues
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2118, in async_forward_entry_setup
    result = await self._async_forward_entry_setup(entry, domain, True)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2152, in _async_forward_entry_setup
    await entry.async_setup(self.hass, integration=integration)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 586, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 676, in async_setup_entry
    return await component.async_setup_entry(entry)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 195, in async_setup_entry
    return await self._platforms[key].async_setup_entry(config_entry)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 331, in async_setup_entry
    return await self._async_setup_platform(async_create_setup_awaitable)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 361, in _async_setup_platform
    awaitable = create_eager_task(awaitable, loop=hass.loop)
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 37, in create_eager_task
    return Task(coro, loop=loop, name=name, eager_start=True)
  File "/config/custom_components/miio_yeelink/light.py", line 49, in async_setup_entry
    await async_setup_platform(hass, config, async_add_entities)
  File "/config/custom_components/miio_yeelink/light.py", line 62, in async_setup_platform
    entity = YeelightEntity(config)
  File "/config/custom_components/miio_yeelink/__init__.py", line 428, in __init__
    self._device = Yeelight(ip=host, token=token)

2024-07-15 20:12:24.602 ERROR (MainThread) [homeassistant.components.light] Error while setting up miio_yeelink platform for light
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 364, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/miio_yeelink/light.py", line 49, in async_setup_entry
    await async_setup_platform(hass, config, async_add_entities)
  File "/config/custom_components/miio_yeelink/light.py", line 62, in async_setup_platform
    entity = YeelightEntity(config)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/miio_yeelink/__init__.py", line 428, in __init__
    self._device = Yeelight(ip=host, token=token)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/miio/integrations/light/yeelight/yeelight.py", line 274, in __init__
    self._model_info = Yeelight._spec_helper.get_model_info(self.model)
                                                            ^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/miio/device.py", line 194, in model
    return self.info().model
           ^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/miio/click_common.py", line 184, in _wrap
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/miio/device.py", line 148, in info
    return self._fetch_info()
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/miio/device.py", line 153, in _fetch_info
    devinfo = DeviceInfo(self.send("miIO.info"))
                         ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/miio/device.py", line 107, in send
    return self._protocol.send(
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/miio/miioprotocol.py", line 161, in send
    self.send_handshake()
  File "/usr/local/lib/python3.12/site-packages/miio/miioprotocol.py", line 74, in send_handshake
    raise DeviceException("Unable to discover the device %s" % self.ip)
miio.exceptions.DeviceException: Unable to discover the device 192.168.1.119
2024-07-15 20:12:24.687 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration miio_yeelink with title: Lampe de chevet and entry_id: af01a3806df92ddb0c587750d3356019, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
Stack (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2122, in async_forward_entry_setup
    _report_non_awaited_platform_forwards(entry, "async_forward_entry_setup")
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1175, in _report_non_awaited_platform_forwards
    report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 151, in report
    _LOGGER.warning(msg, stack_info=True)```