Skip to content

Commit cd85699

Browse files
andrew-codechimpfrenck
authored andcommitted
Move url out of simplisafe strings (home-assistant#154762)
1 parent f49dfbd commit cd85699

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

homeassistant/components/simplisafe/config_flow.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
from .const import DOMAIN, LOGGER
2828

2929
CONF_AUTH_CODE = "auth_code"
30+
CONF_DOCUMENTATION_URL = "documentation_url"
31+
DOCUMENTATION_URL = (
32+
"https://home-assistant.io/integrations/simplisafe#getting-an-authorization-code"
33+
)
3034

3135
STEP_USER_SCHEMA = vol.Schema(
3236
{
@@ -84,7 +88,10 @@ async def async_step_user(
8488
return self.async_show_form(
8589
step_id="user",
8690
data_schema=STEP_USER_SCHEMA,
87-
description_placeholders={CONF_URL: self._oauth_values.auth_url},
91+
description_placeholders={
92+
CONF_URL: self._oauth_values.auth_url,
93+
CONF_DOCUMENTATION_URL: DOCUMENTATION_URL,
94+
},
8895
)
8996

9097
auth_code = user_input[CONF_AUTH_CODE]
@@ -102,7 +109,10 @@ async def async_step_user(
102109
step_id="user",
103110
data_schema=STEP_USER_SCHEMA,
104111
errors={CONF_AUTH_CODE: "invalid_auth_code_length"},
105-
description_placeholders={CONF_URL: self._oauth_values.auth_url},
112+
description_placeholders={
113+
CONF_URL: self._oauth_values.auth_url,
114+
CONF_DOCUMENTATION_URL: DOCUMENTATION_URL,
115+
},
106116
)
107117

108118
errors = {}
@@ -124,7 +134,10 @@ async def async_step_user(
124134
step_id="user",
125135
data_schema=STEP_USER_SCHEMA,
126136
errors=errors,
127-
description_placeholders={CONF_URL: self._oauth_values.auth_url},
137+
description_placeholders={
138+
CONF_URL: self._oauth_values.auth_url,
139+
CONF_DOCUMENTATION_URL: DOCUMENTATION_URL,
140+
},
128141
)
129142

130143
simplisafe_user_id = str(simplisafe.user_id)

homeassistant/components/simplisafe/strings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"config": {
33
"step": {
44
"user": {
5-
"description": "SimpliSafe authenticates users via its web app. Due to technical limitations, there is a manual step at the end of this process; please ensure that you read the [documentation](http://home-assistant.io/integrations/simplisafe#getting-an-authorization-code) before starting.\n\nWhen you are ready, click [here]({url}) to open the SimpliSafe web app and input your credentials. If you've already logged into SimpliSafe in your browser, you may want to open a new tab, then copy/paste the above URL into that tab.\n\nWhen the process is complete, return here and input the authorization code from the `com.simplisafe.mobile` URL.",
5+
"description": "SimpliSafe authenticates users via its web app. Due to technical limitations, there is a manual step at the end of this process; please ensure that you read the [documentation]({documentation_url}) before starting.\n\nWhen you are ready, click [here]({url}) to open the SimpliSafe web app and input your credentials. If you've already logged into SimpliSafe in your browser, you may want to open a new tab, then copy/paste the above URL into that tab.\n\nWhen the process is complete, return here and input the authorization code from the `com.simplisafe.mobile` URL.",
66
"data": {
77
"auth_code": "Authorization Code"
88
}

0 commit comments

Comments
 (0)