mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Change unload for P1 Monitor (#62213)
This commit is contained in:
parent
d52caf77d5
commit
779ce6216c
@ -45,8 +45,7 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
"""Unload P1 Monitor config entry."""
|
"""Unload P1 Monitor config entry."""
|
||||||
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
||||||
if unload_ok:
|
if unload_ok:
|
||||||
coordinator = hass.data[DOMAIN].pop(entry.entry_id)
|
del hass.data[DOMAIN][entry.entry_id]
|
||||||
await coordinator.p1monitor.close()
|
|
||||||
return unload_ok
|
return unload_ok
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ async def test_load_unload_config_entry(
|
|||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
assert not hass.data.get(DOMAIN)
|
assert not hass.data.get(DOMAIN)
|
||||||
|
assert mock_config_entry.state is ConfigEntryState.NOT_LOADED
|
||||||
|
|
||||||
|
|
||||||
@patch(
|
@patch(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user