From 89776ae89d6e2e475931ebb1d7064897b015f83f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20K=C3=BChnel?= Date: Sun, 19 Jan 2025 18:15:53 +0100 Subject: [PATCH] fix(FleetTelemetryWebSocketService): only set state to online if is offline or asleep --- .../Server/Services/FleetTelemetryWebSocketService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TeslaSolarCharger/Server/Services/FleetTelemetryWebSocketService.cs b/TeslaSolarCharger/Server/Services/FleetTelemetryWebSocketService.cs index 30d598c79..d3ce34c8f 100644 --- a/TeslaSolarCharger/Server/Services/FleetTelemetryWebSocketService.cs +++ b/TeslaSolarCharger/Server/Services/FleetTelemetryWebSocketService.cs @@ -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;