Fix memory leak in freebox (#49463)

This commit is contained in:
J. Nick Koston 2021-04-20 06:13:28 -10:00 committed by GitHub
parent 7db5d50ce4
commit 786f3163ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,7 +61,9 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry):
"""Close Freebox connection on HA Stop.""" """Close Freebox connection on HA Stop."""
await router.close() await router.close()
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, async_close_connection) entry.async_on_unload(
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, async_close_connection)
)
return True return True