On Airzone cloud unload logout (#103487)
This commit is contained in:
parent
5dd787aa10
commit
779b19ca46
2 changed files with 6 additions and 1 deletions
|
@ -46,7 +46,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||
|
||||
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
"""Unload a config entry."""
|
||||
|
||||
if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
|
||||
hass.data[DOMAIN].pop(entry.entry_id)
|
||||
coordinator: AirzoneUpdateCoordinator = hass.data[DOMAIN].pop(entry.entry_id)
|
||||
await coordinator.airzone.logout()
|
||||
|
||||
return unload_ok
|
||||
|
|
|
@ -24,6 +24,9 @@ async def test_unload_entry(hass: HomeAssistant) -> None:
|
|||
with patch(
|
||||
"homeassistant.components.airzone_cloud.AirzoneCloudApi.login",
|
||||
return_value=None,
|
||||
), patch(
|
||||
"homeassistant.components.airzone_cloud.AirzoneCloudApi.logout",
|
||||
return_value=None,
|
||||
), patch(
|
||||
"homeassistant.components.airzone_cloud.AirzoneCloudApi.list_installations",
|
||||
return_value=[],
|
||||
|
|
Loading…
Add table
Reference in a new issue