Skip to content

feat: Add minutely precipitation notifications from Pirate Weather #483

@Orinks

Description

@Orinks

Summary

Pirate Weather provides minutely precipitation forecasts (Dark Sky-style "rain starting in 12 minutes"), but the data is currently unused. This feature should parse the minutely block, generate notifications, and include a setting to toggle them.

What the Minutely Block Contains

PW returns a minutely block with per-minute precipitation intensity and probability for the next 60 minutes. This enables notifications like:

  • "Rain starting in 12 minutes"
  • "Snow ending in 25 minutes"
  • "Heavy rain expected in 8 minutes"
  • "Precipitation clearing up in 15 minutes"

This was one of Dark Sky's most loved features.

Implementation

1. Parse Minutely Data

  • Add _parse_minutely() to PirateWeatherClient
  • Extract precipitation intensity, probability, and type per minute
  • Detect transitions: dry→wet (precipitation starting) and wet→dry (precipitation ending)
  • Calculate "starts in X minutes" / "ends in X minutes" from transition points

2. Notification Integration

  • Wire into the existing notification flow (src/accessiweather/notifications/)
  • Trigger notifications on precipitation transitions:
    • Precipitation starting soon (configurable threshold, e.g. within 15 min)
    • Precipitation ending soon
    • Intensity changes (light→heavy)
  • Include precipitation type in notification (rain, snow, sleet, etc.)
  • Respect notification cooldown to avoid spamming

3. Settings

  • Add toggle: "Minutely precipitation alerts" (on/off, default on)
  • Add threshold setting: "Notify when precipitation starts within X minutes" (default 15)
  • Only available when Pirate Weather is the selected source (or in auto mode with PW configured)
  • Settings location: Settings > Notifications or Settings > Data Sources

4. Accessibility

  • Notifications should be screen reader friendly
  • Use clear, spoken-style text: "Rain expected to start in about 12 minutes" not "precip_intensity transition at minute 12"
  • Consider a sound event for precipitation alerts (could tie into sound packs)

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions