Home Assistant Unofficial Reference 2024.12.1
gateway.py
Go to the documentation of this file.
1 """Handle August connection setup and authentication."""
2 
3 from typing import Any
4 
5 from yalexs.const import DEFAULT_BRAND
6 from yalexs.manager.gateway import Gateway
7 
8 from homeassistant.const import CONF_USERNAME
9 
10 from .const import (
11  CONF_ACCESS_TOKEN_CACHE_FILE,
12  CONF_BRAND,
13  CONF_INSTALL_ID,
14  CONF_LOGIN_METHOD,
15 )
16 
17 
18 class AugustGateway(Gateway):
19  """Handle the connection to August."""
20 
21  def config_entry(self) -> dict[str, Any]:
22  """Config entry."""
23  assert self._config is not None
24  return {
25  CONF_BRAND: self._config.get(CONF_BRAND, DEFAULT_BRAND),
26  CONF_LOGIN_METHOD: self._config[CONF_LOGIN_METHOD],
27  CONF_USERNAME: self._config[CONF_USERNAME],
28  CONF_INSTALL_ID: self._config.get(CONF_INSTALL_ID),
29  CONF_ACCESS_TOKEN_CACHE_FILE: self._access_token_cache_file,
30  }
web.Response get(self, web.Request request, str config_key)
Definition: view.py:88