Home Assistant Unofficial Reference 2024.12.1
const.py
Go to the documentation of this file.
1 """Constants used by Tesla Fleet integration."""
2 
3 from __future__ import annotations
4 
5 from enum import StrEnum
6 import logging
7 
8 from tesla_fleet_api.const import Scope
9 
10 DOMAIN = "tesla_fleet"
11 
12 CONF_REFRESH_TOKEN = "refresh_token"
13 
14 LOGGER = logging.getLogger(__package__)
15 
16 CLIENT_ID = "71b813eb-4a2e-483a-b831-4dec5cb9bf0d"
17 AUTHORIZE_URL = "https://auth.tesla.com/oauth2/v3/authorize"
18 TOKEN_URL = "https://auth.tesla.com/oauth2/v3/token"
19 
20 SCOPES = [
21  Scope.OPENID,
22  Scope.OFFLINE_ACCESS,
23  Scope.VEHICLE_DEVICE_DATA,
24  Scope.VEHICLE_LOCATION,
25  Scope.VEHICLE_CMDS,
26  Scope.VEHICLE_CHARGING_CMDS,
27  Scope.ENERGY_DEVICE_DATA,
28  Scope.ENERGY_CMDS,
29 ]
30 
31 MODELS = {
32  "S": "Model S",
33  "3": "Model 3",
34  "X": "Model X",
35  "Y": "Model Y",
36 }
37 
38 
39 class TeslaFleetState(StrEnum):
40  """Teslemetry Vehicle States."""
41 
42  ONLINE = "online"
43  ASLEEP = "asleep"
44  OFFLINE = "offline"
45 
46 
47 class TeslaFleetClimateSide(StrEnum):
48  """Tesla Fleet Climate Keeper Modes."""
49 
50  DRIVER = "driver_temp"
51  PASSENGER = "passenger_temp"