From 5e8b46c670153d11ead7e660101cc1b586981873 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Sat, 13 Apr 2024 13:04:39 +0200 Subject: [PATCH] Make color extractor single config entry (#115016) * Make color extractor single config entry * Make color extractor single config entry * Fix --- homeassistant/components/color_extractor/config_flow.py | 4 ---- homeassistant/components/color_extractor/manifest.json | 3 ++- homeassistant/components/color_extractor/strings.json | 3 --- homeassistant/generated/integrations.json | 3 ++- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/color_extractor/config_flow.py b/homeassistant/components/color_extractor/config_flow.py index aacb07d89828e8..aab56eb95378de 100644 --- a/homeassistant/components/color_extractor/config_flow.py +++ b/homeassistant/components/color_extractor/config_flow.py @@ -18,10 +18,6 @@ async def async_step_user( self, user_input: dict[str, Any] | None = None ) -> ConfigFlowResult: """Handle a flow initialized by the user.""" - if self._async_current_entries(): - return self.async_abort(reason="single_instance_allowed") - if user_input is not None: return self.async_create_entry(title=DEFAULT_NAME, data={}) - return self.async_show_form(step_id="user") diff --git a/homeassistant/components/color_extractor/manifest.json b/homeassistant/components/color_extractor/manifest.json index c87ac2540a6229..a86adaac495d1b 100644 --- a/homeassistant/components/color_extractor/manifest.json +++ b/homeassistant/components/color_extractor/manifest.json @@ -4,5 +4,6 @@ "codeowners": ["@GenericStudent"], "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/color_extractor", - "requirements": ["colorthief==0.2.1"] + "requirements": ["colorthief==0.2.1"], + "single_config_entry": true } diff --git a/homeassistant/components/color_extractor/strings.json b/homeassistant/components/color_extractor/strings.json index f66c448f7c2af7..e501879e881729 100644 --- a/homeassistant/components/color_extractor/strings.json +++ b/homeassistant/components/color_extractor/strings.json @@ -4,9 +4,6 @@ "user": { "description": "[%key:common::config_flow::description::confirm_setup%]" } - }, - "abort": { - "single_instance_allowed": "[%key:common::config_flow::abort::single_instance_allowed%]" } }, "services": { diff --git a/homeassistant/generated/integrations.json b/homeassistant/generated/integrations.json index 667639226a1bca..20fbc883207efa 100644 --- a/homeassistant/generated/integrations.json +++ b/homeassistant/generated/integrations.json @@ -957,7 +957,8 @@ "color_extractor": { "name": "ColorExtractor", "integration_type": "hub", - "config_flow": true + "config_flow": true, + "single_config_entry": true }, "comed": { "name": "Commonwealth Edison (ComEd)",