From 4173d0d289f30bbfff4483c37782b3089195cab9 Mon Sep 17 00:00:00 2001 From: Frederik Kemner Date: Tue, 29 Oct 2024 22:18:33 +0100 Subject: [PATCH] Update to use async_forward_entry_setups and async_unload_platforms (#22) Replace deprecated methods async_forward_entry_setup and async_forward_entry_unload with async_forward_entry_setups and async_unload_platforms to address deprecation warnings and ensure future compatibility with Home Assistant Core 2025.6. --- custom_components/hass_stadtreinigung_hamburg/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/custom_components/hass_stadtreinigung_hamburg/__init__.py b/custom_components/hass_stadtreinigung_hamburg/__init__.py index d8ac68b..80804e6 100644 --- a/custom_components/hass_stadtreinigung_hamburg/__init__.py +++ b/custom_components/hass_stadtreinigung_hamburg/__init__.py @@ -12,13 +12,11 @@ async def async_setup(hass, config): async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool: """Set up Stadtreinigung Hamburg as config entry.""" - hass.async_create_task( - hass.config_entries.async_forward_entry_setup(config_entry, "sensor") - ) + await hass.config_entries.async_forward_entry_setups(config_entry, ["sensor"]) return True async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool: """Unload a config entry.""" - await hass.config_entries.async_forward_entry_unload(config_entry, "sensor") + await hass.config_entries.async_unload_platforms(config_entry, ["sensor"]) return True