Expose UniFi controller configuration url from discovered entry (#64514)
This commit is contained in:
parent
2b413b86a3
commit
86d32b3440
2 changed files with 12 additions and 0 deletions
|
@ -238,6 +238,9 @@ class UnifiFlowHandler(config_entries.ConfigFlow, domain=UNIFI_DOMAIN):
|
|||
|
||||
if (port := MODEL_PORTS.get(model_description)) is not None:
|
||||
self.config[CONF_PORT] = port
|
||||
self.context[
|
||||
"configuration_url"
|
||||
] = f"https://{self.config[CONF_HOST]}:{port}"
|
||||
|
||||
return await self.async_step_user()
|
||||
|
||||
|
|
|
@ -562,6 +562,15 @@ async def test_form_ssdp(hass):
|
|||
assert result["type"] == "form"
|
||||
assert result["step_id"] == "user"
|
||||
assert result["errors"] == {}
|
||||
|
||||
flows = hass.config_entries.flow.async_progress()
|
||||
assert len(flows) == 1
|
||||
|
||||
assert (
|
||||
flows[0].get("context", {}).get("configuration_url")
|
||||
== "https://192.168.208.1:443"
|
||||
)
|
||||
|
||||
context = next(
|
||||
flow["context"]
|
||||
for flow in hass.config_entries.flow.async_progress()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue