From 6c34e5a978f8704e3d657497f3626b94d99257dd Mon Sep 17 00:00:00 2001 From: gluap Date: Sun, 7 Jul 2024 14:50:11 +0200 Subject: [PATCH] fix deprecated entry setup and destruction. --- custom_components/duofern/__init__.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/custom_components/duofern/__init__.py b/custom_components/duofern/__init__.py index a1eb001..0359a8b 100644 --- a/custom_components/duofern/__init__.py +++ b/custom_components/duofern/__init__.py @@ -80,9 +80,8 @@ async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> unsetupDevice(hass, duofernId) for component in DUOFERN_COMPONENTS: - hass.async_create_task( - hass.config_entries.async_forward_entry_unload(config_entry, component) - ) + await hass.config_entries.async_forward_entry_unload(config_entry, component) + newstick = DuofernStickThreaded(serial_port=stick.port, system_code=stick.system_code, @@ -132,9 +131,7 @@ def setup(hass: HomeAssistant, config: ConfigType) -> bool: async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Setup the Duofern Config entries (entities, devices, etc...)""" for component in DUOFERN_COMPONENTS: - hass.async_create_task( - hass.config_entries.async_forward_entry_setup(entry, component) - ) + await hass.config_entries.async_forward_entry_setup(entry, component) return True