Commit graph

11 commits

Author SHA1 Message Date
Barely Removable
7d2d38c848 Document mode:single -> parallel fix on the HA automation
All checks were successful
Deploy / deploy (push) Successful in 23s
The fix itself lives entirely in HA config (automation.lunch_menu_family_calendar),
not in this repo, so there's nothing to redeploy here -- this just
records what broke and why, for the next time someone (human or Claude)
is debugging why calendar events aren't showing up.

Root cause: mode: single (HA's default) let only one webhook-triggered
run execute at a time; a week push fires 5 POSTs back-to-back, so 4 of 5
got rejected as failed_single and only one day's event was ever created.
Switched to mode: parallel and verified all 5 days land correctly now.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KsJqAZ82Veyf5oihBr71S5
2026-09-03 09:21:53 -07:00
Barely Removable
1c31ec780b Pivot from SMS to calendar-only: weekly pull, independent schedule
All checks were successful
Deploy / deploy (push) Successful in 36s
Deletes the entire SMS path at the user's request — Gmail SMTP, phone
number management, carrier gateway settings, and the daily SMS+calendar
job are all gone. Home Assistant calendar events are now the only output.

- scraper.py: get_week_menu() returns the whole school week in one call
  (the Nutrislice API is week-granular regardless of the date requested);
  drops the now-unused single-day get_lunch_menu() and the send_sms()/
  CLI entrypoint that only the SMS path used.
- app.py: push_week_to_calendar() fetches the week and pushes every day
  with a posted menu; runs on its own schedule (calendar_run_time/
  calendar_run_days, tagged "calendar" jobs) fully decoupled from
  anything else, since neither calendar target supports delete-based
  dedup and double-firing would create duplicate events. Manual actions
  become "Push This Week to Calendar" and "Preview This Week's Menu"
  (now a real dry-run over the whole week, not just today).
- Deleted the vacation/no-push date range feature: a day with no posted
  menu already produces empty items, and pushing already skips empty
  items — the extra vacation-range layer for suppressing days the school
  *did* post a menu for was judged unnecessary and removed along with
  its UI, settings field, and API endpoints.
- Deleted scheduler.py, a dead alternate entrypoint (unused by Dockerfile/
  docker-compose) that only worked via the now-deleted scraper.main().
- load_settings() now merges the file over _DEFAULTS instead of returning
  it verbatim — the server's existing settings.json predates this schema
  and has neither calendar_run_time nor calendar_run_days, which would
  otherwise silently schedule zero jobs after this deploys. Verified with
  a migration test using the server's actual old-schema settings shape.

All of this was exercised for real: Docker builds, live containers against
a mock webhook (single-day and full-week pushes, per-entity dedup
behavior), a migration test with the pre-existing settings.json shape,
and a Chrome pass over the rebuilt UI.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KsJqAZ82Veyf5oihBr71S5
2026-09-03 09:10:36 -07:00
Barely Removable
d3498849d3 Document calendar target switch to calendar.family_2
All checks were successful
Deploy / deploy (push) Successful in 33s
Two HA entities are both named "Family" (calendar.family and
calendar.family_2); the automation now targets _2 per user preference.
Note it only supports create_event, not delete, so a bad push has to be
cleaned up manually in Google Calendar rather than via the HA API.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KsJqAZ82Veyf5oihBr71S5
2026-09-03 08:56:05 -07:00
Barely Removable
486d175d6a Document the HA-side webhook automation
All checks were successful
Deploy / deploy (push) Successful in 19s
The calendar-sync feature landed 2026-09-02 but only the app.py half —
the HA automation to receive the webhook and create the calendar event
was never built, so it silently did nothing. Built it now
(automation.lunch_menu_family_calendar: local_only webhook trigger ->
calendar.create_event on calendar.family) and documented where to look
on each side when this breaks again.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KsJqAZ82Veyf5oihBr71S5
2026-09-03 07:25:07 -07:00
Barely Removable
9c1112f28e Add carrier gateway field, calendar-only push, and menu preview to UI
All checks were successful
Deploy / deploy (push) Successful in 39s
Surfaces the settings/actions that only existed at the API or env-var
level: carrier_gateway was already an accepted setting but had no form
field; HA webhook and Gmail config were invisible from the UI entirely.
Adds a calendar-only push and a side-effect-free preview so the HA sync
and scraper can be tested without texting everyone. Secrets stay env-only
since the UI has no auth — only configured/not-configured status is
exposed.

Also fixes calendar_result reporting "ok" when HA_WEBHOOK_URL wasn't set
at all, and stops the calendar-only push from clobbering the SMS job's
last_run/last_result status fields.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KsJqAZ82Veyf5oihBr71S5
2026-09-03 07:18:12 -07:00
Barely Removable
a9ea0a2d87 Add Home Assistant calendar sync via webhook
All checks were successful
Deploy / deploy (push) Successful in 42s
Every successful menu fetch now POSTs the day's items to HA_WEBHOOK_URL
(when set), so an HA automation can turn it into a calendar event. Surface
the push result as a "Calendar Sync" badge on the status card, hidden
unless HA_WEBHOOK_URL is configured.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KsJqAZ82Veyf5oihBr71S5
2026-09-03 07:05:31 -07:00
83533d339d Add CLAUDE.md documenting architecture and deploy pipeline
All checks were successful
Deploy / deploy (push) Successful in 27s
2026-08-25 23:36:04 -07:00
dc40621eed Install rsync in job container before sync step
All checks were successful
Deploy / deploy (push) Successful in 32s
2026-08-25 23:23:32 -07:00
2b31e8ecef Retrigger deploy after runner mount fix
Some checks failed
Deploy / deploy (push) Failing after 13s
2026-08-25 23:15:42 -07:00
f296948d56 Add Forgejo deploy workflow
Some checks failed
Deploy / deploy (push) Failing after 38s
2026-08-25 22:55:02 -07:00
b568287528 Initial commit: Lunch Notifier source from server 2026-08-25 22:53:07 -07:00