Fix unload for Alexa Devices (#147548)

This commit is contained in:
Simone Chemelli 2025-06-26 02:55:58 +03:00 committed by GitHub
parent f0a78aadbe
commit 6290facffb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,5 +29,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: AmazonConfigEntry) -> bo
async def async_unload_entry(hass: HomeAssistant, entry: AmazonConfigEntry) -> bool:
"""Unload a config entry."""
await entry.runtime_data.api.close()
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
coordinator = entry.runtime_data
if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
await coordinator.api.close()
return unload_ok