Skip to content

Commit

Permalink
Loosen Homelink
Browse files Browse the repository at this point in the history
  • Loading branch information
Bre77 committed Feb 8, 2024
1 parent af7d6fa commit d4eb071
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions tesla_fleet_api/vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,15 +535,21 @@ async def take_drivenote(self, vehicle_tag: str | int, note: str) -> dict[str, A
async def trigger_homelink(
self,
vehicle_tag: str | int,
token: str,
token: str | None = None,
lat: float | None = None,
lon: float | None = None,
) -> dict[str, Any]:
"""Turns on HomeLink (used to open and close garage doors)."""
data = {}
if token:
data["token"] = token
if lat and lon:
data["lat"] = lat
data["lon"] = lon
return await self._request(
Methods.POST,
f"api/1/vehicles/{vehicle_tag}/command/trigger_homelink",
json={"lat": lat, "lon": lon, "token": token},
json=data,
)

async def upcoming_calendar_entries(
Expand Down
2 changes: 1 addition & 1 deletion tesla_fleet_api/vehiclespecific.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ async def take_drivenote(self, note: str) -> dict[str, Any]:

async def trigger_homelink(
self,
token: str,
token: str | None = None,
lat: float | None = None,
lon: float | None = None,
) -> dict[str, Any]:
Expand Down

0 comments on commit d4eb071

Please sign in to comment.