Fix memory leak in insteon (#49466)

This commit is contained in:
J. Nick Koston 2021-04-20 06:13:50 -10:00 committed by GitHub
parent 1193c5360d
commit 30c99ce954
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -96,7 +96,9 @@ async def async_setup_entry(hass, entry):
_LOGGER.error("Could not connect to Insteon modem")
raise ConfigEntryNotReady from exception
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, close_insteon_connection)
entry.async_on_unload(
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, close_insteon_connection)
)
await devices.async_load(
workdir=hass.config.config_dir, id_devices=0, load_modem_aldb=0