Skip to content

fix(notifications): lower precipitation intensity threshold for wet detection (#567)#569

Merged
Orinks merged 1 commit intodevfrom
fix/AccessiWeather-issue-567
Apr 13, 2026
Merged

fix(notifications): lower precipitation intensity threshold for wet detection (#567)#569
Orinks merged 1 commit intodevfrom
fix/AccessiWeather-issue-567

Conversation

@Orinks
Copy link
Copy Markdown
Owner

@Orinks Orinks commented Apr 3, 2026

Summary

  • Adds a precipitation_sensitivity setting (light / moderate / heavy) that controls the minimum intensity (mm/h) required to count a minutely data point as wet
  • Previously is_wet() used > 0, which triggers on any non-zero value including sensor noise and sub-drizzle traces — now defaults to light (≥ 0.01 mm/h) which still catches light rain while filtering noise
  • Thresholds: light ≥ 0.01 mm/h, moderate ≥ 0.1 mm/h, heavy ≥ 1.0 mm/h
  • Setting exposed in Settings → Notifications as a dropdown after the start/stop checkboxes
  • All existing behaviour preserved (threshold defaults to 0.0 when not set, and light is the default sensitivity)

Changes

  • notifications/minutely_precipitation.py: add INTENSITY_THRESHOLD_* constants and SENSITIVITY_THRESHOLDS map; update is_wet(), detect_minutely_precipitation_transition(), and build_minutely_transition_signature() to accept a threshold= kwarg
  • models/config.py: add precipitation_sensitivity: str = "light" field with round-trip serialisation and validate_on_access() guard
  • notifications/notification_event_manager.py: thread the setting through _check_minutely_precipitation_transition()
  • ui/dialogs/settings_tabs/notifications.py: add sensitivity dropdown with three labelled choices
  • Tests for is_wet() with each threshold, transition detection with threshold, manager honouring sensitivity, and round-trip/default/validation for the new setting

Test plan

  • pytest tests/test_notification_event_manager.py — all 39 tests pass
  • pytest tests/test_models.py — all model tests pass including new sensitivity tests
  • Full suite: pytest -n auto -m "not integration" — 3253 passed, 4 skipped
  • ruff check --fix . && ruff format . — clean

Closes #567

@Orinks Orinks force-pushed the fix/AccessiWeather-issue-567 branch from ac4bcc0 to 7eadfc0 Compare April 13, 2026 02:24
…etection

Add a configurable precipitation_sensitivity setting ("light", "moderate",
"heavy") that controls the minimum intensity (mm/h) required to count a
minutely point as wet.  Previously is_wet() used > 0, which fires on any
non-zero value including sensor noise and sub-drizzle traces.

- Add INTENSITY_THRESHOLD_LIGHT/MODERATE/HEAVY constants and SENSITIVITY_THRESHOLDS
  map to minutely_precipitation.py
- Update is_wet(), detect_minutely_precipitation_transition(), and
  build_minutely_transition_signature() to accept a threshold= kwarg
  (default 0.0 preserves backward compat)
- Add precipitation_sensitivity: str = "light" field to AppSettings with
  round-trip serialisation and validate_on_access() guard
- Thread the setting through NotificationEventManager so the sensitivity
  choice is honoured when detecting transitions
- Add sensitivity dropdown to the Notifications settings tab
  ("Light rain and above" / "Moderate rain and above" / "Heavy rain only")
- Add tests covering is_wet() thresholds, transition detection with threshold,
  and the manager honouring the sensitivity setting

Closes #567

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Orinks Orinks force-pushed the fix/AccessiWeather-issue-567 branch from 7eadfc0 to 704a670 Compare April 13, 2026 14:10
@Orinks Orinks enabled auto-merge (squash) April 13, 2026 14:10
@Orinks Orinks merged commit 1622d4c into dev Apr 13, 2026
2 checks passed
@Orinks Orinks deleted the fix/AccessiWeather-issue-567 branch April 13, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant