Allow to reconfigure integrations with single_config_entry set (#117939)

This commit is contained in:
Jan-Philipp Benecke 2024-05-23 08:41:12 +02:00 committed by GitHub
parent cc17725d1d
commit 88257c9c42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View file

@ -1231,7 +1231,8 @@ class ConfigEntriesFlowManager(data_entry_flow.FlowManager[ConfigFlowResult]):
# Avoid starting a config flow on an integration that only supports
# a single config entry, but which already has an entry
if (
context.get("source") not in {SOURCE_IGNORE, SOURCE_REAUTH, SOURCE_UNIGNORE}
context.get("source")
not in {SOURCE_IGNORE, SOURCE_REAUTH, SOURCE_UNIGNORE, SOURCE_RECONFIGURE}
and self.config_entries.async_has_entries(handler, include_ignore=False)
and await _support_single_config_entry_only(self.hass, handler)
):

View file

@ -5027,6 +5027,11 @@ async def test_hashable_non_string_unique_id(
None,
{"type": data_entry_flow.FlowResultType.FORM, "step_id": "reauth_confirm"},
),
(
config_entries.SOURCE_RECONFIGURE,
None,
{"type": data_entry_flow.FlowResultType.FORM, "step_id": "reauth_confirm"},
),
(
config_entries.SOURCE_UNIGNORE,
None,
@ -5111,6 +5116,11 @@ async def test_starting_config_flow_on_single_config_entry(
None,
{"type": data_entry_flow.FlowResultType.FORM, "step_id": "reauth_confirm"},
),
(
config_entries.SOURCE_RECONFIGURE,
None,
{"type": data_entry_flow.FlowResultType.FORM, "step_id": "reauth_confirm"},
),
(
config_entries.SOURCE_UNIGNORE,
None,