Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions tesla_fleet_api/tesla/vehicle/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
HMAC_Personalized_Signature_Data,
)
from tesla_fleet_api.tesla.vehicle.proto.common_pb2 import (
LatLong,
Void,
PreconditioningTimes,
OffPeakChargingTimes,
Expand Down Expand Up @@ -1426,16 +1427,14 @@ async def trigger_homelink(
lon: float | None = None,
) -> dict[str, Any]:
"""Turns on HomeLink (used to open and close garage doors)."""
action = VehicleControlTriggerHomelinkAction()
if lat is not None and lon is not None:
action.location.latitude = lat
action.location.longitude = lon
if token is not None:
action.token = token

return await self._sendInfotainment(
Action(
vehicleAction=VehicleAction(vehicleControlTriggerHomelinkAction=action)
vehicleAction=VehicleAction(
vehicleControlTriggerHomelinkAction=VehicleControlTriggerHomelinkAction(
location=LatLong(latitude=lat, longitude=lon) if lat is not None and lon is not None else None,
token=token,
)
)
)
)

Expand Down