Phase 6 follow-up: today-and-future events, one write per school-wide event

Two corrections found while preparing the first live run:

- A scan that runs late in the day still records today's school events; the
  candidate window now starts at the local start of day instead of "now".
- The Compass week calendar is school-wide, so one event is stored against each
  child. Write it once, with no child prefix in the title, and record the same
  Home Assistant event id on every child's item. A per-child event still keeps
  the child's name.

Also report pending events as events, not rows, in `school calendar status`.
Tests cover the window and the de-duplication.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-10-15 18:05:33 +11:00
parent f6be17fe4f
commit f56dbb46ac
5 changed files with 244 additions and 80 deletions

View File

@@ -605,7 +605,7 @@ func (s *Server) itemCalendarView(it store.CalendarItem, now time.Time) calendar
UID: it.HAEventUID,
}
v.Eligible = it.Type == "event" && it.Source == "compass" && it.Importance == "high" &&
it.DueAt != nil && it.DueAt.After(now)
it.DueAt != nil && !it.DueAt.Before(calendar.StartOfDay(now))
if it.HAPushedAt != nil {
v.PushedAt = it.HAPushedAt.In(s.cfg.Location).Format("Mon 02 Jan 2006 15:04")
}