Fix memory leak in heos (#49461)

This commit is contained in:
J. Nick Koston 2021-04-20 06:12:42 -10:00 committed by GitHub
parent 2279b5593d
commit c9fbdfbbbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,7 +82,9 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry):
async def disconnect_controller(event):
await controller.disconnect()
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, disconnect_controller)
entry.async_on_unload(
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, disconnect_controller)
)
# Get players and sources
try: