Skip to content

Commit

Permalink
Fix for #4 async_forward_entry_setup is deprecated (#5)
Browse files Browse the repository at this point in the history
* change async_add_job to async_create_task

change async_add_job to async_create_task

async_run_job and async_add_job are deprecated and will be removed in Home Assistant 2025.4.
https://developers.home-assistant.io/blog/2024/03/13/deprecate_add_run_job/

* async_forward_entry_setup is deprecated

Calling hass.config_entries.async_forward_entry_setup is deprecated and will be removed in Home Assistant 2025.6. Instead, await hass.config_entries.async_forward_entry_setups as it can load multiple platforms at once and is more efficient since it does not require a separate import executor job for each platform.

https://developers.home-assistant.io/blog/2024/06/12/async_forward_entry_setups/
  • Loading branch information
unregist authored Dec 20, 2024
1 parent 1f0ee78 commit 664bde4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions custom_components/ha_vscode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,5 @@ async def async_setup(hass, config):

async def async_setup_entry(hass, config_entry):
# Add sensor
for platform in PLATFORMS:
hass.async_add_job(
hass.config_entries.async_forward_entry_setup(config_entry, platform)
)
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
return True

0 comments on commit 664bde4

Please sign in to comment.