mirror of
https://github.com/home-assistant/core.git
synced 2026-09-05 02:25:07 -05:00
Move url out of simplisafe strings (#154762)
This commit is contained in:
@@ -27,6 +27,10 @@ from homeassistant.helpers import aiohttp_client, config_validation as cv
|
||||
from .const import DOMAIN, LOGGER
|
||||
|
||||
CONF_AUTH_CODE = "auth_code"
|
||||
CONF_DOCUMENTATION_URL = "documentation_url"
|
||||
DOCUMENTATION_URL = (
|
||||
"https://home-assistant.io/integrations/simplisafe#getting-an-authorization-code"
|
||||
)
|
||||
|
||||
STEP_USER_SCHEMA = vol.Schema(
|
||||
{
|
||||
@@ -84,7 +88,10 @@ class SimpliSafeFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
return self.async_show_form(
|
||||
step_id="user",
|
||||
data_schema=STEP_USER_SCHEMA,
|
||||
description_placeholders={CONF_URL: self._oauth_values.auth_url},
|
||||
description_placeholders={
|
||||
CONF_URL: self._oauth_values.auth_url,
|
||||
CONF_DOCUMENTATION_URL: DOCUMENTATION_URL,
|
||||
},
|
||||
)
|
||||
|
||||
auth_code = user_input[CONF_AUTH_CODE]
|
||||
@@ -102,7 +109,10 @@ class SimpliSafeFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
step_id="user",
|
||||
data_schema=STEP_USER_SCHEMA,
|
||||
errors={CONF_AUTH_CODE: "invalid_auth_code_length"},
|
||||
description_placeholders={CONF_URL: self._oauth_values.auth_url},
|
||||
description_placeholders={
|
||||
CONF_URL: self._oauth_values.auth_url,
|
||||
CONF_DOCUMENTATION_URL: DOCUMENTATION_URL,
|
||||
},
|
||||
)
|
||||
|
||||
errors = {}
|
||||
@@ -124,7 +134,10 @@ class SimpliSafeFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
step_id="user",
|
||||
data_schema=STEP_USER_SCHEMA,
|
||||
errors=errors,
|
||||
description_placeholders={CONF_URL: self._oauth_values.auth_url},
|
||||
description_placeholders={
|
||||
CONF_URL: self._oauth_values.auth_url,
|
||||
CONF_DOCUMENTATION_URL: DOCUMENTATION_URL,
|
||||
},
|
||||
)
|
||||
|
||||
simplisafe_user_id = str(simplisafe.user_id)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"config": {
|
||||
"step": {
|
||||
"user": {
|
||||
"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.",
|
||||
"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.",
|
||||
"data": {
|
||||
"auth_code": "Authorization Code"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user