Skip to content

Commit b517774

Browse files
authored
Move Ecobee authorization URL out of strings.json (home-assistant#154332)
1 parent 6e515d4 commit b517774

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

homeassistant/components/ecobee/config_flow.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,8 @@ async def async_step_authorize(
6161
return self.async_show_form(
6262
step_id="authorize",
6363
errors=errors,
64-
description_placeholders={"pin": self._ecobee.pin},
64+
description_placeholders={
65+
"pin": self._ecobee.pin,
66+
"auth_url": "https://www.ecobee.com/consumerportal/index.html",
67+
},
6568
)

homeassistant/components/ecobee/strings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
}
99
},
1010
"authorize": {
11-
"description": "Please authorize this app at https://www.ecobee.com/consumerportal/index.html with PIN code:\n\n{pin}\n\nThen, select **Submit**."
11+
"description": "Please authorize this app at {auth_url} with PIN code:\n\n{pin}\n\nThen, select **Submit**."
1212
}
1313
},
1414
"error": {

tests/components/ecobee/test_config_flow.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ async def test_pin_request_succeeds(hass: HomeAssistant) -> None:
4848

4949
assert result["type"] is FlowResultType.FORM
5050
assert result["step_id"] == "authorize"
51-
assert result["description_placeholders"] == {"pin": "test-pin"}
51+
assert result["description_placeholders"] == {
52+
"pin": "test-pin",
53+
"auth_url": "https://www.ecobee.com/consumerportal/index.html",
54+
}
5255

5356

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

0 commit comments

Comments
 (0)