Make color extractor single config entry (#115016)

* Make color extractor single config entry

* Make color extractor single config entry

* Fix
This commit is contained in:
Joost Lekkerkerker 2024-04-13 13:04:39 +02:00 committed by GitHub
parent 38c7b99aef
commit 5e8b46c670
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 9 deletions

View file

@ -18,10 +18,6 @@ class ColorExtractorConfigFlow(ConfigFlow, domain=DOMAIN):
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")

View file

@ -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
}

View file

@ -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": {

View file

@ -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)",