Fix memory leak in firmata ()

pull/49494/head
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
1 changed files with 3 additions and 1 deletions
homeassistant/components/firmata

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(