1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Move Ecobee authorization URL out of strings.json (#154332)

This commit is contained in:
Oliver Gründel
2025-10-14 14:49:45 +02:00
committed by GitHub
parent 6e515d4829
commit b517774be0
3 changed files with 13 additions and 4 deletions

View File

@@ -61,5 +61,8 @@ class EcobeeFlowHandler(ConfigFlow, domain=DOMAIN):
return self.async_show_form(
step_id="authorize",
errors=errors,
description_placeholders={"pin": self._ecobee.pin},
description_placeholders={
"pin": self._ecobee.pin,
"auth_url": "https://www.ecobee.com/consumerportal/index.html",
},
)

View File

@@ -8,7 +8,7 @@
}
},
"authorize": {
"description": "Please authorize this app at https://www.ecobee.com/consumerportal/index.html with PIN code:\n\n{pin}\n\nThen, select **Submit**."
"description": "Please authorize this app at {auth_url} with PIN code:\n\n{pin}\n\nThen, select **Submit**."
}
},
"error": {

View File

@@ -48,7 +48,10 @@ async def test_pin_request_succeeds(hass: HomeAssistant) -> None:
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "authorize"
assert result["description_placeholders"] == {"pin": "test-pin"}
assert result["description_placeholders"] == {
"pin": "test-pin",
"auth_url": "https://www.ecobee.com/consumerportal/index.html",
}
async def test_pin_request_fails(hass: HomeAssistant) -> None:
@@ -107,4 +110,7 @@ async def test_token_request_fails(hass: HomeAssistant) -> None:
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "authorize"
assert result["errors"]["base"] == "token_request_failed"
assert result["description_placeholders"] == {"pin": "test-pin"}
assert result["description_placeholders"] == {
"pin": "test-pin",
"auth_url": "https://www.ecobee.com/consumerportal/index.html",
}