Skip to content

Commit

Permalink
Add small speed improvement when unloading OpenUV (#28758)
Browse files Browse the repository at this point in the history
  • Loading branch information
bachya committed Nov 13, 2019
1 parent 31131e4 commit fae8cd4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions homeassistant/components/openuv/__init__.py
Expand Up @@ -233,8 +233,12 @@ async def async_unload_entry(hass, config_entry):
"""Unload an OpenUV config entry."""
hass.data[DOMAIN][DATA_OPENUV_CLIENT].pop(config_entry.entry_id)

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

Expand Down

0 comments on commit fae8cd4

Please sign in to comment.