Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New API Endpoints: Basics working. Thoughts & Help needed #242

Merged
merged 152 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
6e7051f
Basics working.
Nov 17, 2023
6d25366
Moved all calls to the Vehicle class.
Nov 18, 2023
c03b794
Got a "setter" working. Alias can now be set.
Nov 20, 2023
b2b6070
Update dependencies
Nov 20, 2023
fadb8ea
Added /v1/global/remote/status which brings the door/window sensors (…
Nov 20, 2023
91dec31
Added basic trips endpoint using pydantic models. Needs reviewing for…
Nov 22, 2023
898c977
Used python 3.9 compatible Optional[x] instead of 'x | None'
joro75 Nov 25, 2023
afc95a1
fix type hints in logs utils
CM000n Nov 27, 2023
e7a2c16
Run poetry update
CM000n Nov 27, 2023
07be5f9
Merge branch 'master' into master
CM000n Nov 27, 2023
55e72ff
emoves redundancy by combining censor_dict and censor_all into a sing…
CM000n Nov 27, 2023
4139cf5
Merge branch 'master' of github.com:GitOldGrumpy/mytoyota
CM000n Nov 27, 2023
14254c7
emoves redundancy by combining censor_dict and censor_all into a sing…
CM000n Nov 27, 2023
1487d7e
fix type hint
CM000n Nov 27, 2023
7f5283e
fix type hint
CM000n Nov 27, 2023
eeb906e
Fix type hints in api.py
CM000n Nov 27, 2023
3023210
use inline variable that is imidiatley returned with awared timezone …
CM000n Nov 27, 2023
342658c
lift code into else after jump into control flow
CM000n Nov 27, 2023
263af21
adjsut more type hints
CM000n Nov 27, 2023
d5eb289
fiy pylint errors
CM000n Nov 27, 2023
19c0989
add docstrings
CM000n Nov 27, 2023
a79e042
censor also link with vin from output and dump all by default
CM000n Nov 27, 2023
74553e2
adjust models and print trips in _dump_all()
CM000n Nov 27, 2023
5eddd88
add healt_status model
CM000n Nov 27, 2023
7e7384c
cencor vin in HealtStatusModel
CM000n Nov 27, 2023
5730069
use more generic string cencoring
CM000n Nov 27, 2023
830c01c
add location model
CM000n Nov 27, 2023
18d980e
Fix typing for 3.8. Added Account Model.
Nov 27, 2023
5f85029
Merge branch 'master' into master
CM000n Nov 27, 2023
31a0844
Further Updates!
Nov 27, 2023
ff382ae
Merge branch 'master' of github.com:GitOldGrumpy/mytoyota
Nov 27, 2023
4476e6b
Fix typo
Nov 27, 2023
45eff5b
add vscode to gitignore
CM000n Nov 27, 2023
1c0e946
Added/Updated the following endpoints, with basic tests:
Nov 27, 2023
0bfefe7
Merge branch 'master' of github.com:GitOldGrumpy/mytoyota
Nov 27, 2023
6f66503
Merge branch 'master' into master
CM000n Nov 27, 2023
0795c71
WIP. _STILL BROKEN_
Nov 28, 2023
75bd062
fix trips model and adjust payload unpacking
CM000n Nov 28, 2023
982afae
Fix alias names and data types
CM000n Nov 28, 2023
72e3e5e
Adjust StatusModel to inherit from it
CM000n Nov 28, 2023
556a164
Merge remote-tracking branch 'refs/remotes/origin/master'
Nov 28, 2023
da3b1ff
Use car_ prefix to avoid pydantic namespace error
CM000n Nov 28, 2023
26801c4
adjust request type for vehicles endpoint
CM000n Nov 28, 2023
93c87be
adjust request type for notification endpoint
CM000n Nov 28, 2023
d214b36
replace append loop with list extend
CM000n Nov 28, 2023
6672bb0
Adjust how information is received from VehicleGuidModel in Vehicle c…
CM000n Nov 28, 2023
6db3125
Comment out non supported feature from now in simple_client_test.py
CM000n Nov 28, 2023
4f13c6d
fix notifications endpoint model
CM000n Nov 28, 2023
3781f8d
add RemoteStatusResponseModel
CM000n Nov 28, 2023
ad1eb53
add RemoteStatusResponseModel
CM000n Nov 28, 2023
590a582
add telemtry model
CM000n Nov 28, 2023
bc7415f
adjust return type
CM000n Nov 28, 2023
4e5d4b0
Set payload on all Endpoint models to Optional with None as default
CM000n Nov 28, 2023
8f37341
Use UnitValueModel for common Models
CM000n Nov 28, 2023
9e1c269
Update mytoyota/models/endpoints/vehicle_guid.py
CM000n Nov 28, 2023
d0da6a9
add basic test for notification model
CM000n Nov 28, 2023
ae05882
add basic test for telemetry model
CM000n Nov 28, 2023
76319e1
run pre-commit on all files
CM000n Nov 28, 2023
b8ae73b
HDC needs to be optional for fuel only cars. Range not always reporte…
Nov 28, 2023
cac42a7
Add electric status endpoint
Nov 28, 2023
df3c2e2
Model Trips.Route
Nov 28, 2023
1c8cea6
Adjust Notification model name and fix import in tests
CM000n Nov 28, 2023
e65a0eb
adjust request type
CM000n Nov 28, 2023
873365d
remove unused import and use absolute imports
CM000n Nov 28, 2023
84dc2a8
Updated controller.py
Nov 28, 2023
2538f87
Run pre-commit
Nov 29, 2023
9efffcf
Merge branch 'master' of github.com:GitOldGrumpy/mytoyota
Nov 29, 2023
10f2a33
fix str-bytes-safe error
CM000n Nov 29, 2023
b999fc1
add names, phone_numer and email to censor data
CM000n Nov 29, 2023
7bf613d
replace censor_vin with censor_string
CM000n Nov 29, 2023
e90c596
Incompatible types in assignment literal incompatible with URL
CM000n Nov 29, 2023
0630b80
uuid defined outside init
CM000n Nov 29, 2023
c148dd7
Route endpoint no longer always get route. Changed endpoints to take …
Nov 29, 2023
50a75f3
move conftest file to tests folder
CM000n Nov 29, 2023
622da7e
run pre-commit
CM000n Nov 29, 2023
d89c4e3
run pre-commit
CM000n Nov 29, 2023
67e98dd
remove unused retry arguments
CM000n Nov 29, 2023
c8f7c94
abstracting requesting and parsing into own function
CM000n Nov 29, 2023
79dba7f
run pre-commit
CM000n Nov 29, 2023
9d2c408
better error handling in client
CM000n Nov 29, 2023
feace03
replace isort and flake8 with ruff
CM000n Nov 29, 2023
1e8be42
adjust black line-length to ruff and pylint
CM000n Nov 29, 2023
727a7fe
improve readability for endpoint gathering in vehicle model
CM000n Nov 29, 2023
1c33a4e
Add some documentation. Alter defaults on trip endpoint.
Nov 29, 2023
edc4b85
Update trips.py to to make summary optional, it might not be requested.
Nov 29, 2023
f1c172e
Black issues
Nov 29, 2023
fb1c05f
fix katashiki_code obscuring
CM000n Nov 30, 2023
4abb099
increase line-length to 120
CM000n Nov 30, 2023
d9481f5
deactivate pylint TODO warnings
CM000n Nov 30, 2023
9831729
added some docstrings and fix pylint R1705
CM000n Nov 30, 2023
b6a857e
Added some docstrings
CM000n Nov 30, 2023
9080b32
add test_api.py
CM000n Nov 30, 2023
cff061d
replace test_endpoints with test_api
CM000n Nov 30, 2023
c2b170a
Move endpoints to const
CM000n Nov 30, 2023
55f7788
move controller urls to const
CM000n Nov 30, 2023
37b40e4
seperate testing from linting
CM000n Nov 30, 2023
1f2707b
seperate testing from linting
CM000n Nov 30, 2023
ebd30ad
seperate testing from linting
CM000n Nov 30, 2023
9083321
rename simple_client_test file to exclude it from pytest
CM000n Nov 30, 2023
a20dcac
rename simple_client_test file to exclude it from pytest
CM000n Nov 30, 2023
0d56420
fix svar type for status in notifications model
CM000n Nov 30, 2023
ef80f85
adjust linting workflow
CM000n Nov 30, 2023
d23c5e7
adjust linting workflow
CM000n Nov 30, 2023
426a72a
Replace pylint and black with ruff
CM000n Nov 30, 2023
99c9417
use pytest-pretty
CM000n Nov 30, 2023
621b096
ignore error in test
CM000n Nov 30, 2023
e18cf72
If a notification has not be read it doesn't have a notification read…
Nov 30, 2023
50515e7
Added basic Vehicle API for discussion. Updated endpoint models for d…
Dec 1, 2023
392e1a4
enforce more docstring rules
CM000n Dec 1, 2023
d799155
add rule for unused arguments
CM000n Dec 1, 2023
fbaf64f
implement ruff specific rules
CM000n Dec 1, 2023
0a5ff2b
add ruff_cache to gitignore
CM000n Dec 1, 2023
995b22f
install without dev dependencies in build pipeline
CM000n Dec 1, 2023
a5e5c51
Fix small review issues
Dec 1, 2023
b664326
mark old tests as legacy and add some new tests for utils
CM000n Dec 1, 2023
3f589ee
mark old tests as legacy and add some new tests for utils
CM000n Dec 1, 2023
e7ac49f
run coverage only against source files
CM000n Dec 1, 2023
84c2492
run coverage only against source files
CM000n Dec 1, 2023
abb23f8
add simple test for https response formatting
CM000n Dec 3, 2023
6120f3b
Add notifiations to the Client API
Dec 3, 2023
facae29
Merge branch 'master' of github.com:GitOldGrumpy/mytoyota
Dec 3, 2023
36db649
use pprint in example.py
CM000n Dec 4, 2023
611c514
get initial lock status working
CM000n Dec 4, 2023
51cdf9e
fix misbehaviour in bool conversion
CM000n Dec 4, 2023
450503a
poetry update
CM000n Dec 4, 2023
592581d
fix deprecation warning in httpx formatting test
CM000n Dec 4, 2023
0057405
djust use of pytest.param
CM000n Dec 4, 2023
0230e29
Merge branch 'master' into master
CM000n Dec 4, 2023
2118700
recreate lock file
CM000n Dec 4, 2023
1ef3917
add tests for lock_status model
CM000n Dec 4, 2023
89b349c
use caching client
CM000n Dec 7, 2023
3e2056a
replace unsafe characters, according to RFC specification, in AUTHORI…
CM000n Dec 7, 2023
cb84040
If a refresh token exists this will be tried before attempting userna…
Dec 7, 2023
fd2d699
Add username to cache for people who are testing with multiple accounts
Dec 7, 2023
267a0ed
don't use CacheClient on request_raw
CM000n Dec 8, 2023
a835eb3
bump version and update readme
CM000n Dec 11, 2023
34a9e8f
change badge styling
CM000n Dec 11, 2023
fd22353
add coverage badge
CM000n Dec 11, 2023
97ebe31
Added supported for summaries
Dec 12, 2023
5caaf34
Merge branch 'master' of github.com:GitOldGrumpy/mytoyota
Dec 12, 2023
1441380
Fix possible missing Scores
Dec 12, 2023
6b55ddf
Merge branch 'master' into master
CM000n Dec 15, 2023
669fd16
Add Trips
Dec 15, 2023
0e01c54
Merge branch 'master' of github.com:GitOldGrumpy/mytoyota
Dec 15, 2023
48650c2
lint only on pr
CM000n Dec 17, 2023
2e1ff4d
prevent commit to master
CM000n Dec 17, 2023
3369a62
set preferred default to false
CM000n Dec 18, 2023
8583df2
make preferred optional
CM000n Dec 18, 2023
df5e64d
make can_set_next_charging_event optional
CM000n Dec 19, 2023
69e21a3
revert formatting changes
CM000n Dec 20, 2023
9164494
revert workflow changes
CM000n Dec 20, 2023
aca119e
add whitespaces
CM000n Dec 20, 2023
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,12 @@ dmypy.json
# MS Visual studio
.vs/
TestResults/
.vscode/

# Ruff
.ruff_cache/

.myt_app/
/blahblah.py
.idea/
/credentials.json
2 changes: 1 addition & 1 deletion mytoyota/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Toyota Connected Services Client"""
"""Toyota Connected Services Client."""
from .client import MyT # pylint: disable=unused-import # NOQA

try:
Expand Down
283 changes: 175 additions & 108 deletions mytoyota/api.py
Original file line number Diff line number Diff line change
@@ -1,140 +1,207 @@
"""Toyota Connected Services API"""
from __future__ import annotations
"""Toyota Connected Services API."""

from datetime import date, datetime, timezone
from uuid import uuid4

from mytoyota.const import (
VEHICLE_ASSOCIATION_ENDPOINT,
VEHICLE_GLOBAL_REMOTE_ELECTRIC_STATUS_ENDPOINT,
VEHICLE_GLOBAL_REMOTE_STATUS_ENDPOINT,
VEHICLE_GUID_ENDPOINT,
VEHICLE_HEALTH_STATUS_ENDPOINT,
VEHICLE_LOCATION_ENDPOINT,
VEHICLE_NOTIFICATION_HISTORY_ENDPOINT,
VEHICLE_TELEMETRY_ENDPOINT,
VEHICLE_TRIPS_ENDPOINT,
)
from mytoyota.controller import Controller
from mytoyota.models.endpoints.electric import ElectricResponseModel
from mytoyota.models.endpoints.location import LocationResponseModel
from mytoyota.models.endpoints.notifications import NotificationResponseModel
from mytoyota.models.endpoints.status import RemoteStatusResponseModel
from mytoyota.models.endpoints.telemetry import TelemetryResponseModel
from mytoyota.models.endpoints.trips import TripsResponseModel
from mytoyota.models.endpoints.vehicle_guid import VehiclesResponseModel
from mytoyota.models.endpoints.vehicle_health import VehicleHealthResponseModel

from typing import Any

from .const import BASE_URL, BASE_URL_CARS
from .controller import Controller
class Api:
"""API Class. Allows access to available endpoints to retrieve the raw data."""

def __init__(self, controller: Controller) -> None: # noqa: D417
"""Initialise the API.

class Api:
"""Controller class."""
Initialise the API and set the Controller

def __init__(self, controller: Controller) -> None:
"""Toyota Controller"""
Parameters
----------
controller: Controller: A controller class to managing communication
"""
self.controller = controller

@property
def uuid(self) -> str | None:
"""Returns uuid from controller"""
return self.controller.uuid
async def _request_and_parse(self, model, method: str, endpoint: str, **kwargs):
"""Parse requests and responses."""
response = await self.controller.request_json(
method=method, endpoint=endpoint, **kwargs
)
return model(**response)

async def set_vehicle_alias_endpoint(
self, new_alias: str, vehicle_id: int
) -> dict[str, Any] | None:
"""Set vehicle alias."""
return await self.controller.request(
async def set_vehicle_alias_endpoint(self, alias: str, guid: str, vin: str):
CM000n marked this conversation as resolved.
Show resolved Hide resolved
"""Set the alias for a vehicle."""
return await self.controller.request_raw(

Check warning on line 51 in mytoyota/api.py

View check run for this annotation

Codecov / codecov/patch

mytoyota/api.py#L51

Added line #L51 was not covered by tests
method="PUT",
base_url=BASE_URL_CARS,
endpoint=f"/api/users/{self.uuid}/vehicles/{vehicle_id}",
body={"id": vehicle_id, "alias": new_alias},
endpoint=VEHICLE_ASSOCIATION_ENDPOINT,
vin=vin,
headers={
"datetime": str(int(datetime.now(timezone.utc).timestamp() * 1000)),
"x-correlationid": str(uuid4()),
"Content-Type": "application/json",
},
body={"guid": guid, "vin": vin, "nickName": alias},
)

async def get_vehicles_endpoint(self) -> list[dict[str, Any] | None] | None:
"""Retrieves list of cars you have registered with MyT"""
return await self.controller.request(
method="GET",
base_url=BASE_URL_CARS,
endpoint=f"/vehicle/user/{self.uuid}/vehicles?services=uio&legacy=true",
# TODO: Remove for now as it seems to have no effect. The App is sending it! # pylint: disable=W0511
# async def post_wake_endpoint(self) -> None:
CM000n marked this conversation as resolved.
Show resolved Hide resolved
# """Send a wake request to the vehicle."""
# await self.controller.request_raw(
# method="POST", endpoint="/v2/global/remote/wake"
# )

async def get_vehicles_endpoint(self) -> VehiclesResponseModel:
"""Return list of vehicles registered with provider."""
return await self._request_and_parse(

Check warning on line 72 in mytoyota/api.py

View check run for this annotation

Codecov / codecov/patch

mytoyota/api.py#L72

Added line #L72 was not covered by tests
VehiclesResponseModel, "GET", VEHICLE_GUID_ENDPOINT
)

async def get_connected_services_endpoint(self, vin: str) -> dict[str, Any] | None:
"""Get information about connected services for the given car."""
return await self.controller.request(
method="GET",
base_url=BASE_URL_CARS,
endpoint=f"/vehicle/user/{self.uuid}/vehicle/{vin}?legacy=true&services=fud,connected",
)
async def get_location_endpoint(
self, vin: str
) -> LocationResponseModel: # noqa: D417
"""Get the last known location of your car. Only updates when car is parked.

Response includes Lat, Lon position. * If supported.

async def get_odometer_endpoint(self, vin: str) -> list[dict[str, Any]] | None:
"""Get information from odometer."""
return await self.controller.request(
method="GET",
base_url=BASE_URL,
endpoint=f"/vehicle/{vin}/addtionalInfo",
Parameters
----------
vin: str: The vehicles VIN
"""
return await self._request_and_parse(

Check warning on line 87 in mytoyota/api.py

View check run for this annotation

Codecov / codecov/patch

mytoyota/api.py#L87

Added line #L87 was not covered by tests
LocationResponseModel, "GET", VEHICLE_LOCATION_ENDPOINT, vin=vin
)

async def get_parking_endpoint(
async def get_vehicle_health_status_endpoint(
self, vin: str
) -> dict[str, Any] | None: # pragma: no cover
"""Get where you have parked your car."""
return await self.controller.request(
method="GET",
base_url=BASE_URL,
endpoint=f"/users/{self.uuid}/vehicle/location",
headers={"VIN": vin},
) -> VehicleHealthResponseModel: # noqa: D417
"""Get the latest health status.

Response includes the quantity of engine oil and any dashboard warning lights. \n
* If supported.

Parameters
----------
vin: str: The vehicles VIN
"""
return await self._request_and_parse(

Check warning on line 103 in mytoyota/api.py

View check run for this annotation

Codecov / codecov/patch

mytoyota/api.py#L103

Added line #L103 was not covered by tests
VehicleHealthResponseModel, "GET", VEHICLE_HEALTH_STATUS_ENDPOINT, vin=vin
)

async def get_vehicle_status_endpoint(self, vin: str) -> dict[str, Any] | None:
async def get_remote_status_endpoint(self, vin: str) -> RemoteStatusResponseModel:
"""Get information about the vehicle."""
return await self.controller.request(
method="GET",
base_url=BASE_URL,
endpoint=f"/users/{self.uuid}/vehicles/{vin}/vehicleStatus",
return await self._request_and_parse(

Check warning on line 109 in mytoyota/api.py

View check run for this annotation

Codecov / codecov/patch

mytoyota/api.py#L109

Added line #L109 was not covered by tests
RemoteStatusResponseModel,
"GET",
VEHICLE_GLOBAL_REMOTE_STATUS_ENDPOINT,
vin=vin,
)

async def get_vehicle_status_legacy_endpoint(
async def get_vehicle_electric_status_endpoint(
self, vin: str
) -> dict[str, Any] | None:
"""Get information about the vehicle."""
return await self.controller.request(
method="GET",
base_url=BASE_URL,
endpoint=f"/vehicles/{vin}/remoteControl/status",
) -> ElectricResponseModel: # noqa: D417
"""Get the latest electric status.

Response includes current battery level, EV Range, EV Range with AC, \n
fuel level, fuel range and current charging status

Parameters
----------
vin: str: The vehicles VIN
"""
return await self._request_and_parse(

Check warning on line 128 in mytoyota/api.py

View check run for this annotation

Codecov / codecov/patch

mytoyota/api.py#L128

Added line #L128 was not covered by tests
ElectricResponseModel,
"GET",
VEHICLE_GLOBAL_REMOTE_ELECTRIC_STATUS_ENDPOINT,
vin=vin,
)

async def get_driving_statistics_endpoint(
self, vin: str, from_date: str, interval: str | None = None
) -> dict[str, Any] | None:
"""Get driving statistic"""
return await self.controller.request(
method="GET",
base_url=BASE_URL,
endpoint="/v2/trips/summarize",
headers={"vin": vin},
params={"from": from_date, "calendarInterval": interval},
)
async def get_telemetry_endpoint(
self, vin: str
) -> TelemetryResponseModel: # noqa: D417
"""Get the latest telemetry status.

async def get_trips_endpoint(
self,
vin: str,
page: int = 1,
) -> dict[str, Any] | None:
"""Get trip
The page parameter works a bit strange but setting to 1 gets last few trips"""
return await self.controller.request(
method="GET",
base_url=BASE_URL_CARS,
endpoint=f"/api/user/{self.uuid}/cms/trips/v2/history/vin/{vin}/{page}",
headers={"vin": vin},
)
Response includes current fuel level, distance to empty and odometer

async def get_trip_endpoint(self, vin: str, trip_id: str) -> dict[str, Any] | None:
"""Get data for a single trip"""
return await self.controller.request(
method="GET",
base_url=BASE_URL_CARS,
endpoint=f"/api/user/{self.uuid}/cms/trips/v2/{trip_id}/events/vin/{vin}",
headers={"vin": vin},
Parameters
----------
vin: str: The vehicles VIN
"""
return await self._request_and_parse(

Check warning on line 146 in mytoyota/api.py

View check run for this annotation

Codecov / codecov/patch

mytoyota/api.py#L146

Added line #L146 was not covered by tests
TelemetryResponseModel, "GET", VEHICLE_TELEMETRY_ENDPOINT, vin=vin
)

async def set_lock_unlock_vehicle_endpoint(
self, vin: str, action: str
) -> dict[str, str] | None:
"""Lock vehicle."""
return await self.controller.request(
method="POST",
base_url=BASE_URL,
endpoint=f"/vehicles/{vin}/lock",
body={"action": action},
async def get_notification_endpoint(
self, vin: str
) -> NotificationResponseModel: # noqa: D417
"""Get all available notifications for the vehicle.

A notification includes a message, notification date, read flag, date read.

NOTE: Currently no way to mark notification as read or limit the response.

Parameters
----------
vin: str: The vehicles VIN
"""
return await self._request_and_parse(

Check warning on line 163 in mytoyota/api.py

View check run for this annotation

Codecov / codecov/patch

mytoyota/api.py#L163

Added line #L163 was not covered by tests
NotificationResponseModel,
"GET",
VEHICLE_NOTIFICATION_HISTORY_ENDPOINT,
vin=vin,
)

async def get_lock_unlock_request_status(
self, vin: str, request_id: str
) -> dict[str, Any] | None:
"""Check lock/unlock status given a request ID"""
return await self.controller.request(
method="GET",
base_url=BASE_URL,
endpoint=f"/vehicles/{vin}/lock/{request_id}",
async def get_trips_endpoint( # noqa: PLR0913, D417
self,
vin: str,
from_date: date,
to_date: date,
route: bool = False,
summary: bool = True,
limit: int = 5,
offset: int = 0,
) -> TripsResponseModel:
"""Get list of trips.

Retrieves a list of all trips between the given dates. \n
The default data(route = False, summary = False) provides
a basic summary of each trip and includes Coaching message and electrical use.

Parameters
----------
vin: str: The vehicles VIN
from_date: date: From date to include trips, inclusive. Cant be in the future.
to_date: date: To date to include trips, inclusive. Cant be in the future.
route: bool: If true returns the route of each trip as a list of coordinates.
Suitable for drawing on a map.
summary: bool: If true returns a summary of each month and day in the date range
limit: int: Limit of number of trips to return in one request. Max 50.
offset: int: Offset into trips to start the request.
"""
endpoint = VEHICLE_TRIPS_ENDPOINT.format(

Check warning on line 197 in mytoyota/api.py

View check run for this annotation

Codecov / codecov/patch

mytoyota/api.py#L197

Added line #L197 was not covered by tests
from_date=from_date,
to_date=to_date,
route=route,
summary=summary,
limit=limit,
offset=offset,
)
return await self._request_and_parse(

Check warning on line 205 in mytoyota/api.py

View check run for this annotation

Codecov / codecov/patch

mytoyota/api.py#L205

Added line #L205 was not covered by tests
TripsResponseModel, "GET", endpoint, vin=vin
)
Loading