Add soil moisture index view to TUI #10

Merged
coding-agent-marvin8 merged 0 commits from refs/pull/10/head into main 2026-07-01 21:31:25 +00:00
coding-agent-marvin8 commented 2026-07-01 08:43:21 +00:00 (Migrated from codeberg.org)

Adds a soil moisture index view to the TUI, toggled with m. Uses an exponential-decay leaky-bucket model (decay=0.85, ≈4–5 day half-life) applied to daily rainfall totals to approximate soil moisture level for farm management decisions.

Changes

  • Database.get_moisture_index() — new DB method computing the leaky-bucket moisture time series, with the same grouping and pagination contract as get_rain
  • ChartMode enum and m key binding — toggles the bar chart and stats panel between rainfall and moisture views
  • Stats panel header — always shows current mode (Rain/Moisture) and grouping (Daily/Weekly/Monthly/Yearly)
  • Tentative moisture entries — _compute_tentative_moisture_entries generates decaying synthetic bars for days since the last DB record, showing soil drying in real time

Closes #9

Adds a soil moisture index view to the TUI, toggled with `m`. Uses an exponential-decay leaky-bucket model (decay=0.85, ≈4–5 day half-life) applied to daily rainfall totals to approximate soil moisture level for farm management decisions. ## Changes - `Database.get_moisture_index()` — new DB method computing the leaky-bucket moisture time series, with the same grouping and pagination contract as `get_rain` - `ChartMode` enum and `m` key binding — toggles the bar chart and stats panel between rainfall and moisture views - Stats panel header — always shows current mode (Rain/Moisture) and grouping (Daily/Weekly/Monthly/Yearly) - Tentative moisture entries — `_compute_tentative_moisture_entries` generates decaying synthetic bars for days since the last DB record, showing soil drying in real time Closes #9
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/rainlog!10
No description provided.