From c4ddc8441e71dfd6e157ad1aec7ab00ab2f7d122 Mon Sep 17 00:00:00 2001 From: Simon Spies Date: Thu, 2 Nov 2023 09:51:33 +0100 Subject: [PATCH] Fixed the bug that the vehicle data sensor was only created for the last vehicle and not all of them. --- custom_components/kia_uvo/sensor.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/custom_components/kia_uvo/sensor.py b/custom_components/kia_uvo/sensor.py index de7ccb0b..d4337b6d 100644 --- a/custom_components/kia_uvo/sensor.py +++ b/custom_components/kia_uvo/sensor.py @@ -228,11 +228,10 @@ async def async_setup_entry( entities.append( HyundaiKiaConnectSensor(coordinator, description, vehicle) ) + entities.append( + VehicleEntity(coordinator, coordinator.vehicle_manager.vehicles[vehicle_id]) + ) async_add_entities(entities) - async_add_entities( - [VehicleEntity(coordinator, coordinator.vehicle_manager.vehicles[vehicle_id])], - True, - ) return True