mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 00:37:13 +00:00
Expose Axis device configuration url from discovered entry (#64517)
This commit is contained in:
parent
66c2520a94
commit
1551da33ac
@ -205,10 +205,15 @@ class AxisFlowHandler(config_entries.ConfigFlow, domain=AXIS_DOMAIN):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
self.context["title_placeholders"] = {
|
self.context.update(
|
||||||
CONF_NAME: device[CONF_NAME],
|
{
|
||||||
CONF_HOST: device[CONF_HOST],
|
"title_placeholders": {
|
||||||
}
|
CONF_NAME: device[CONF_NAME],
|
||||||
|
CONF_HOST: device[CONF_HOST],
|
||||||
|
},
|
||||||
|
"configuration_url": f"http://{device[CONF_HOST]}:{device[CONF_PORT]}",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
self.discovery_schema = {
|
self.discovery_schema = {
|
||||||
vol.Required(CONF_HOST, default=device[CONF_HOST]): str,
|
vol.Required(CONF_HOST, default=device[CONF_HOST]): str,
|
||||||
|
@ -319,6 +319,10 @@ async def test_discovery_flow(hass, source: str, discovery_info: dict):
|
|||||||
assert result["type"] == RESULT_TYPE_FORM
|
assert result["type"] == RESULT_TYPE_FORM
|
||||||
assert result["step_id"] == SOURCE_USER
|
assert result["step_id"] == SOURCE_USER
|
||||||
|
|
||||||
|
flows = hass.config_entries.flow.async_progress()
|
||||||
|
assert len(flows) == 1
|
||||||
|
assert flows[0].get("context", {}).get("configuration_url") == "http://1.2.3.4:80"
|
||||||
|
|
||||||
with respx.mock:
|
with respx.mock:
|
||||||
mock_default_vapix_requests(respx)
|
mock_default_vapix_requests(respx)
|
||||||
result = await hass.config_entries.flow.async_configure(
|
result = await hass.config_entries.flow.async_configure(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user