1
mirror of https://github.com/home-assistant/core synced 2024-08-28 03:36:46 +02:00
ha-core/homeassistant/components/lyric/application_credentials.py
Allen Porter f6370d0522
Add Honeywell Lyric application credentials platform and deprecate configuration in yaml (#72335)
Add Honeywell Lyric application credentials platform and deprecate config yaml
2022-05-23 20:16:21 +02:00

27 lines
836 B
Python

"""Application credentials platform for the Honeywell Lyric 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 LyricLocalOAuth2Implementation
from .const import OAUTH2_AUTHORIZE, 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 LyricLocalOAuth2Implementation(
hass,
auth_domain,
credential,
AuthorizationServer(
authorize_url=OAUTH2_AUTHORIZE,
token_url=OAUTH2_TOKEN,
),
)