mirror of
https://github.com/home-assistant/core.git
synced 2025-08-02 01:58:20 +00:00
Make ConfigFlow.async_set_unique_id smarter
This commit is contained in:
parent
a1e3e7f24f
commit
95b532df41
@ -2385,12 +2385,14 @@ class ConfigFlow(ConfigEntryBaseFlow):
|
|||||||
raise data_entry_flow.AbortFlow(error)
|
raise data_entry_flow.AbortFlow(error)
|
||||||
|
|
||||||
async def async_set_unique_id(
|
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:
|
) -> ConfigEntry | None:
|
||||||
"""Set a unique ID for the config flow.
|
"""Set a unique ID for the config flow.
|
||||||
|
|
||||||
Returns optionally existing config entry with same ID.
|
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:
|
if unique_id is None:
|
||||||
self.context["unique_id"] = None
|
self.context["unique_id"] = None
|
||||||
return None
|
return None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user