Home Assistant Unofficial Reference 2024.12.1
const.py
Go to the documentation of this file.
1 """Constants used by Tessie integration."""
2 
3 from __future__ import annotations
4 
5 from enum import IntEnum, StrEnum
6 
7 DOMAIN = "tessie"
8 
9 MODELS = {
10  "model3": "Model 3",
11  "modelx": "Model X",
12  "modely": "Model Y",
13  "models": "Model S",
14 }
15 
16 TRANSLATED_ERRORS = {
17  "unknown": "unknown",
18  "not supported": "not_supported",
19  "cable connected": "cable_connected",
20  "already active": "already_active",
21  "already inactive": "already_inactive",
22  "incorrect pin": "incorrect_pin",
23  "no cable": "no_cable",
24 }
25 
26 
27 class TessieState(StrEnum):
28  """Tessie status."""
29 
30  ASLEEP = "asleep"
31  ONLINE = "online"
32 
33 
34 class TessieStatus(StrEnum):
35  """Tessie status."""
36 
37  ASLEEP = "asleep"
38  AWAKE = "awake"
39  WAITING = "waiting_for_sleep"
40 
41 
42 class TessieSeatHeaterOptions(StrEnum):
43  """Tessie seat heater options."""
44 
45  OFF = "off"
46  LOW = "low"
47  MEDIUM = "medium"
48  HIGH = "high"
49 
50 
51 class TessieSeatCoolerOptions(StrEnum):
52  """Tessie seat cooler options."""
53 
54  OFF = "off"
55  LOW = "low"
56  MEDIUM = "medium"
57  HIGH = "high"
58 
59 
60 class TessieClimateKeeper(StrEnum):
61  """Tessie Climate Keeper Modes."""
62 
63  OFF = "off"
64  ON = "on"
65  DOG = "dog"
66  CAMP = "camp"
67 
68 
69 class TessieUpdateStatus(StrEnum):
70  """Tessie Update Statuses."""
71 
72  AVAILABLE = "available"
73  DOWNLOADING = "downloading"
74  INSTALLING = "installing"
75  WIFI_WAIT = "downloading_wifi_wait"
76  SCHEDULED = "scheduled"
77 
78 
79 class TessieCoverStates(IntEnum):
80  """Tessie Cover states."""
81 
82  CLOSED = 0
83  OPEN = 1
84 
85 
87  """Tessie Charge Cable Lock states."""
88 
89  ENGAGED = "Engaged"
90  DISENGAGED = "Disengaged"
91 
92 
93 TessieChargeStates = {
94  "Starting": "starting",
95  "Charging": "charging",
96  "Stopped": "stopped",
97  "Complete": "complete",
98  "Disconnected": "disconnected",
99  "NoPower": "no_power",
100 }
101 
102 
104  """Tessie Wall Connector states."""
105 
106  BOOTING = 0
107  CHARGING = 1
108  DISCONNECTED = 2
109  CONNECTED = 4
110  SCHEDULED = 5
111  NEGOTIATING = 6
112  ERROR = 7
113  CHARGING_FINISHED = 8
114  WAITING_CAR = 9
115  CHARGING_REDUCED = 10