From 70990645a727f6b10045fb66aa581f04d8291007 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 27 Nov 2025 19:14:13 +0100 Subject: [PATCH] Mark config-flow as done in SFR Box IQS (#157439) --- homeassistant/components/sfr_box/config_flow.py | 7 +++++-- homeassistant/components/sfr_box/quality_scale.yaml | 9 +-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/sfr_box/config_flow.py b/homeassistant/components/sfr_box/config_flow.py index a9bac9d1b84..322ce282333 100644 --- a/homeassistant/components/sfr_box/config_flow.py +++ b/homeassistant/components/sfr_box/config_flow.py @@ -39,7 +39,10 @@ class SFRBoxFlowHandler(ConfigFlow, domain=DOMAIN): VERSION = 1 _box: SFRBox - _config: dict[str, Any] = {} + + def __init__(self) -> None: + """Initialize SFR Box flow.""" + self._config: dict[str, Any] = {} async def async_step_user( self, user_input: dict[str, str] | None = None @@ -47,6 +50,7 @@ class SFRBoxFlowHandler(ConfigFlow, domain=DOMAIN): """Handle a flow initialized by the user.""" errors = {} if user_input is not None: + self._async_abort_entries_match({CONF_HOST: user_input[CONF_HOST]}) box = SFRBox( ip=user_input[CONF_HOST], client=async_get_clientsession(self.hass) ) @@ -60,7 +64,6 @@ class SFRBoxFlowHandler(ConfigFlow, domain=DOMAIN): assert system_info is not None await self.async_set_unique_id(system_info.mac_addr) self._abort_if_unique_id_configured() - self._async_abort_entries_match({CONF_HOST: user_input[CONF_HOST]}) self._box = box self._config.update(user_input) return await self.async_step_choose_auth() diff --git a/homeassistant/components/sfr_box/quality_scale.yaml b/homeassistant/components/sfr_box/quality_scale.yaml index b0c008d6598..6f54c4f1045 100644 --- a/homeassistant/components/sfr_box/quality_scale.yaml +++ b/homeassistant/components/sfr_box/quality_scale.yaml @@ -1,13 +1,6 @@ rules: - # Special note, doesn't fall in any of the categories below - # Why can the coordinator state be None? As in, I understand that it can be None if it doesn't support it, but wouldn't these coordinators not be created at all? - ## Bronze - config-flow: - status: todo - comment: | - SFRBoxFlowHandler has a classvar _config. This can be dangerous - self._async_abort_entries_match({CONF_HOST: user_input[CONF_HOST]}) can be tested at the first if statement + config-flow: done test-before-configure: done unique-config-entry: done config-flow-test-coverage: