From 52741d711473090104141a994256f09f3f091d7a Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Sun, 31 Mar 2024 15:47:24 +0200 Subject: [PATCH] Add single config entry to Analytics insights (#114427) * Add single config entry to Analytics insights * Add single config entry to Analytics insights * Add single config entry to Analytics insights --- homeassistant/components/analytics_insights/config_flow.py | 1 - homeassistant/components/analytics_insights/manifest.json | 3 ++- homeassistant/components/analytics_insights/strings.json | 3 +-- homeassistant/generated/integrations.json | 3 ++- tests/components/analytics_insights/test_config_flow.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/analytics_insights/config_flow.py b/homeassistant/components/analytics_insights/config_flow.py index 30b8ca12579f83..cef5ac2e9e57e3 100644 --- a/homeassistant/components/analytics_insights/config_flow.py +++ b/homeassistant/components/analytics_insights/config_flow.py @@ -53,7 +53,6 @@ async def async_step_user( self, user_input: dict[str, Any] | None = None ) -> ConfigFlowResult: """Handle the initial step.""" - self._async_abort_entries_match() errors: dict[str, str] = {} if user_input is not None: if not user_input.get(CONF_TRACKED_INTEGRATIONS) and not user_input.get( diff --git a/homeassistant/components/analytics_insights/manifest.json b/homeassistant/components/analytics_insights/manifest.json index d33bb23b1b78b6..adf2d634ef8721 100644 --- a/homeassistant/components/analytics_insights/manifest.json +++ b/homeassistant/components/analytics_insights/manifest.json @@ -7,5 +7,6 @@ "integration_type": "service", "iot_class": "cloud_polling", "loggers": ["python_homeassistant_analytics"], - "requirements": ["python-homeassistant-analytics==0.6.0"] + "requirements": ["python-homeassistant-analytics==0.6.0"], + "single_config_entry": true } diff --git a/homeassistant/components/analytics_insights/strings.json b/homeassistant/components/analytics_insights/strings.json index 6de1ab9dbe4988..00c9cfa44043e7 100644 --- a/homeassistant/components/analytics_insights/strings.json +++ b/homeassistant/components/analytics_insights/strings.json @@ -13,8 +13,7 @@ } }, "abort": { - "cannot_connect": "[%key:common::config_flow::error::cannot_connect%]", - "already_configured": "[%key:common::config_flow::abort::already_configured_service%]" + "cannot_connect": "[%key:common::config_flow::error::cannot_connect%]" }, "error": { "no_integration_selected": "You must select at least one integration to track" diff --git a/homeassistant/generated/integrations.json b/homeassistant/generated/integrations.json index 631c8b1e73cb25..b4eff321e6e995 100644 --- a/homeassistant/generated/integrations.json +++ b/homeassistant/generated/integrations.json @@ -271,7 +271,8 @@ "name": "Home Assistant Analytics Insights", "integration_type": "service", "config_flow": true, - "iot_class": "cloud_polling" + "iot_class": "cloud_polling", + "single_config_entry": true }, "android_ip_webcam": { "name": "Android IP Webcam", diff --git a/tests/components/analytics_insights/test_config_flow.py b/tests/components/analytics_insights/test_config_flow.py index 49ec0ce8d5225c..16ca0812d7dcd7 100644 --- a/tests/components/analytics_insights/test_config_flow.py +++ b/tests/components/analytics_insights/test_config_flow.py @@ -162,7 +162,7 @@ async def test_form_already_configured( DOMAIN, context={"source": config_entries.SOURCE_USER} ) assert result["type"] == FlowResultType.ABORT - assert result["reason"] == "already_configured" + assert result["reason"] == "single_instance_allowed" @pytest.mark.parametrize(