Expose WLED configuration URL of discovered device (#63983)

* Expose WLED configuration URL of discovered device

* Add test
This commit is contained in:
Franck Nijhof 2022-01-12 17:57:15 +01:00 committed by GitHub
parent e37456fb36
commit 28d49e69c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -83,6 +83,7 @@ class WLEDFlowHandler(ConfigFlow, domain=DOMAIN):
self.context.update(
{
"title_placeholders": {"name": self.discovered_device.info.name},
"configuration_url": f"http://{discovery_info.host}",
}
)
return await self.async_step_zeroconf_confirm()

View File

@ -62,6 +62,9 @@ async def test_full_zeroconf_flow_implementation(
flows = hass.config_entries.flow.async_progress()
assert len(flows) == 1
assert (
flows[0].get("context", {}).get("configuration_url") == "http://192.168.1.123"
)
assert result.get("description_placeholders") == {CONF_NAME: "WLED RGB Light"}
assert result.get("step_id") == "zeroconf_confirm"
assert result.get("type") == RESULT_TYPE_FORM