Prevent the wrong WiZ device from being used when the IP is a different device (#67250)

This commit is contained in:
J. Nick Koston
2022-02-26 14:13:07 -08:00
committed by Paulus Schoutsen
parent f39aea70e6
commit d16f0ba32b
2 changed files with 17 additions and 0 deletions
+8
View File
@@ -50,3 +50,11 @@ async def test_cleanup_on_failed_first_update(hass: HomeAssistant) -> None:
_, entry = await async_setup_integration(hass, wizlight=bulb)
assert entry.state == config_entries.ConfigEntryState.SETUP_RETRY
bulb.async_close.assert_called_once()
async def test_wrong_device_now_has_our_ip(hass: HomeAssistant) -> None:
"""Test setup is retried when the wrong device is found."""
bulb = _mocked_wizlight(None, None, FAKE_SOCKET)
bulb.mac = "dddddddddddd"
_, entry = await async_setup_integration(hass, wizlight=bulb)
assert entry.state == config_entries.ConfigEntryState.SETUP_RETRY