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."""
|
"""Prepare configuration for a discovered Daikin device."""
|
||||||
_LOGGER.debug("Zeroconf user_input: %s", discovery_info)
|
_LOGGER.debug("Zeroconf user_input: %s", discovery_info)
|
||||||
devices = Discovery().poll(ip=discovery_info[CONF_HOST])
|
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._abort_if_unique_id_configured()
|
||||||
self.host = discovery_info[CONF_HOST]
|
self.host = discovery_info[CONF_HOST]
|
||||||
return await self.async_step_user()
|
return await self.async_step_user()
|
||||||
|
|
|
@ -47,7 +47,7 @@ def mock_daikin_discovery():
|
||||||
with patch("homeassistant.components.daikin.config_flow.Discovery") as Discovery:
|
with patch("homeassistant.components.daikin.config_flow.Discovery") as Discovery:
|
||||||
Discovery().poll.return_value = {
|
Discovery().poll.return_value = {
|
||||||
"127.0.01": {"mac": "AABBCCDDEEFF", "id": "test"}
|
"127.0.01": {"mac": "AABBCCDDEEFF", "id": "test"}
|
||||||
}
|
}.values()
|
||||||
yield Discovery
|
yield Discovery
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue