Home Assistant Unofficial Reference 2024.12.1
oauth_impl.py
Go to the documentation of this file.
1 """Local implementation of OAuth2 specific to Ondilo to hard code client id and secret and return a proper name."""
2 
3 from homeassistant.core import HomeAssistant
4 from homeassistant.helpers.config_entry_oauth2_flow import LocalOAuth2Implementation
5 
6 from .const import (
7  DOMAIN,
8  OAUTH2_AUTHORIZE,
9  OAUTH2_CLIENTID,
10  OAUTH2_CLIENTSECRET,
11  OAUTH2_TOKEN,
12 )
13 
14 
16  """Local implementation of OAuth2 specific to Ondilo to hard code client id and secret and return a proper name."""
17 
18  def __init__(self, hass: HomeAssistant) -> None:
19  """Just init default class with default values."""
20  super().__init__(
21  hass,
22  DOMAIN,
23  OAUTH2_CLIENTID,
24  OAUTH2_CLIENTSECRET,
25  OAUTH2_AUTHORIZE,
26  OAUTH2_TOKEN,
27  )
28 
29  @property
30  def name(self) -> str:
31  """Name of the implementation."""
32  return "Ondilo"