Skip to content

Commit

Permalink
Add small speed improvement when unloading RainMachine (#28759)
Browse files Browse the repository at this point in the history
  • Loading branch information
bachya committed Nov 13, 2019
1 parent fae8cd4 commit 3f2c344
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions homeassistant/components/rainmachine/__init__.py
Expand Up @@ -351,8 +351,12 @@ async def async_unload_entry(hass, config_entry):
remove_listener = hass.data[DOMAIN][DATA_LISTENER].pop(config_entry.entry_id)
remove_listener()

for component in ("binary_sensor", "sensor", "switch"):
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", "switch")
]

await asyncio.gather(*tasks)

return True

Expand Down

0 comments on commit 3f2c344

Please sign in to comment.