mirror of
https://github.com/home-assistant/core.git
synced 2025-08-05 21:55:10 +02:00
Fix memory leak in ambient_station on reload (#49455)
This commit is contained in:
@@ -355,7 +355,11 @@ async def async_setup_entry(hass, config_entry):
|
||||
async def _async_disconnect_websocket(*_):
|
||||
await ambient.client.websocket.disconnect()
|
||||
|
||||
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _async_disconnect_websocket)
|
||||
config_entry.async_on_unload(
|
||||
hass.bus.async_listen_once(
|
||||
EVENT_HOMEASSISTANT_STOP, _async_disconnect_websocket
|
||||
)
|
||||
)
|
||||
|
||||
return True
|
||||
|
||||
|
Reference in New Issue
Block a user