mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Make sure include_ignore=False always works with _async_current_entries (#48196)
If the step was anything other than SOURCE_USER, include_ignore=False would not be honored
This commit is contained in:
@@ -1021,14 +1021,20 @@ class ConfigFlow(data_entry_flow.FlowHandler):
|
||||
self.context["confirm_only"] = True
|
||||
|
||||
@callback
|
||||
def _async_current_entries(self, include_ignore: bool = False) -> list[ConfigEntry]:
|
||||
def _async_current_entries(
|
||||
self, include_ignore: bool | None = None
|
||||
) -> list[ConfigEntry]:
|
||||
"""Return current entries.
|
||||
|
||||
If the flow is user initiated, filter out ignored entries unless include_ignore is True.
|
||||
"""
|
||||
config_entries = self.hass.config_entries.async_entries(self.handler)
|
||||
|
||||
if include_ignore or self.source != SOURCE_USER:
|
||||
if (
|
||||
include_ignore is True
|
||||
or include_ignore is None
|
||||
and self.source != SOURCE_USER
|
||||
):
|
||||
return config_entries
|
||||
|
||||
return [entry for entry in config_entries if entry.source != SOURCE_IGNORE]
|
||||
|
||||
Reference in New Issue
Block a user