Home Assistant Unofficial Reference 2024.12.1
const.py
Go to the documentation of this file.
1 """Constants for google integration."""
2 
3 from __future__ import annotations
4 
5 from enum import Enum, StrEnum
6 
7 DOMAIN = "google"
8 
9 CONF_CALENDAR_ACCESS = "calendar_access"
10 CONF_CREDENTIAL_TYPE = "credential_type"
11 DATA_CALENDARS = "calendars"
12 DATA_SERVICE = "service"
13 DATA_CONFIG = "config"
14 DATA_STORE = "store"
15 
16 
17 class FeatureAccess(Enum):
18  """Class to represent different access scopes."""
19 
20  read_only = "https://www.googleapis.com/auth/calendar.readonly"
21  read_write = "https://www.googleapis.com/auth/calendar"
22 
23  def __init__(self, scope: str) -> None:
24  """Init instance."""
25  self._scope_scope = scope
26 
27  @property
28  def scope(self) -> str:
29  """Google calendar scope for the feature."""
30  return self._scope_scope
31 
32 
33 DEFAULT_FEATURE_ACCESS = FeatureAccess.read_write
34 
35 
36 class CredentialType(StrEnum):
37  """Type of application credentials used."""
38 
39  DEVICE_AUTH = "device_auth"
40  WEB_AUTH = "web_auth"
41 
42 
43 EVENT_DESCRIPTION = "description"
44 EVENT_END_DATE = "end_date"
45 EVENT_END_DATETIME = "end_date_time"
46 EVENT_IN = "in"
47 EVENT_IN_DAYS = "days"
48 EVENT_IN_WEEKS = "weeks"
49 EVENT_LOCATION = "location"
50 EVENT_START_DATE = "start_date"
51 EVENT_START_DATETIME = "start_date_time"
52 EVENT_SUMMARY = "summary"
53 EVENT_TYPES_CONF = "event_types"