Skip to content

Commit

Permalink
Add single config entry to Analytics insights (#114427)
Browse files Browse the repository at this point in the history
* Add single config entry to Analytics insights

* Add single config entry to Analytics insights

* Add single config entry to Analytics insights
  • Loading branch information
joostlek authored Mar 31, 2024
1 parent d5da0a0 commit 52741d7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion homeassistant/components/analytics_insights/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Handle the initial step."""
self._async_abort_entries_match()
errors: dict[str, str] = {}
if user_input is not None:
if not user_input.get(CONF_TRACKED_INTEGRATIONS) and not user_input.get(
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/analytics_insights/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"integration_type": "service",
"iot_class": "cloud_polling",
"loggers": ["python_homeassistant_analytics"],
"requirements": ["python-homeassistant-analytics==0.6.0"]
"requirements": ["python-homeassistant-analytics==0.6.0"],
"single_config_entry": true
}
3 changes: 1 addition & 2 deletions homeassistant/components/analytics_insights/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
}
},
"abort": {
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
"already_configured": "[%key:common::config_flow::abort::already_configured_service%]"
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]"
},
"error": {
"no_integration_selected": "You must select at least one integration to track"
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/generated/integrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@
"name": "Home Assistant Analytics Insights",
"integration_type": "service",
"config_flow": true,
"iot_class": "cloud_polling"
"iot_class": "cloud_polling",
"single_config_entry": true
},
"android_ip_webcam": {
"name": "Android IP Webcam",
Expand Down
2 changes: 1 addition & 1 deletion tests/components/analytics_insights/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ async def test_form_already_configured(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["type"] == FlowResultType.ABORT
assert result["reason"] == "already_configured"
assert result["reason"] == "single_instance_allowed"


@pytest.mark.parametrize(
Expand Down

0 comments on commit 52741d7

Please sign in to comment.