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

running simple_client_example.py gives an error #280

Closed
lhumb opened this issue Jan 8, 2024 · 9 comments · Fixed by #283
Closed

running simple_client_example.py gives an error #280

lhumb opened this issue Jan 8, 2024 · 9 comments · Fixed by #283
Assignees
Labels

Comments

@lhumb
Copy link

lhumb commented Jan 8, 2024

Describe the bug

Running the script simple_client_example.py gives an error

To Reproduce

running: python simple_client_example.py

`Logging in...

Retrieving cars...

Traceback (most recent call last):
  File "/oldroot/home/humbert/dokumente/photovoltaik-wallbox/mytoyota/simple_client_example.py", line 83, in <module>
    loop.run_until_complete(get_information())
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/oldroot/home/humbert/dokumente/photovoltaik-wallbox/mytoyota/simple_client_example.py", line 49, in get_information
    await car.update()
  File "/oldroot/home/humbert/dokumente/photovoltaik-wallbox/mytoyota/mytoyota/models/vehicle.py", line 113, in update
    for name, data in await responses:
                      ^^^^^^^^^^^^^^^
  File "/oldroot/home/humbert/dokumente/photovoltaik-wallbox/mytoyota/mytoyota/models/vehicle.py", line 107, in parallel_wrapper
    r = await function()
        ^^^^^^^^^^^^^^^^
  File "/oldroot/home/humbert/dokumente/photovoltaik-wallbox/mytoyota/mytoyota/api.py", line 114, in get_remote_status_endpoint
    return await self._request_and_parse(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/oldroot/home/humbert/dokumente/photovoltaik-wallbox/mytoyota/mytoyota/api.py", line 49, 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 RemoteStatusResponseModel
payload -> telemetry -> fugage -> unit
  none is not an allowed value (type=type_error.none.not_allowed)
payload -> telemetry -> fugage -> value
  none is not an allowed value (type=type_error.none.not_allowed)
payload -> telemetry -> rage -> unit
  none is not an allowed value (type=type_error.none.not_allowed)
payload -> telemetry -> rage -> value
  none is not an allowed value (type=type_error.none.not_allowed)`

Expected behavior

The script should output

  • Dashboard Data
  • Location Data
  • Lock Status
  • Notifications
  • Summary
  • Trips
@CM000n CM000n added the 🐛 bug label Jan 8, 2024
@CM000n
Copy link
Collaborator

CM000n commented Jan 8, 2024

Thx for reporting 😊
Seems we have to adjust our pydantic RemoteStatusResponseModel here.

Can you give us some more information? Which car and fuel type are you using?

@CM000n CM000n self-assigned this Jan 8, 2024
@lhumb
Copy link
Author

lhumb commented Jan 8, 2024

Oh yes – it is a bz4x, a full electric car – you already reported, that those cars have no fuel ;-) #278

@lhumb
Copy link
Author

lhumb commented Jan 9, 2024

eXcuse, but after git pull and reading your log entry, I run python simple_client_example.py again but the output is the same as above…

…
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__

pydantic.error_wrappers.ValidationError: 4 validation errors for RemoteStatusResponseModel
payload -> telemetry -> fugage -> unit
  none is not an allowed value (type=type_error.none.not_allowed)
payload -> telemetry -> fugage -> value
  none is not an allowed value (type=type_error.none.not_allowed)
payload -> telemetry -> rage -> unit
  none is not an allowed value (type=type_error.none.not_allowed)
payload -> telemetry -> rage -> value
  none is not an allowed value (type=type_error.none.not_allowed)

@lhumb
Copy link
Author

lhumb commented Jan 9, 2024

after last commit; 66ad51e
your one: #286
it seems that this »solution« is incomplete

$ python simple_client_example.py 
Logging in...
Retrieving cars...
Traceback (most recent call last):
  File "/oldroot/home/humbert/dokumente/photovoltaik-wallbox/mytoyota/simple_client_example.py", line 83, in <module>
    loop.run_until_complete(get_information())
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/oldroot/home/humbert/dokumente/photovoltaik-wallbox/mytoyota/simple_client_example.py", line 49, in get_information
    await car.update()
  File "/oldroot/home/humbert/dokumente/photovoltaik-wallbox/mytoyota/mytoyota/models/vehicle.py", line 113, in update
    for name, data in await responses:
                      ^^^^^^^^^^^^^^^
  File "/oldroot/home/humbert/dokumente/photovoltaik-wallbox/mytoyota/mytoyota/models/vehicle.py", line 107, in parallel_wrapper
    r = await function()
        ^^^^^^^^^^^^^^^^
  File "/oldroot/home/humbert/dokumente/photovoltaik-wallbox/mytoyota/mytoyota/api.py", line 155, in get_telemetry_endpoint
    return await self._request_and_parse(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/oldroot/home/humbert/dokumente/photovoltaik-wallbox/mytoyota/mytoyota/api.py", line 49, in _request_and_parse
    return model(**response)
           ^^^^^^^^^^^^^^^^^
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for TelemetryResponseModel
payload -> fuelLevel
  field required (type=value_error.missing)

@CM000n
Copy link
Collaborator

CM000n commented Jan 9, 2024

This is not "incomplete", this is just another issue with another model 😉

@lhumb
Copy link
Author

lhumb commented Jan 9, 2024

OK ;-)

@CM000n
Copy link
Collaborator

CM000n commented Jan 9, 2024

None of us current developers have a bz4x and there is no official documentation for the API.
So all we can do is trial and error. 😞

@lhumb
Copy link
Author

lhumb commented Jan 9, 2024

If you are able to tell me, how I can help, pls…

@CM000n
Copy link
Collaborator

CM000n commented Jan 9, 2024

You're already doing that. 😉 Simply testing extensively and creating issues for things you notice already helps us. 😊

But for better tracking, please try to create a separate issue for each problem and not write everything in this issue or summarize problems in one issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants