Fix steamist not setting unique id when discovered in user flow (#110915)
parent
a2bd59ab3b
commit
6fc764330f
|
@ -170,6 +170,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
errors["base"] = "unknown"
|
||||
else:
|
||||
if discovery := await async_discover_device(self.hass, host):
|
||||
await self.async_set_unique_id(
|
||||
dr.format_mac(discovery.mac), raise_on_progress=False
|
||||
)
|
||||
return self._async_create_entry_from_device(discovery)
|
||||
self._async_abort_entries_match({CONF_HOST: host})
|
||||
return self.async_create_entry(title=host, data=user_input)
|
||||
|
|
|
@ -91,6 +91,7 @@ async def test_form_with_discovery(hass: HomeAssistant) -> None:
|
|||
assert result2["type"] == FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == DEVICE_NAME
|
||||
assert result2["data"] == DEFAULT_ENTRY_DATA
|
||||
assert result2["context"]["unique_id"] == FORMATTED_MAC_ADDRESS
|
||||
assert len(mock_setup_entry.mock_calls) == 1
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue