From c44f0d327da175a6c5a89858f3c15df057238c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szak=C3=A1ts=20Alp=C3=A1r=20Zsolt?= Date: Fri, 22 Aug 2025 08:53:42 +0200 Subject: [PATCH] Improves parking state logic Ensures the parking state is correctly managed by setting the parking started state before any parking zone checks. Also, updates the logging message to more accurately reflect the car's state. --- Source/ProofOfConcept/Services/MessageProcessor.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/ProofOfConcept/Services/MessageProcessor.cs b/Source/ProofOfConcept/Services/MessageProcessor.cs index 4a95a0c..52e1b0f 100644 --- a/Source/ProofOfConcept/Services/MessageProcessor.cs +++ b/Source/ProofOfConcept/Services/MessageProcessor.cs @@ -74,7 +74,7 @@ public class MessageProcessor else { this.parkingState.SetCarMoved(); - this.logger.LogInformation("{vin} moved (not parking anymore)", vin); + this.logger.LogInformation("{vin} is NOT in a parked state", vin); } if (this.parkingState is { ParkingInProgress: false, CarParked: true }) @@ -94,6 +94,9 @@ public class MessageProcessor if (zoneLookupResult.IsSuccessful) { + //Set parking started + this.parkingState.SetParkingStarted(); + if (String.IsNullOrWhiteSpace(zoneLookupResult.Value)) { // Push not a parking zone @@ -111,7 +114,6 @@ public class MessageProcessor else { // Push parking started in zone - this.parkingState.SetParkingStarted(); if (sendNotification) this.pushApi.Send(pushoverToken, new PushoverMessage {