Skip to content

Commit

Permalink
detect fast charging - fleet api
Browse files Browse the repository at this point in the history
  • Loading branch information
bassmaster187 committed Jul 2, 2024
1 parent 7ab23c4 commit cef5b91
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions TeslaLogger/TelemetryConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ void handleStatemachine(dynamic j, DateTime date, string resultContent)
{
try
{
var cols = new string[] { "ChargeState", "Gear", "VehicleSpeed","Location" };
var cols = new string[] { "ChargeState", "Gear", "VehicleSpeed","Location", "FastChargerPresent" };

foreach (dynamic jj in j)
{
Expand Down Expand Up @@ -683,7 +683,24 @@ void handleStatemachine(dynamic j, DateTime date, string resultContent)

Log("Speed: " + v1);
}
} else
} else if (key == "FastChargerPresent")
{
if (v1 == "true")
{
if (Driving)
{
Log("Parking -> DC Charging ***");
Driving = false;
}

if (!Charging)
{
Log("DC Charging ***");
Charging = true;
}
}
}
else
{
Log($"Key: {key} / Value: {v1}");
}
Expand Down

0 comments on commit cef5b91

Please sign in to comment.