Update application_credentials example with redirect_url (#2547)

This commit is contained in:
tronikos 2025-01-31 02:35:39 -08:00 committed by GitHub
parent 9ec91f32d3
commit 36e526f6ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)
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)