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

Error from toyota's servers #110

Closed
DurgNomis-drol opened this issue Dec 2, 2021 · 0 comments · Fixed by #115
Closed

Error from toyota's servers #110

DurgNomis-drol opened this issue Dec 2, 2021 · 0 comments · Fixed by #115
Labels

Comments

@DurgNomis-drol
Copy link
Owner

Describe the bug
This error comes from the Home Assistant integration, but the traceback shows that it occurs in the library.
It works, but should be handled better the in code. Happens when an error occurred at Toyota's servers.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
No error.

Additional context

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/toyota/__init__.py", line 105, in async_update_data
    data = await asyncio.gather(
  File "/usr/local/lib/python3.9/site-packages/mytoyota/client.py", line 419, in get_driving_statistics
    raw_statistics = await self.api.get_driving_statistics_endpoint(
  File "/usr/local/lib/python3.9/site-packages/mytoyota/api.py", line 96, in get_driving_statistics_endpoint
    return await self.controller.request(
  File "/usr/local/lib/python3.9/site-packages/mytoyota/controller.py", line 202, in request
    + response["code"]
KeyError: 'code'
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