From 266dae2d6a2116ba779dd2dc121eccb3d5a566ca Mon Sep 17 00:00:00 2001
From: pbe-axelor
Date: Thu, 16 Mar 2023 15:28:18 +0100
Subject: [PATCH] Skip cars that don't have vin (#137)
Fixes #133
Signed-off-by: Pierre Belloy
---
custom_components/toyota/__init__.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/custom_components/toyota/__init__.py b/custom_components/toyota/__init__.py
index b454522..4cf3662 100644
--- a/custom_components/toyota/__init__.py
+++ b/custom_components/toyota/__init__.py
@@ -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: