From 094fd3d9180072e861354475f0e90623d9014c1e Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 17 Feb 2024 11:04:27 -0600 Subject: [PATCH] Simplify ConfigFlow._async_current_entries (#110799) async_entries supports the flags needed for this function so we can now hand it off instead --- homeassistant/config_entries.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/homeassistant/config_entries.py b/homeassistant/config_entries.py index a6a9a35032f..049f521fcf9 100644 --- a/homeassistant/config_entries.py +++ b/homeassistant/config_entries.py @@ -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]: