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:
parent
38c7b99aef
commit
5e8b46c670
4 changed files with 4 additions and 9 deletions
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -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)",
|
||||
|
|
Loading…
Add table
Reference in a new issue