UniFi Protect cleanup and enable unadopted devices (#73860)
This commit is contained in:
parent
5c5fd746fd
commit
01a9367281
24 changed files with 258 additions and 114 deletions
|
@ -242,3 +242,27 @@ async def test_device_remove_devices(
|
|||
await remove_device(await hass_ws_client(hass), dead_device_entry.id, entry_id)
|
||||
is True
|
||||
)
|
||||
|
||||
|
||||
async def test_device_remove_devices_nvr(
|
||||
hass: HomeAssistant,
|
||||
mock_entry: MockEntityFixture,
|
||||
hass_ws_client: Callable[
|
||||
[HomeAssistant], Awaitable[aiohttp.ClientWebSocketResponse]
|
||||
],
|
||||
) -> None:
|
||||
"""Test we can only remove a NVR device that no longer exists."""
|
||||
assert await async_setup_component(hass, "config", {})
|
||||
|
||||
mock_entry.api.get_bootstrap = AsyncMock(return_value=mock_entry.api.bootstrap)
|
||||
await hass.config_entries.async_setup(mock_entry.entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
entry_id = mock_entry.entry.entry_id
|
||||
|
||||
device_registry = dr.async_get(hass)
|
||||
|
||||
live_device_entry = list(device_registry.devices.values())[0]
|
||||
assert (
|
||||
await remove_device(await hass_ws_client(hass), live_device_entry.id, entry_id)
|
||||
is False
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue