From 36e526f6ac3bf008b76e47c6b1d5944fcd8f7ab2 Mon Sep 17 00:00:00 2001 From: tronikos Date: Fri, 31 Jan 2025 02:35:39 -0800 Subject: [PATCH] Update application_credentials example with redirect_url (#2547) --- docs/core/platform/application_credentials.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/core/platform/application_credentials.md b/docs/core/platform/application_credentials.md index 8d05bece..f66c663d 100644 --- a/docs/core/platform/application_credentials.md +++ b/docs/core/platform/application_credentials.md @@ -132,7 +132,7 @@ Translations for Application Credentials are defined under the `application_cred ```json { "application_credentials": { - "description": "Navigate to the [developer console]({console_url}) to create credentials then enter them below.", + "description": "Navigate to the [developer console]({console_url}) to create credentials. Add `{redirect_url}` under *Authorized redirect URI*. Then enter the credentials below.", } } ``` @@ -141,12 +141,14 @@ You may optionally add description placeholder keys that are added to the messag ```python from homeassistant.core import HomeAssistant +from homeassistant.helpers import config_entry_oauth2_flow async def async_get_description_placeholders(hass: HomeAssistant) -> dict[str, str]: """Return description placeholders for the credentials dialog.""" return { "console_url": "https://example.com/developer/console", + "redirect_url": config_entry_oauth2_flow.async_get_redirect_uri(hass), } ``` -While developing locally, you will need to run `python3 -m script.translations develop` to see changes made to `strings.json` [More info on translating Home Assistant.](translations.md) \ No newline at end of file +While developing locally, you will need to run `python3 -m script.translations develop` to see changes made to `strings.json` [More info on translating Home Assistant.](translations.md)