From af06279a1472681af47bd714d90d32c61e0e1bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20K=C3=BChnel?= Date: Sat, 25 Jan 2025 16:32:02 +0100 Subject: [PATCH] fix(TeslaFleetApiService): Only allow vehicle request via Fleet API on non licensed cars --- .../Server/Services/TeslaFleetApiService.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/TeslaSolarCharger/Server/Services/TeslaFleetApiService.cs b/TeslaSolarCharger/Server/Services/TeslaFleetApiService.cs index 0c0c7e59a..1a711dc0f 100644 --- a/TeslaSolarCharger/Server/Services/TeslaFleetApiService.cs +++ b/TeslaSolarCharger/Server/Services/TeslaFleetApiService.cs @@ -937,15 +937,12 @@ await errorHandlingService.HandleError(nameof(TeslaFleetApiService), nameof(Send } } - if (fleetApiRequest.BleCompatible && (!await backendApiService.IsFleetApiLicensed(car.Vin, true))) + if (fleetApiRequest.RequestUrl != VehicleRequest.RequestUrl && (!await backendApiService.IsFleetApiLicensed(car.Vin, true))) { - if (!car.UseBle) - { - await errorHandlingService.HandleError(nameof(TeslaFleetApiService), nameof(SendCommandToTeslaApi), $"Fleet API not licensed for car {car.Vin}", - "Can not send Fleet API commands to car as Fleet API is not licensed", - issueKeys.FleetApiNotLicensed, car.Vin, null).ConfigureAwait(false); - } - + await errorHandlingService.HandleError(nameof(TeslaFleetApiService), nameof(SendCommandToTeslaApi), $"Fleet API not licensed for car {car.Vin}", + "Can not send Fleet API commands to car as Fleet API is not licensed", + issueKeys.FleetApiNotLicensed, car.Vin, null).ConfigureAwait(false); + logger.LogError("Can not send Fleet API commands to car {vin} as car is not licensed", car.Vin); return null; }