mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Add descriptions for config flow in Habitica integration (#131461)
This commit is contained in:
parent
04b8a686dc
commit
d587e71f8d
@ -25,7 +25,15 @@ from homeassistant.helpers.selector import (
|
||||
TextSelectorType,
|
||||
)
|
||||
|
||||
from .const import CONF_API_USER, DEFAULT_URL, DOMAIN
|
||||
from .const import (
|
||||
CONF_API_USER,
|
||||
DEFAULT_URL,
|
||||
DOMAIN,
|
||||
FORGOT_PASSWORD_URL,
|
||||
HABITICANS_URL,
|
||||
SIGN_UP_URL,
|
||||
SITE_DATA_URL,
|
||||
)
|
||||
|
||||
STEP_ADVANCED_DATA_SCHEMA = vol.Schema(
|
||||
{
|
||||
@ -69,6 +77,10 @@ class HabiticaConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
return self.async_show_menu(
|
||||
step_id="user",
|
||||
menu_options=["login", "advanced"],
|
||||
description_placeholders={
|
||||
"signup": SIGN_UP_URL,
|
||||
"habiticans": HABITICANS_URL,
|
||||
},
|
||||
)
|
||||
|
||||
async def async_step_login(
|
||||
@ -125,6 +137,7 @@ class HabiticaConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
data_schema=STEP_LOGIN_DATA_SCHEMA, suggested_values=user_input
|
||||
),
|
||||
errors=errors,
|
||||
description_placeholders={"forgot_password": FORGOT_PASSWORD_URL},
|
||||
)
|
||||
|
||||
async def async_step_advanced(
|
||||
@ -175,4 +188,8 @@ class HabiticaConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
data_schema=STEP_ADVANCED_DATA_SCHEMA, suggested_values=user_input
|
||||
),
|
||||
errors=errors,
|
||||
description_placeholders={
|
||||
"site_data": SITE_DATA_URL,
|
||||
"default_url": DEFAULT_URL,
|
||||
},
|
||||
)
|
||||
|
@ -6,6 +6,11 @@ CONF_API_USER = "api_user"
|
||||
|
||||
DEFAULT_URL = "https://habitica.com"
|
||||
ASSETS_URL = "https://habitica-assets.s3.amazonaws.com/mobileApp/images/"
|
||||
SITE_DATA_URL = "https://habitica.com/user/settings/siteData"
|
||||
FORGOT_PASSWORD_URL = "https://habitica.com/forgot-password"
|
||||
SIGN_UP_URL = "https://habitica.com/register"
|
||||
HABITICANS_URL = "https://habitica.com/static/img/home-main@3x.ffc32b12.png"
|
||||
|
||||
DOMAIN = "habitica"
|
||||
|
||||
# service constants
|
||||
|
@ -15,26 +15,39 @@
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"title": "Habitica - Gamify your life",
|
||||
"menu_options": {
|
||||
"login": "Login to Habitica",
|
||||
"advanced": "Login to other instances"
|
||||
},
|
||||
"description": "Connect your Habitica profile to allow monitoring of your user's profile and tasks."
|
||||
"description": " Connect your Habitica account to keep track of your adventurer's stats, progress, and manage your to-dos and daily tasks.\n\n[Don't have a Habitica account? Sign up here.]({signup})"
|
||||
},
|
||||
"login": {
|
||||
"title": "[%key:component::habitica::config::step::user::menu_options::login%]",
|
||||
"data": {
|
||||
"username": "Email or username (case-sensitive)",
|
||||
"password": "[%key:common::config_flow::data::password%]"
|
||||
}
|
||||
},
|
||||
"data_description": {
|
||||
"username": "Email or username (case-sensitive) to connect Home Assistant to your Habitica account",
|
||||
"password": "Password for the account to connect Home Assistant to Habitica"
|
||||
},
|
||||
"description": "Enter your login details to start using Habitica with Home Assistant\n\n[Forgot your password?]({forgot_password})"
|
||||
},
|
||||
"advanced": {
|
||||
"title": "[%key:component::habitica::config::step::user::menu_options::advanced%]",
|
||||
"data": {
|
||||
"url": "[%key:common::config_flow::data::url%]",
|
||||
"api_user": "User ID",
|
||||
"api_key": "API Token",
|
||||
"verify_ssl": "[%key:common::config_flow::data::verify_ssl%]"
|
||||
},
|
||||
"description": "You can retrieve your `User ID` and `API Token` from **Settings -> Site Data** on Habitica or the instance you want to connect to"
|
||||
"data_description": {
|
||||
"url": "URL of the Habitica installation to connect to. Defaults to `{default_url}`",
|
||||
"api_user": "User ID of your Habitica account",
|
||||
"api_key": "API Token of the Habitica account"
|
||||
},
|
||||
"description": "You can retrieve your `User ID` and `API Token` from [**Settings -> Site Data**]({site_data}) on Habitica or the instance you want to connect to"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user