DurgNomis-drol / mytoyota

Python client for Toyota Connected Services API
MIT License
74 stars 28 forks source link

Error when running the example #348

Open pr0te opened 4 months ago

pr0te commented 4 months ago

Describe the bug It appears that something goes wrong when running simple_client_example.py. If it's relevant, I have a Yaris Cross. Here's the output: Logging in... Retrieving cars... Traceback (most recent call last): File "C:\Users\tnl\OneDrive\Code\Toyota.venv\simple_client_example.py", line 74, in loop.run_until_complete(get_information()) File "C:\Users\tnl\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 650, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "C:\Users\tnl\OneDrive\Code\Toyota.venv\simple_client_example.py", line 46, in get_information cars = await client.get_vehicles(metric=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\tnl\AppData\Local\Programs\Python\Python311\Lib\site-packages\mytoyota\client.py", line 63, in get_vehicles vehicles = await self._api.get_vehicles_endpoint() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\tnl\AppData\Local\Programs\Python\Python311\Lib\site-packages\mytoyota\api.py", line 81, in get_vehicles_endpoint parsed_response = await self._request_and_parse( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\tnl\AppData\Local\Programs\Python\Python311\Lib\site-packages\mytoyota\api.py", line 55, in _request_and_parse return model(**response) ^^^^^^^^^^^^^^^^^ File "pydantic\main.py", line 341, in pydantic.main.BaseModel.init pydantic.error_wrappers.ValidationError: 4 validation errors for VehiclesResponseModel payload -> 0 -> dcm -> dcmDestination none is not an allowed value (type=type_error.none.not_allowed) payload -> 0 -> dcm -> dcmGrade none is not an allowed value (type=type_error.none.not_allowed) payload -> 0 -> dcm -> dcmSupplier none is not an allowed value (type=type_error.none.not_allowed) payload -> 0 -> dcm -> euiccid none is not an allowed value (type=type_error.none.not_allowed)

To Reproduce Steps to reproduce the behavior:

Run simple_client_example.py.

Expected behavior Vehicle info output

Additional context No more to add.