Ensure unique id is set for esphome when setup via user flow (#77677)
This commit is contained in:
parent
e326dd2847
commit
9a5bdaf87e
3 changed files with 36 additions and 0 deletions
|
@ -333,6 +333,10 @@ async def async_setup_entry( # noqa: C901
|
|||
if entry_data.device_info is not None and entry_data.device_info.name:
|
||||
cli.expected_name = entry_data.device_info.name
|
||||
reconnect_logic.name = entry_data.device_info.name
|
||||
if entry.unique_id is None:
|
||||
hass.config_entries.async_update_entry(
|
||||
entry, unique_id=entry_data.device_info.name
|
||||
)
|
||||
|
||||
await reconnect_logic.start()
|
||||
entry_data.cleanup_callbacks.append(reconnect_logic.stop_callback)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue