Adds logging for parking zone code
All checks were successful
Build, Push and Run Container / build (push) Successful in 24s

Adds logging of the parking zone code when parking starts in a determined zone.
This provides more detailed information for debugging and monitoring purposes.
This commit is contained in:
2025-08-21 23:31:30 +02:00
parent 3c64228f8c
commit 1272ecab46

View File

@@ -108,18 +108,21 @@ public class MessageProcessor
this.logger.LogInformation("Parking started in non-parking zone for {VIN}", vin);
}
// Push parking started in zone
this.parkingState.SetParkingStarted();
if (sendNotification)
this.pushApi.Send(pushoverToken, new PushoverMessage
{
Title = $"Parkolás elindult: {zoneLookupResult.Value}",
Message = $"Megálltál egy parkolási zónában, a GPS szerint: {this.teslaState.Latitude},{this.teslaState.Longitude}" + Environment.NewLine +
$"A zónatérkép szerint ez a {zoneLookupResult.Value} jelű zóna",
Priority = Priority.Normal,
Timestamp = DateTimeOffset.Now.ToLocalTime().ToString(),
});
this.logger.LogInformation("Parking started for {VIN}", vin);
else
{
// Push parking started in zone
this.parkingState.SetParkingStarted();
if (sendNotification)
this.pushApi.Send(pushoverToken, new PushoverMessage
{
Title = $"Parkolás elindult: {zoneLookupResult.Value}",
Message = $"Megálltál egy parkolási zónában, a GPS szerint: {this.teslaState.Latitude},{this.teslaState.Longitude}" + Environment.NewLine +
$"A zónatérkép szerint ez a {zoneLookupResult.Value} jelű zóna",
Priority = Priority.Normal,
Timestamp = DateTimeOffset.Now.ToLocalTime().ToString(),
});
this.logger.LogInformation("Parking started for {VIN} at {ZoneCode}", vin, zoneLookupResult.Value);
}
}
else
this.logger.LogError(zoneLookupResult.Exception, "Can't start parking: error while determining parking zone");