Assign docs URL to a placeholder in SimpliSafe config flow (#61410)

This commit is contained in:
Aaron Bach 2021-12-09 15:41:13 -07:00 committed by GitHub
parent 1f97603f71
commit 58174eaa4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View file

@ -23,6 +23,11 @@ from homeassistant.helpers.typing import ConfigType
from .const import CONF_USER_ID, DOMAIN, LOGGER
CONF_AUTH_CODE = "auth_code"
CONF_DOCS_URL = "docs_url"
AUTH_DOCS_URL = (
"http://home-assistant.io/integrations/simplisafe#getting-an-authorization-code"
)
STEP_USER_SCHEMA = vol.Schema(
{
@ -74,7 +79,10 @@ class SimpliSafeFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
step_id="user",
data_schema=STEP_USER_SCHEMA,
errors=errors or {},
description_placeholders={CONF_URL: self._oauth_values.auth_url},
description_placeholders={
CONF_URL: self._oauth_values.auth_url,
CONF_DOCS_URL: AUTH_DOCS_URL,
},
)
async def async_step_reauth(self, config: ConfigType) -> FlowResult:

View file

@ -2,7 +2,7 @@
"config": {
"step": {
"user": {
"description": "Starting in 2021, SimpliSafe has moved to a new authentication mechanism 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\n1. Click [here]({url}) to open the SimpliSafe web app and input your credentials.\n\n2. When the login process is complete, return here and input the authorization code below.",
"description": "SimpliSafe authenticates with Home Assistant via the SimpliSafe web app. Due to technical limitations, there is a manual step at the end of this process; please ensure that you read the [documentation]({docs_url}) before starting.\n\n1. Click [here]({url}) to open the SimpliSafe web app and input your credentials.\n\n2. When the login process is complete, return here and input the authorization code below.",
"data": {
"auth_code": "Authorization Code"
}

View file

@ -16,7 +16,7 @@
"data": {
"auth_code": "Authorization Code"
},
"description": "Starting in 2021, SimpliSafe has moved to a new authentication mechanism 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\n1. Click [here]({url}) to open the SimpliSafe web app and input your credentials.\n\n2. When the login process is complete, return here and input the authorization code below."
"description": "SimpliSafe authenticates with Home Assistant via the SimpliSafe web app. Due to technical limitations, there is a manual step at the end of this process; please ensure that you read the [documentation]({docs_url}) before starting.\n\n1. Click [here]({url}) to open the SimpliSafe web app and input your credentials.\n\n2. When the login process is complete, return here and input the authorization code below."
}
}
},