DurgNomis-drol / mytoyota

Python client for Toyota Connected Services API
MIT License
77 stars 32 forks source link

Key 'hood' not available #56

Closed Dominik-Koenig closed 3 years ago

Dominik-Koenig commented 3 years ago

Describe the bug Information about the status of the hood is not available for my car, this results in the following error:

Traceback (most recent call last):
  File "fetch.py", line 87, in <module>
    loop.run_until_complete(get_information())
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "fetch.py", line 26, in get_information
    vehicle = await client.get_vehicle_status(car)
  File "/usr/local/lib/python3.8/dist-packages/mytoyota/client.py", line 120, in get_vehicle_status
    car = Vehicle(
  File "/usr/local/lib/python3.8/dist-packages/mytoyota/vehicle.py", line 192, in __init__
    Status(status["protectionState"])
  File "/usr/local/lib/python3.8/dist-packages/mytoyota/vehicle.py", line 112, in __init__
    self.doors = Doors(status[HOOD], status[DOORS])
KeyError: 'hood'

To Reproduce Steps to reproduce the behavior: Execute the sample script of this repository.

Additional context Response of the request:

{'overallStatus': 'OK', 'timestamp': '2021-09-17T18:12:40Z', 'doors': {'warning': False, 'driverSeatDoor': {'warning': False, 'closed': True, 'locked': True}, 'passengerSeatDoor': {'warning': False, 'closed': True, 'locked': True}, 'rearRightSeatDoor': {'warning': False, 'closed': True, 'locked': True}, 'rearLeftSeatDoor': {'warning': False, 'closed': True, 'locked': True}, 'backDoor': {'warning': False, 'closed': True, 'locked': True}}, 'lamps': {'warning': False, 'headLamp': {'warning': False, 'off': True}, 'tailLamp': {'warning': False, 'off': True}, 'hazardLamp': {'warning': False, 'off': True}}, 'windows': {'warning': False, 'driverSeatWindow': {'warning': False, 'state': 'close'}, 'passengerSeatWindow': {'warning': False, 'state': 'close'}, 'rearRightSeatWindow': {'warning': False, 'state': 'close'}, 'rearLeftSeatWindow': {'warning': False, 'state': 'close'}}, 'key': {'warning': False, 'inCar': False}, 'lock': {'lockState': 'locked', 'source': 'key', 'failedUnlockPreconditions': []}}

Car: Toyota Yaris model 2021

DurgNomis-drol commented 3 years ago

I will see if I can find time to look at it later today, it should be a simple fix. Feel free to make a contribution if you can't wait. 😊

Thanks for reporting the issue. 😊

DurgNomis-drol commented 3 years ago

New version have been published. Please try upgrading to 0.6.2 πŸ˜ƒ

Dominik-Koenig commented 3 years ago

Can confirm that it's working now, thank you! πŸ˜ƒ