mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
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
@ -18,10 +18,6 @@ class ColorExtractorConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle a flow initialized by the user."""
|
"""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:
|
if user_input is not None:
|
||||||
return self.async_create_entry(title=DEFAULT_NAME, data={})
|
return self.async_create_entry(title=DEFAULT_NAME, data={})
|
||||||
|
|
||||||
return self.async_show_form(step_id="user")
|
return self.async_show_form(step_id="user")
|
||||||
|
@ -4,5 +4,6 @@
|
|||||||
"codeowners": ["@GenericStudent"],
|
"codeowners": ["@GenericStudent"],
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/color_extractor",
|
"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": {
|
"user": {
|
||||||
"description": "[%key:common::config_flow::description::confirm_setup%]"
|
"description": "[%key:common::config_flow::description::confirm_setup%]"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"abort": {
|
|
||||||
"single_instance_allowed": "[%key:common::config_flow::abort::single_instance_allowed%]"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"services": {
|
"services": {
|
||||||
|
@ -957,7 +957,8 @@
|
|||||||
"color_extractor": {
|
"color_extractor": {
|
||||||
"name": "ColorExtractor",
|
"name": "ColorExtractor",
|
||||||
"integration_type": "hub",
|
"integration_type": "hub",
|
||||||
"config_flow": true
|
"config_flow": true,
|
||||||
|
"single_config_entry": true
|
||||||
},
|
},
|
||||||
"comed": {
|
"comed": {
|
||||||
"name": "Commonwealth Edison (ComEd)",
|
"name": "Commonwealth Edison (ComEd)",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user