Skip to content

Commit

Permalink
fix(TeslaFleetApiService): Only allow vehicle request via Fleet API o…
Browse files Browse the repository at this point in the history
…n non licensed cars
  • Loading branch information
pkuehnel committed Jan 25, 2025
1 parent 0cefbe8 commit af06279
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions TeslaSolarCharger/Server/Services/TeslaFleetApiService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit af06279

Please sign in to comment.