From 4a844eadc72c83f3140d741a7aa26dd081f808f4 Mon Sep 17 00:00:00 2001 From: gluap Date: Sun, 7 Jul 2024 14:53:30 +0200 Subject: [PATCH] Revert "fix deprecated entry setup and destruction." This reverts commit 6c34e5a978f8704e3d657497f3626b94d99257dd. --- custom_components/duofern/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/custom_components/duofern/__init__.py b/custom_components/duofern/__init__.py index 0359a8b..a1eb001 100644 --- a/custom_components/duofern/__init__.py +++ b/custom_components/duofern/__init__.py @@ -80,8 +80,9 @@ async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> unsetupDevice(hass, duofernId) for component in DUOFERN_COMPONENTS: - await hass.config_entries.async_forward_entry_unload(config_entry, component) - + hass.async_create_task( + hass.config_entries.async_forward_entry_unload(config_entry, component) + ) newstick = DuofernStickThreaded(serial_port=stick.port, system_code=stick.system_code, @@ -131,7 +132,9 @@ 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: - await hass.config_entries.async_forward_entry_setup(entry, component) + hass.async_create_task( + hass.config_entries.async_forward_entry_setup(entry, component) + ) return True