Skip to content

Commit

Permalink
Skip cars that don't have vin (#137)
Browse files Browse the repository at this point in the history
Fixes #133

Signed-off-by: Pierre Belloy <p.belloy@axelor.com>
  • Loading branch information
pbe-axelor authored Mar 16, 2023
1 parent cd94eaa commit 266dae2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions custom_components/toyota/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ async def async_update_data():
cars = await with_timeout(client.get_vehicles())

for car in cars:
if not car["vin"]:
continue

vehicle = await client.get_vehicle_status(car)

if vehicle.is_connected:
Expand Down

0 comments on commit 266dae2

Please sign in to comment.