Skip to content

Commit

Permalink
Looking back and forward 24 hours in the Monta API
Browse files Browse the repository at this point in the history
  • Loading branch information
tougher committed Oct 28, 2024
1 parent 6fb4d1d commit dee2b2e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions TeslaMateAgile/Services/MontaService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ private async Task<string> GetAccessToken()

private async Task<Charge[]> GetCharges(string accessToken, DateTimeOffset from, DateTimeOffset to)
{
from = from.AddHours(-24);
to = to.AddHours(24);

var requestUri = $"{_options.BaseUrl}/charges?state=completed&fromDate={from.UtcDateTime:o}&toDate={to.UtcDateTime:o}";
if (_options.ChargePointId.HasValue)
{
Expand Down

0 comments on commit dee2b2e

Please sign in to comment.