Expose deCONZ configuration url from discovered entry (#64519)
This commit is contained in:
parent
7d66d4c219
commit
3258f66097
4 changed files with 24 additions and 2 deletions
|
@ -17,6 +17,7 @@ from homeassistant.components.deconz.const import (
|
|||
CONF_ALLOW_NEW_DEVICES,
|
||||
CONF_MASTER_GATEWAY,
|
||||
DOMAIN as DECONZ_DOMAIN,
|
||||
HASSIO_CONFIGURATION_URL,
|
||||
)
|
||||
from homeassistant.components.hassio import HassioServiceInfo
|
||||
from homeassistant.components.ssdp import ATTR_UPNP_MANUFACTURER_URL, ATTR_UPNP_SERIAL
|
||||
|
@ -425,6 +426,10 @@ async def test_flow_ssdp_discovery(hass, aioclient_mock):
|
|||
assert result["type"] == RESULT_TYPE_FORM
|
||||
assert result["step_id"] == "link"
|
||||
|
||||
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"
|
||||
|
||||
aioclient_mock.post(
|
||||
"http://1.2.3.4:80/api",
|
||||
json=[{"success": {"username": API_KEY}}],
|
||||
|
@ -558,6 +563,12 @@ async def test_flow_hassio_discovery(hass):
|
|||
assert result["step_id"] == "hassio_confirm"
|
||||
assert result["description_placeholders"] == {"addon": "Mock Addon"}
|
||||
|
||||
flows = hass.config_entries.flow.async_progress()
|
||||
assert len(flows) == 1
|
||||
assert (
|
||||
flows[0].get("context", {}).get("configuration_url") == HASSIO_CONFIGURATION_URL
|
||||
)
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.deconz.async_setup_entry",
|
||||
return_value=True,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue