Fix unique_id in Zeroconf flow (#36948)
This commit is contained in:
parent
13c0a59e28
commit
9f65dcf4ba
2 changed files with 2 additions and 2 deletions
|
@ -130,7 +130,7 @@ class FlowHandler(config_entries.ConfigFlow):
|
|||
"""Prepare configuration for a discovered Daikin device."""
|
||||
_LOGGER.debug("Zeroconf user_input: %s", discovery_info)
|
||||
devices = Discovery().poll(ip=discovery_info[CONF_HOST])
|
||||
await self.async_set_unique_id(next(iter(devices.values()))[KEY_MAC])
|
||||
await self.async_set_unique_id(next(iter(devices))[KEY_MAC])
|
||||
self._abort_if_unique_id_configured()
|
||||
self.host = discovery_info[CONF_HOST]
|
||||
return await self.async_step_user()
|
||||
|
|
|
@ -47,7 +47,7 @@ def mock_daikin_discovery():
|
|||
with patch("homeassistant.components.daikin.config_flow.Discovery") as Discovery:
|
||||
Discovery().poll.return_value = {
|
||||
"127.0.01": {"mac": "AABBCCDDEEFF", "id": "test"}
|
||||
}
|
||||
}.values()
|
||||
yield Discovery
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue