mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-10 02:46:29 +00:00
Update application_credentials example with redirect_url (#2547)
This commit is contained in:
parent
9ec91f32d3
commit
36e526f6ac
@ -132,7 +132,7 @@ Translations for Application Credentials are defined under the `application_cred
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"application_credentials": {
|
"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,11 +141,13 @@ You may optionally add description placeholder keys that are added to the messag
|
|||||||
|
|
||||||
```python
|
```python
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.helpers import config_entry_oauth2_flow
|
||||||
|
|
||||||
async def async_get_description_placeholders(hass: HomeAssistant) -> dict[str, str]:
|
async def async_get_description_placeholders(hass: HomeAssistant) -> dict[str, str]:
|
||||||
"""Return description placeholders for the credentials dialog."""
|
"""Return description placeholders for the credentials dialog."""
|
||||||
return {
|
return {
|
||||||
"console_url": "https://example.com/developer/console",
|
"console_url": "https://example.com/developer/console",
|
||||||
|
"redirect_url": config_entry_oauth2_flow.async_get_redirect_uri(hass),
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user