1
0
mirror of https://github.com/home-assistant/core.git synced 2026-07-07 06:46:17 +01:00
Files
core/homeassistant/components/yoto/application_credentials.py
T
Paul Bottein 6a51b21242 Fix Yoto OAuth flow with cloud credentials (#172544)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2026-05-29 10:30:52 +02:00

27 lines
814 B
Python

"""Application credentials platform for the Yoto integration."""
from homeassistant.components.application_credentials import ClientCredential
from homeassistant.core import HomeAssistant
from homeassistant.helpers.config_entry_oauth2_flow import (
LocalOAuth2ImplementationWithPkce,
)
AUTHORIZE_URL = "https://login.yotoplay.com/authorize"
TOKEN_URL = "https://login.yotoplay.com/oauth/token"
async def async_get_auth_implementation(
hass: HomeAssistant,
auth_domain: str,
credential: ClientCredential,
) -> LocalOAuth2ImplementationWithPkce:
"""Return a Yoto OAuth2 implementation with PKCE."""
return LocalOAuth2ImplementationWithPkce(
hass,
auth_domain,
credential.client_id,
AUTHORIZE_URL,
TOKEN_URL,
credential.client_secret,
)