mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Add small speed improvement when unloading Ambient PWS (#28756)
This commit is contained in:
parent
8789da36be
commit
c27b94c0e5
@ -1,4 +1,5 @@
|
||||
"""Support for Ambient Weather Station Service."""
|
||||
import asyncio
|
||||
import logging
|
||||
|
||||
from aioambient import Client
|
||||
@ -297,8 +298,12 @@ async def async_unload_entry(hass, config_entry):
|
||||
ambient = hass.data[DOMAIN][DATA_CLIENT].pop(config_entry.entry_id)
|
||||
hass.async_create_task(ambient.ws_disconnect())
|
||||
|
||||
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user