Fix memory leak in firmata (#49467)

This commit is contained in:
J. Nick Koston 2021-04-20 06:14:00 -10:00 committed by GitHub
parent 30c99ce954
commit b2db9d3ca2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -184,7 +184,9 @@ async def async_setup_entry(
if config_entry.entry_id in hass.data[DOMAIN]:
await board.async_reset()
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, handle_shutdown)
config_entry.async_on_unload(
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, handle_shutdown)
)
device_registry = await dr.async_get_registry(hass)
device_registry.async_get_or_create(