Skip to content

Commit

Permalink
fix(TeslaFleetApiService): use 30 minutes as minimum time between wakes
Browse files Browse the repository at this point in the history
  • Loading branch information
pkuehnel committed Jan 29, 2025
1 parent 7d2aaed commit e6c66ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions TeslaSolarCharger/Server/Services/TeslaFleetApiService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -963,10 +963,10 @@ await errorHandlingService.HandleError(nameof(TeslaFleetApiService), nameof(Send
if (fleetApiRequest.RequestUrl == WakeUpRequest.RequestUrl)
{
var lastWakeUp = car.WakeUpCalls.OrderByDescending(c => c).FirstOrDefault();
if (lastWakeUp != default && lastWakeUp > dateTimeProvider.UtcNow().AddMinutes(20))
if (lastWakeUp != default && lastWakeUp > dateTimeProvider.UtcNow().AddMinutes(-30))
{
logger.LogDebug("Do not send wake up command as last wake up was at {lastWakeUp}", lastWakeUp);
throw new InvalidOperationException("Do not send wake up command as last wake up was at " + lastWakeUp);
return null;
}
}

Expand Down

0 comments on commit e6c66ed

Please sign in to comment.