MTrab / energidataservice

Fetches spot prices from Energi Data Service
GNU General Public License v3.0
194 stars 27 forks source link

async_forward_entry_setup will stop working in Home Assistant 2025.1 #529

Closed TermeHansen closed 3 months ago

TermeHansen commented 5 months ago

Describe the issue

just started HA 2024.7, and it shows a deprecation warning from 2025.1, so not urgent...

homeassistant | 2024-07-03 21:06:47.541 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'energidataservice' calls async_forward_entry_setup for integration, energidataservice with title: Energi Data Service and entry_id: ea1ae291c2f23da7115d19958187118b, which is deprecated and will stop working in Home Assistant 2025.6, await async_forward_entry_setups instead at custom_components/energidataservice/init.py, line 56: hass.async_create_task(, please create a bug report at https://github.com/MTrab/energidataservice/issues

homeassistant | 2024-07-03 21:06:48.267 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration energidataservice with title: Energi Data Service and entry_id: ea1ae291c2f23da7115d19958187118b, 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.

What version of Home Assistant Core has the issue?

2024.7

What was the last working version of Home Assistant Core?

2024.6.4

What type of installation are you running?

Home Assistant Container

Diagnostics information

None

Anything in the logs that might be useful for us?

homeassistant  | 2024-07-04 20:51:24.216 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'energidataservice' calls async_forward_entry_setup for integration, energidataservice with title: Energi Data Service and entry_id: ea1ae291c2f23da7115d19958187118b, which is deprecated and will stop working in Home Assistant 2025.6, await async_forward_entry_setups instead at custom_components/energidataservice/__init__.py, line 56: hass.async_create_task(, please create a bug report at https://github.com/MTrab/energidataservice/issues
homeassistant  | 2024-07-04 20:51:24.727 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration energidataservice with title: Energi Data Service and entry_id: ea1ae291c2f23da7115d19958187118b, 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.
homeassistant  | Stack (most recent call last):
homeassistant  |   File "<frozen runpy>", line 198, in _run_module_as_main
homeassistant  |   File "<frozen runpy>", line 88, in _run_code
homeassistant  |   File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
homeassistant  |     sys.exit(main())
homeassistant  |   File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
homeassistant  |     exit_code = runner.run(runtime_conf)
homeassistant  |   File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
homeassistant  |     return loop.run_until_complete(setup_and_run_hass(runtime_config))
homeassistant  |   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
homeassistant  |     self.run_forever()
homeassistant  |   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
homeassistant  |     self._run_once()
homeassistant  |   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
homeassistant  |     handle._run()
homeassistant  |   File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
homeassistant  |     self._context.run(self._callback, *self._args)
homeassistant  |   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2122, in async_forward_entry_setup
homeassistant  |     _report_non_awaited_platform_forwards(entry, "async_forward_entry_setup")
homeassistant  |   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1175, in _report_non_awaited_platform_forwards
homeassistant  |     report(
homeassistant  |   File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 151, in report
homeassistant  |     _LOGGER.warning(msg, stack_info=True)

Additional information

No response

MTrab commented 5 months ago

Logs doesn't say anything about what you describe. It's 2 different errors. Could you please create an issue for both?

TermeHansen commented 5 months ago

sorry totally missed that it was actually two issues, now opened #531 also, and updated log output in the issue description