Skip to content

feat(alerts): warn about a low 12V battery once per parking - #765

Merged
joszz merged 1 commit into
mainfrom
feat/low-12v-once-per-parking
Nov 25, 2026
Merged

joszz merged 1 commit into
mainfrom
feat/low-12v-once-per-parking

Conversation

@joszz

@joszz joszz commented Nov 25, 2026

Copy link
Copy Markdown
Owner

A parked car with a weak 12V battery was warned about on every new poll that still showed it low. A car left in the cold for a few days sent the same "Low 12V battery" warning again and again.

What changes

  • The low 12V warning goes out once per parking, counted from LastParkedAt (or the first poll of the stretch when the car was never seen parking).
  • In the same parking it is sent again only when the voltage has dropped another 0.3 V (Low12VRewarnDropVolt) below the voltage it was last warned about, rounded to the tenth the alert shows. A battery that stays low is news once. One that keeps draining is news again.
  • New repository methods:
    • INotificationRepository.GetLastSentAtAsync: when the newest notification of a category for a car went out after a given moment, deleted ones included.
    • ITelemetryRepository.GetBatteryVoltageAtAsync: the 12V voltage as last reported at or before a moment. It's in TelemetryRepository and DemoTelemetryRepository. The demo one answers the current voltage, since demo mode runs no Worker.
  • The README alert table and documentation/CONFIGURATION.md (AUX_BATTERY_LOW_VOLT) describe the new rule.

Tests

  • PushNotificationCheckServiceTests: one warning per parking, a new warning after a further 0.3 V drop, none for a smaller drop, and a new parking warns again.
  • NotificationRepositoryTests and TelemetryRepositoryTests cover the two new queries.
  • dotnet test --project src/GarageStack.Tests: 2083 passed, 37 skipped (the Postgres-only tests). dotnet format --verify-no-changes is clean.

🤖 Generated with Claude Code

A parked car with a weak 12V battery was warned about on every new
poll that still showed it low, so a car left in the cold for a few
days sent the same warning again and again.

It is now warned about once per parking. It is warned again in the
same parking only when the voltage has dropped another 0.3 V below
the one it was last warned about (rounded to the tenth the alert
shows), so a battery that keeps draining is still news.

- INotificationRepository.GetLastSentAtAsync: when the newest
  notification of a category went out since a moment.
- ITelemetryRepository.GetBatteryVoltageAtAsync: the 12V voltage as
  last reported at a moment, in TelemetryRepository and the demo one.
- README and CONFIGURATION describe the new rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joszz
joszz force-pushed the feat/low-12v-once-per-parking branch from bfcfd99 to 1e17a62 Compare November 25, 2026 21:39
@joszz
joszz enabled auto-merge November 25, 2026 21:39
@joszz
joszz merged commit 01b9ea9 into main Nov 25, 2026
30 checks passed
@joszz
joszz deleted the feat/low-12v-once-per-parking branch November 25, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant