- Parse each child's own "Today" day widget for the timetable (FR-16); drop the
school-wide week calendar's lesson grid and clean the leaked routine rows.
- Add the editable codes map (FR-17): subjects, rooms, teachers and period
labels, seeded, an unknown code falls back to the raw code; `school codes` CLI.
- Brief: Finn's block first, then Harry's, four sections always present (FR-9);
periods decoded into plain English; the undated tail is one counted line (FR-18).
- Calendar: write periods + work due + work overdue + major events, per child,
on every pass. Identity is the stable per-item key, so a re-run never re-inserts
(FR-8). morning-brief.sh now runs scan -> calendar push -> notify.
- Day-widget labels are 12-hour: 1-6 read as PM, fixing afternoon periods.
Proven live on .13: image 0.6.2-phase6b7b; both children's briefs decoded and
separate; 35 events in calendar.school; runs 2 and 3 of the scan added nothing.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
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>
Add the Home Assistant REST calendar client and the idempotent sync that
writes important school events to Sam's Home Assistant calendar (FR-8). The
school stays read-only; the only write is to the calendar (rule 7).
- internal/calendar: HA REST client (states, create_event, get_events,
delete_event) and the sync that selects important future events, adopts an
existing event by its description marker, records the HA event id on the
item, and records every attempt.
- internal/store: migration 003 (items.ha_event_uid, items.ha_pushed_at and
the append-only calendar_pushes table), candidates, mark-synced and the
push log.
- internal/parse: a school event is important; a routine class period is not.
- cmd/school: `school calendar entities|status|push|events`.
- web: an "Add to calendar" item action and a fail-loud calendar banner, so a
failed write is never swallowed (FR-12).
- scripts/calendar-push.sh, Makefile target, env example, docs and tests.
The target is configurable (SCHOOL_HA_CALENDAR_ENTITY). Home Assistant has no
non-Google writable calendar today, so the entity is asked on AUD-110.
Co-Authored-By: Paperclip <noreply@paperclip.ing>