From 664bde4d4bfaf2d661873a5a1a7c6d80a2aadb25 Mon Sep 17 00:00:00 2001 From: Rob <22579156+unregist@users.noreply.github.com> Date: Sat, 21 Dec 2024 03:21:10 +1000 Subject: [PATCH] Fix for #4 async_forward_entry_setup is deprecated (#5) * 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/ --- custom_components/ha_vscode/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/custom_components/ha_vscode/__init__.py b/custom_components/ha_vscode/__init__.py index b737c03..ad96a06 100644 --- a/custom_components/ha_vscode/__init__.py +++ b/custom_components/ha_vscode/__init__.py @@ -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