Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ GarageStack checks your vehicle's state every 5 minutes and sends both a browser
| Car left unlocked | `doors/locked = false` while engine is off |
| Door left open | Any door, boot, or bonnet open while engine is off |
| Window left open | Any window open while engine is off |
| Moved while parked | The car reports a position more than 300 m from where it parked, with the engine off: towed, lifted onto a truck, or taken on a ferry. Sent once per parking, with the car's first report after the move (a sleeping car only reports now and then) |
| Moved while parked | The car reports a position more than 1.5 km from where it parked, with the engine off: towed, lifted onto a truck, or taken on a ferry. Sent once per parking, with the car's first report after the move (a sleeping car only reports now and then) |
| Arrived home or at work | The car parks at a home or work place with **Notify on arrival and departure** switched on (Trip log > Home and work), judged by the position of the poll it parked in. Not sent for a drive that never left the place it started in |
| Left home or work | The car drives out of such a place: sent on its first position outside the place's radius, so starting the engine to warm the car up sends nothing |
| Charging complete | Charging stops while the cable is still connected (plug-in vehicles) |
Expand Down
12 changes: 12 additions & 0 deletions src/GarageStack.Tests/PushNotificationCheckServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,18 @@ public void CheckMovedWhileParked_GpsWanderingNearby_StaysQuiet()
Assert.Empty(alerts);
}

// A fix that strayed further still, as one from under a roof can: 0,7 km.
[Fact]
public void CheckMovedWhileParked_GpsStrayingUnderAKilometre_StaysQuiet()
{
var alerts = new List<(string, string, string)>();

CreateService().CheckMovedWhileParked(
ParkedInAmsterdam(), Parked(s => { s.Latitude = 52.3763; s.Longitude = 4.8900; }), alerts);

Assert.Empty(alerts);
}

[Fact]
public void CheckMovedWhileParked_NoParkedPositionOrNoFix_StaysQuiet()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,10 @@ internal async Task CheckParkedAsync(
await SendAsync(vehicle, moved, notifications, ct, onceSince: vehicle.LastParkedAt);
}

// Further than GPS wanders in a car park or a garage, nearer than a tow truck takes a car.
internal const double MovedWhileParkedMeters = 300;
// Further than a parked car's fix strays, nearer than a tow truck or a ferry takes it. A fix
// from a garage, a multi-storey or between tall buildings has put a car standing still 700 m
// off its spot, so the margin is wide.
internal const double MovedWhileParkedMeters = 1500;

/// <summary>
/// Warns when the car reports a position well away from where it parked while the engine stayed
Expand Down
Loading