mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 16:17:20 +00:00
Add single config entry to Analytics insights (#114427)
* Add single config entry to Analytics insights * Add single config entry to Analytics insights * Add single config entry to Analytics insights
This commit is contained in:
parent
d5da0a053b
commit
52741d7114
@ -53,7 +53,6 @@ class HomeassistantAnalyticsConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle the initial step."""
|
"""Handle the initial step."""
|
||||||
self._async_abort_entries_match()
|
|
||||||
errors: dict[str, str] = {}
|
errors: dict[str, str] = {}
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
if not user_input.get(CONF_TRACKED_INTEGRATIONS) and not user_input.get(
|
if not user_input.get(CONF_TRACKED_INTEGRATIONS) and not user_input.get(
|
||||||
|
@ -7,5 +7,6 @@
|
|||||||
"integration_type": "service",
|
"integration_type": "service",
|
||||||
"iot_class": "cloud_polling",
|
"iot_class": "cloud_polling",
|
||||||
"loggers": ["python_homeassistant_analytics"],
|
"loggers": ["python_homeassistant_analytics"],
|
||||||
"requirements": ["python-homeassistant-analytics==0.6.0"]
|
"requirements": ["python-homeassistant-analytics==0.6.0"],
|
||||||
|
"single_config_entry": true
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"abort": {
|
"abort": {
|
||||||
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
|
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]"
|
||||||
"already_configured": "[%key:common::config_flow::abort::already_configured_service%]"
|
|
||||||
},
|
},
|
||||||
"error": {
|
"error": {
|
||||||
"no_integration_selected": "You must select at least one integration to track"
|
"no_integration_selected": "You must select at least one integration to track"
|
||||||
|
@ -271,7 +271,8 @@
|
|||||||
"name": "Home Assistant Analytics Insights",
|
"name": "Home Assistant Analytics Insights",
|
||||||
"integration_type": "service",
|
"integration_type": "service",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"iot_class": "cloud_polling"
|
"iot_class": "cloud_polling",
|
||||||
|
"single_config_entry": true
|
||||||
},
|
},
|
||||||
"android_ip_webcam": {
|
"android_ip_webcam": {
|
||||||
"name": "Android IP Webcam",
|
"name": "Android IP Webcam",
|
||||||
|
@ -162,7 +162,7 @@ async def test_form_already_configured(
|
|||||||
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||||
)
|
)
|
||||||
assert result["type"] == FlowResultType.ABORT
|
assert result["type"] == FlowResultType.ABORT
|
||||||
assert result["reason"] == "already_configured"
|
assert result["reason"] == "single_instance_allowed"
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user