From a81f4cf387cb0a712415804b5a6fe718c3b78271 Mon Sep 17 00:00:00 2001 From: Guido Schmitz Date: Thu, 8 Oct 2020 16:48:05 +0200 Subject: [PATCH] Fix async_unload_entry for devolo Home Control (#41488) --- .../components/devolo_home_control/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/devolo_home_control/__init__.py b/homeassistant/components/devolo_home_control/__init__.py index ba180fd6ea4..f1f00e9abe7 100644 --- a/homeassistant/components/devolo_home_control/__init__.py +++ b/homeassistant/components/devolo_home_control/__init__.py @@ -1,4 +1,5 @@ """The devolo_home_control integration.""" +import asyncio from functools import partial from devolo_home_control_api.homecontrol import HomeControl @@ -73,8 +74,13 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool async def async_unload_entry(hass, config_entry): """Unload a config entry.""" - unload = await hass.config_entries.async_forward_entry_unload( - config_entry, "switch" + unload = all( + await asyncio.gather( + *[ + hass.config_entries.async_forward_entry_unload(config_entry, platform) + for platform in PLATFORMS + ] + ) ) await hass.async_add_executor_job(