Skip to content

Commit

Permalink
Merge pull request #1750 from pkuehnel/fix/noFleetApiLicenseErrorOnBl…
Browse files Browse the repository at this point in the history
…eEnabled

fix(TeslaFleetApiService): do not show not licenses error on Fleet BLE
  • Loading branch information
pkuehnel authored Jan 17, 2025
2 parents fc4bb26 + fa9f17b commit 2698a24
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions TeslaSolarCharger/Server/Services/TeslaFleetApiService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,7 @@ await errorHandlingService.HandleError(nameof(TeslaFleetApiService), nameof(Send
var isCarBleEnabled = car.UseBle;
if (isCarBleEnabled)
{
await errorHandlingService.HandleErrorResolved(issueKeys.FleetApiNotLicensed, car.Vin);
//When changing this condition also change it in ErrorHandlingService.DetectErrors as there the error will be set to resolved.
if ((car.LastNonSuccessBleCall != default) && (car.LastNonSuccessBleCall.Value >
(dateTimeProvider.UtcNow() - configurationWrapper.BleUsageStopAfterError())))
Expand Down Expand Up @@ -932,9 +933,13 @@ await errorHandlingService.HandleError(nameof(TeslaFleetApiService), nameof(Send

if (fleetApiRequest.BleCompatible && (!await backendApiService.IsFleetApiLicensed(car.Vin, true)))
{
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);
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);
}

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 2698a24

Please sign in to comment.