From 3e2c401253c467f7ccdbdd86d7c95b1c0d9f292b Mon Sep 17 00:00:00 2001 From: Tom Matheussen <13683094+Tommatheussen@users.noreply.github.com> Date: Wed, 5 Nov 2025 11:21:56 +0100 Subject: [PATCH] Allow multiple config entries for Satel Integra (#155833) --- .../components/satel_integra/config_flow.py | 2 ++ .../components/satel_integra/manifest.json | 3 +-- homeassistant/components/satel_integra/strings.json | 3 +++ homeassistant/generated/integrations.json | 3 +-- tests/components/satel_integra/test_config_flow.py | 13 +++++++++++-- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/satel_integra/config_flow.py b/homeassistant/components/satel_integra/config_flow.py index 66fdb93b533..f49eb04fd3c 100644 --- a/homeassistant/components/satel_integra/config_flow.py +++ b/homeassistant/components/satel_integra/config_flow.py @@ -121,6 +121,8 @@ class SatelConfigFlow(ConfigFlow, domain=DOMAIN): errors: dict[str, str] = {} if user_input is not None: + self._async_abort_entries_match({CONF_HOST: user_input[CONF_HOST]}) + valid = await self.test_connection( user_input[CONF_HOST], user_input[CONF_PORT] ) diff --git a/homeassistant/components/satel_integra/manifest.json b/homeassistant/components/satel_integra/manifest.json index c8ba4c95ad4..c94d3924db5 100644 --- a/homeassistant/components/satel_integra/manifest.json +++ b/homeassistant/components/satel_integra/manifest.json @@ -7,6 +7,5 @@ "integration_type": "device", "iot_class": "local_push", "loggers": ["satel_integra"], - "requirements": ["satel-integra==0.3.7"], - "single_config_entry": true + "requirements": ["satel-integra==0.3.7"] } diff --git a/homeassistant/components/satel_integra/strings.json b/homeassistant/components/satel_integra/strings.json index 92944ab8b33..0440665956b 100644 --- a/homeassistant/components/satel_integra/strings.json +++ b/homeassistant/components/satel_integra/strings.json @@ -4,6 +4,9 @@ "code_input_description": "Code to toggle switchable outputs" }, "config": { + "abort": { + "already_configured": "[%key:common::config_flow::abort::already_configured_device%]" + }, "error": { "cannot_connect": "[%key:common::config_flow::error::cannot_connect%]" }, diff --git a/homeassistant/generated/integrations.json b/homeassistant/generated/integrations.json index c3b5c11678c..f3efe0ce0af 100644 --- a/homeassistant/generated/integrations.json +++ b/homeassistant/generated/integrations.json @@ -5749,8 +5749,7 @@ "name": "Satel Integra", "integration_type": "device", "config_flow": true, - "iot_class": "local_push", - "single_config_entry": true + "iot_class": "local_push" }, "schlage": { "name": "Schlage", diff --git a/tests/components/satel_integra/test_config_flow.py b/tests/components/satel_integra/test_config_flow.py index 3f92408bb68..7916db755eb 100644 --- a/tests/components/satel_integra/test_config_flow.py +++ b/tests/components/satel_integra/test_config_flow.py @@ -399,7 +399,7 @@ async def test_cannot_create_same_subentry( assert len(mock_setup_entry.mock_calls) == 0 -async def test_one_config_allowed( +async def test_same_host_config_disallowed( hass: HomeAssistant, mock_config_entry: MockConfigEntry ) -> None: """Test that only one Satel Integra configuration is allowed.""" @@ -409,5 +409,14 @@ async def test_one_config_allowed( DOMAIN, context={"source": SOURCE_USER} ) + assert result["type"] is FlowResultType.FORM + assert result["step_id"] == "user" + assert result["errors"] == {} + + result = await hass.config_entries.flow.async_configure( + result["flow_id"], + MOCK_CONFIG_DATA, + ) + assert result["type"] is FlowResultType.ABORT - assert result["reason"] == "single_instance_allowed" + assert result["reason"] == "already_configured"