mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 05:05:09 +02:00
Simplify ConfigFlow._async_current_entries (#110799)
async_entries supports the flags needed for this function so we can now hand it off instead
This commit is contained in:
@@ -1909,16 +1909,10 @@ class ConfigFlow(data_entry_flow.FlowHandler):
|
||||
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 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]
|
||||
return self.hass.config_entries.async_entries(
|
||||
self.handler,
|
||||
include_ignore or (include_ignore is None and self.source != SOURCE_USER),
|
||||
)
|
||||
|
||||
@callback
|
||||
def _async_current_ids(self, include_ignore: bool = True) -> set[str | None]:
|
||||
|
Reference in New Issue
Block a user