Skip to content

Commit

Permalink
Merge pull request #1763 from pkuehnel/fix/DoNotSetToOfflineOrAsleepO…
Browse files Browse the repository at this point in the history
…nCharging

fix(FleetTelemetryWebSocketService): only set state to online if is offline or asleep
  • Loading branch information
pkuehnel authored Jan 19, 2025
2 parents e94b8cb + 89776ae commit 9a3ea32
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ private async Task ReceiveMessages(DtoFleetTelemetryWebSocketClients client, str
if (!IsCarValueLogTooOld(settingsCar, carValueLog, message.Type))
{
if (carValueLog.BooleanValue == true
&& (settingsCar.State != CarStateEnum.Asleep && settingsCar.State != CarStateEnum.Offline))
//Do only overwrite these states as otherwise Charging or Driving might be overwritten
&& settingsCar.State is CarStateEnum.Unknown or CarStateEnum.Suspended)
{
settingsCar.State = CarStateEnum.Offline;
_propertyUpdateTimestamps[(settingsCar.Id, message.Type)] = carValueLog.Timestamp;
Expand Down

0 comments on commit 9a3ea32

Please sign in to comment.