SecKatie / ha-wyzeapi

Home Assistant Integration for Wyze devices.
762 stars 116 forks source link

[Bug] Detected code that calls async_forward_entry_setup without awaiting #629

Closed kbirger closed 1 month ago

kbirger commented 1 month ago

Describe the bug During initialization, warning in logs:

2024-09-20 23:16:05.338 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration wyzeapi with title:  and entry_id: 360706ae85f657727db4583c1ad72b3c, 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 2161, in async_forward_entry_setup
    _report_non_awaited_platform_forwards(entry, "async_forward_entry_setup")
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1201, 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)

To Reproduce Steps to reproduce the behavior:

  1. Launch home assistant

Expected behavior No error

System configuration System: Docker HA Version: 2024.9.1 WyzeApi Version: 0.1.27

Please update to use the correct APIs. This seems to be 4 months past when they said they will stop supporting it. I love this project, and would hate for it to stop working.

brg468 commented 1 month ago

Not sure where you're seeing 4 months ago, the error says 2025.1. In any case its already been fixed just waiting on a version bump.

https://github.com/SecKatie/ha-wyzeapi/pull/609

@SecKatie.. any chance we can bump to get rid of this message?

brg468 commented 1 month ago

Fix in the new beta release. Closing