Skip to content

Alert charts, stricter UV/particulates/crossing triggers - #42

Merged
robdevops merged 7 commits into
mainfrom
claude/envirobot-next
Oct 13, 2026
Merged

robdevops merged 7 commits into
mainfrom
claude/envirobot-next

Conversation

@robdevops

Copy link
Copy Markdown
Owner

Alerts carry their 1D chart

  • Temperature crossing: the temperature chart; gusts: the wind chart; UV: the UV chart; particulates (unhealthy and safe again): the particulates chart
  • One helper (lib/alerts/pictures.py) builds each chart the way a typed request for it would; the alert is the picture with its text as the caption and the usual buttons
  • A chart that cannot be made, or a picture Telegram refuses, leaves the alert as plain text
  • A single-reading chart's legend uses the reading's name ("UV index", not "Solar and uvi")

Stricter triggers

  • UV and particulates now need two distinct readings in a row (lib/alerts/confirm.py, counted by the reading's own timestamp, saved across checks and restarts)
  • The temperature crossing needs outdoor and indoor to differ by more than 1°C (was 0.3)

Logs / tests

  • The live-readings log line is just the summary
  • The fake air sensor reports PM1 and the fake station reports UV and solar, so the new charts are tested against realistic data

No migration needed beyond what #41 already asked for.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf


Generated by Claude Code

The alert goes out as the chart with its text as the caption (and the usual
buttons); a chart that cannot be made, or a picture Telegram refuses, falls
back to the text alone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
…hart to the particulates alerts

One helper (lib/alerts/pictures.py) makes the chart a typed request for it would
give; the crossing alert uses it too. A chart that cannot be made leaves the
alert as text.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
… all three lines

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
The fake station now reports a UV index (dark at night, a daytime hump), so the
UV chart is tested against real-looking data.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
…t legend: UV index, not Solar and uvi)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
…ule); temperature crossing needs more than 1 degree

lib/alerts/confirm.py: a condition must hold for two readings in a row, counted
by the reading's own timestamp, so a check that sees the same reading again
counts for nothing. The run is saved, so it survives checks and restarts.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
@robdevops
robdevops merged commit 275c0d2 into main Oct 13, 2026
3 checks passed
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.

2 participants