From 69e8895a30584f32ec45ff49a159e48363ba38de Mon Sep 17 00:00:00 2001 From: kikediazfernandez Date: Sat, 12 Oct 2024 12:24:26 +0200 Subject: [PATCH] Fix deprecated call to async_forward_entry_setup --- custom_components/ideenergy/__init__.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/custom_components/ideenergy/__init__.py b/custom_components/ideenergy/__init__.py index c9247d1..eb626da 100644 --- a/custom_components/ideenergy/__init__.py +++ b/custom_components/ideenergy/__init__.py @@ -23,7 +23,7 @@ import ideenergy from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_PASSWORD, CONF_USERNAME +from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, Platform from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers.aiohttp_client import async_get_clientsession @@ -43,7 +43,7 @@ from .datacoordinator import DataSetType, IDeCoordinator from .updates import update_integration -PLATFORMS: list[str] = ["sensor"] +PLATFORMS: list[str] = [Platform.SENSOR] _LOGGER = logging.getLogger(__name__) @@ -100,9 +100,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: for platform in PLATFORMS: if entry.options.get(platform, True): coordinator.platforms.append(platform) - hass.async_create_task( - hass.config_entries.async_forward_entry_setup(entry, platform) - ) + await hass.config_entries.async_forward_entry_setups(entry,coordinator.platforms) entry.async_on_unload(entry.add_update_listener(async_reload_entry))