Skip to content

Commit 3f633a4

Browse files
Merge pull request #22 from andrewgierens/copilot/fix-21
Add cabin overheat protection control functions
2 parents b7bcda6 + aab6545 commit 3f633a4

File tree

2 files changed

+71
-29
lines changed

2 files changed

+71
-29
lines changed

tessie_api/__init__.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@
99
from .charging import set_charging_amps
1010
from .charging import open_unlock_charge_port
1111
from .charging import close_charge_port
12-
from .climate import start_climate_preconditioning
13-
from .climate import stop_climate
14-
from .climate import set_temperature
15-
from .climate import set_seat_heat
16-
from .climate import set_seat_cool
17-
from .climate import start_defrost
18-
from .climate import stop_defrost
19-
from .climate import start_steering_wheel_heater
20-
from .climate import stop_steering_wheel_heater
21-
from .climate import set_bioweapon_defense_mode
22-
from .climate import set_climate_keeper_mode
12+
from .climate import start_climate_preconditioning
13+
from .climate import stop_climate
14+
from .climate import set_temperature
15+
from .climate import set_seat_heat
16+
from .climate import set_seat_cool
17+
from .climate import start_defrost
18+
from .climate import stop_defrost
19+
from .climate import start_steering_wheel_heater
20+
from .climate import stop_steering_wheel_heater
21+
from .climate import set_bioweapon_defense_mode
22+
from .climate import set_climate_keeper_mode
23+
from .climate import start_cabin_overheat_protection
24+
from .climate import stop_cabin_overheat_protection
2325
from .current_state import get_state
2426
from .current_state import get_state_of_all_vehicles
2527
from .current_state import get_location

tessie_api/climate.py

Lines changed: 58 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -205,22 +205,62 @@ async def set_bioweapon_defense_mode(
205205
)
206206

207207

208-
async def set_climate_keeper_mode(
209-
session: aiohttp.ClientSession,
210-
vin: str,
211-
api_key: str,
212-
mode: ClimateKeeperMode,
213-
retry_duration: int = 40,
214-
wait_for_completion: bool = True,
215-
) -> Dict[str, Any]:
216-
return await tessieRequest(
217-
session,
218-
"GET",
219-
f"/{vin}/command/set_climate_keeper_mode",
220-
api_key,
221-
params={
222-
"mode": mode,
223-
"retry_duration": retry_duration,
224-
"wait_for_completion": str(wait_for_completion).lower(),
225-
},
208+
async def set_climate_keeper_mode(
209+
session: aiohttp.ClientSession,
210+
vin: str,
211+
api_key: str,
212+
mode: ClimateKeeperMode,
213+
retry_duration: int = 40,
214+
wait_for_completion: bool = True,
215+
) -> Dict[str, Any]:
216+
return await tessieRequest(
217+
session,
218+
"GET",
219+
f"/{vin}/command/set_climate_keeper_mode",
220+
api_key,
221+
params={
222+
"mode": mode,
223+
"retry_duration": retry_duration,
224+
"wait_for_completion": str(wait_for_completion).lower(),
225+
},
226+
)
227+
228+
229+
async def start_cabin_overheat_protection(
230+
session: aiohttp.ClientSession,
231+
vin: str,
232+
api_key: str,
233+
retry_duration: int = 40,
234+
wait_for_completion: bool = True,
235+
) -> Dict[str, Any]:
236+
return await tessieRequest(
237+
session,
238+
"GET",
239+
f"/{vin}/command/set_cabin_overheat_protection",
240+
api_key,
241+
params={
242+
"on": "true",
243+
"retry_duration": retry_duration,
244+
"wait_for_completion": str(wait_for_completion).lower(),
245+
},
246+
)
247+
248+
249+
async def stop_cabin_overheat_protection(
250+
session: aiohttp.ClientSession,
251+
vin: str,
252+
api_key: str,
253+
retry_duration: int = 40,
254+
wait_for_completion: bool = True,
255+
) -> Dict[str, Any]:
256+
return await tessieRequest(
257+
session,
258+
"GET",
259+
f"/{vin}/command/set_cabin_overheat_protection",
260+
api_key,
261+
params={
262+
"on": "false",
263+
"retry_duration": retry_duration,
264+
"wait_for_completion": str(wait_for_completion).lower(),
265+
},
226266
)

0 commit comments

Comments
 (0)