Make ConfigFlow.async_set_unique_id smarter
This commit is contained in:
parent
a1e3e7f24f
commit
95b532df41
1 changed files with 3 additions and 1 deletions
|
@ -2385,12 +2385,14 @@ class ConfigFlow(ConfigEntryBaseFlow):
|
|||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue