Skip to content

Commit

Permalink
V1.62.5
Browse files Browse the repository at this point in the history
  • Loading branch information
bassmaster187 committed Dec 20, 2024
1 parent c8d9983 commit 30c1e0e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 8 deletions.
2 changes: 2 additions & 0 deletions TeslaLogger/Car.cs
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ private void Loop()
break;
}

webhelper.CheckRefreshToken();

}
catch (Exception ex)
{
Expand Down
4 changes: 2 additions & 2 deletions TeslaLogger/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.62.4.0")]
[assembly: AssemblyFileVersion("1.62.4.0")]
[assembly: AssemblyVersion("1.62.5.0")]
[assembly: AssemblyFileVersion("1.62.5.0")]

[assembly: InternalsVisibleTo("UnitTestsTeslaloggerNET8")]
[assembly: InternalsVisibleTo("UnitTestsTeslalogger")]
23 changes: 17 additions & 6 deletions TeslaLogger/WebHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,14 @@ public string GetRegion()
}
else
{
if (result.Contains("token expired"))
{
car.Log("Token expired");
UpdateTeslaTokenFromRefreshToken();
}

car.CreateExeptionlessLog("GetRegion", "Error", LogLevel.Fatal).AddObject((int)response.StatusCode + " / " + response.StatusCode.ToString(), "StatusCode").Submit();
Log("Error getting Region: " + (int)response.StatusCode + " / " + response.StatusCode.ToString());
Log("Error getting Region: " + (int)response.StatusCode + " / " + response.StatusCode.ToString() + " result: " + result);
return "";
}
}
Expand Down Expand Up @@ -2343,11 +2349,7 @@ public async Task<string> IsOnline(bool returnOnUnauthorized = false)
}
else
{
if (nextTeslaTokenFromRefreshToken < DateTime.UtcNow)
{
nextTeslaTokenFromRefreshToken = DateTime.UtcNow.AddMinutes(5);
UpdateTeslaTokenFromRefreshToken();
}
CheckRefreshToken();

if (car.FleetAPI)
{
Expand Down Expand Up @@ -2631,6 +2633,15 @@ public async Task<string> IsOnline(bool returnOnUnauthorized = false)
return "NULL";
}

internal void CheckRefreshToken()
{
if (nextTeslaTokenFromRefreshToken < DateTime.UtcNow)
{
nextTeslaTokenFromRefreshToken = DateTime.UtcNow.AddMinutes(5);
UpdateTeslaTokenFromRefreshToken();
}
}

void CheckVehicleConfig()
{
if (car.FleetAPI)
Expand Down
Binary file modified TeslaLogger/bin/TeslaLogger.exe
Binary file not shown.
6 changes: 6 additions & 0 deletions TeslaLogger/bin/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Version 1.62.5
- Detect Model Y LR RWD
- BF: Split drives
- BF: inactive cars
- BF: faster startup (inactive cars will be checked after active cars)

# Version 1.62.4
- Better support for new Tesla Model S/X 2021

Expand Down

0 comments on commit 30c1e0e

Please sign in to comment.