Add small speed improvement when unloading OpenUV (#28758)

pull/28763/head
Aaron Bach 2019-11-13 14:27:15 -07:00 committed by GitHub
parent 31131e4ac6
commit fae8cd48c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -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