Skip to content

Commit

Permalink
Make color extractor single config entry (home-assistant#115016)
Browse files Browse the repository at this point in the history
* Make color extractor single config entry

* Make color extractor single config entry

* Fix
  • Loading branch information
joostlek authored Apr 13, 2024
1 parent 38c7b99 commit 5e8b46c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
4 changes: 0 additions & 4 deletions homeassistant/components/color_extractor/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
3 changes: 2 additions & 1 deletion homeassistant/components/color_extractor/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
3 changes: 0 additions & 3 deletions homeassistant/components/color_extractor/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/generated/integrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down

0 comments on commit 5e8b46c

Please sign in to comment.