Lightning proximity alerts (#87 Phase B) #120
No reviewers
Labels
No labels
area:ai
area:ci-cd
area:notifications
area:observability
area:public-pages
backlog
bug
duplicate
enhancement
help wanted
invalid
question
type:decision
type:feature
type:infra
type:maintenance
type:security
v1.0.1
v1.1.0
v1.2.0
v1.3.0
v2.0.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/WeatherBot!120
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lightning-proximity"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Second half of #87 — completes it. Opt-in per location; default (no radius set) is a no-op, zero behavior change.
Location.lightning_alert_radius_mi(null = off) +lightning_last_alerted_at(cooldown),ChannelLocationSub.notify_lightning.services/lightning_alerts.py—poll_lightning()reuses the Phase Afetch_lightningper location (shared cache), keeps clusters within ahaversine_milesradius and newer thanLIGHTNING_ALERT_MAX_AGE_MINUTES, respects a per-location cooldown (LIGHTNING_ALERT_COOLDOWN_MINUTES) and location snooze, and dispatches a synthetic "Lightning Nearby" alert through the existing per-notifier send path (same pattern as the outbreak digest — no new per-notifier code). Cooldown is stamped only after a real dispatch, so a quiet-hours-only suppression retries next cycle. Fail-soft per location.LIGHTNING_POLL_INTERVAL_MINUTES(no-op when the feed isn't configured).Testing (dev server)
ruff clean; 10 proximity tests (radius/age/cooldown/quiet-hours/opt-in boundaries + haversine); bulk suite 775 passed; migration 0029 applied on a restored copy of the real dev DB (all three columns present).
Closes #87
🤖 Generated with Claude Code