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:
@@ -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",
|
||||
},
|
||||
)
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -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",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user