Skip to content

Commit

Permalink
Make ConfigFlow.async_set_unique_id smarter
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery committed Aug 20, 2024
1 parent a1e3e7f commit 95b532d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion homeassistant/config_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -2385,12 +2385,14 @@ def _abort_if_unique_id_configured(
raise data_entry_flow.AbortFlow(error)

async def async_set_unique_id(
self, unique_id: str | None = None, *, raise_on_progress: bool = True
self, unique_id: str | None = None, *, raise_on_progress: bool | None = None
) -> ConfigEntry | None:
"""Set a unique ID for the config flow.
Returns optionally existing config entry with same ID.
"""
if raise_on_progress is None:
raise_on_progress = self.source != SOURCE_USER
if unique_id is None:
self.context["unique_id"] = None
return None
Expand Down

0 comments on commit 95b532d

Please sign in to comment.