From 31131e4ac689620d214055a689e4f3e4c6e34350 Mon Sep 17 00:00:00 2001 From: Aaron Bach Date: Wed, 13 Nov 2019 14:26:52 -0700 Subject: [PATCH] Add small speed improvement when unloading Notion (#28757) --- homeassistant/components/notion/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/notion/__init__.py b/homeassistant/components/notion/__init__.py index 62deb4999d9..1e04c4a8e8e 100644 --- a/homeassistant/components/notion/__init__.py +++ b/homeassistant/components/notion/__init__.py @@ -144,8 +144,12 @@ async def async_unload_entry(hass, config_entry): cancel = hass.data[DOMAIN][DATA_LISTENER].pop(config_entry.entry_id) cancel() - for component in ("binary_sensor", "sensor"): - await hass.config_entries.async_forward_entry_unload(config_entry, component) + tasks = [ + hass.config_entries.async_forward_entry_unload(config_entry, component) + for component in ("binary_sensor", "sensor") + ] + + await asyncio.gather(*tasks) return True