Files
homeassistant/custom_components/ttlock/application_credentials.py
Victor Alexandrovich Tsyrenschikov 373ed28445 python
2026-03-30 20:25:42 +05:00

27 lines
779 B
Python

"""application_credentials platform the TTLock integration."""
from homeassistant.components.application_credentials import (
AuthorizationServer,
ClientCredential,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_entry_oauth2_flow
from .api import TTLockAuthImplementation
from .const import OAUTH2_TOKEN
async def async_get_auth_implementation(
hass: HomeAssistant, auth_domain: str, credential: ClientCredential
) -> config_entry_oauth2_flow.AbstractOAuth2Implementation:
"""Return custom auth implementation."""
return TTLockAuthImplementation(
hass,
auth_domain,
credential,
AuthorizationServer(
authorize_url="",
token_url=OAUTH2_TOKEN,
),
)