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:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user