Pivot from SMS to calendar-only: weekly pull, independent schedule
All checks were successful
Deploy / deploy (push) Successful in 36s
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
This commit is contained in:
parent
d3498849d3
commit
1c31ec780b
6 changed files with 231 additions and 646 deletions
34
.env.example
34
.env.example
|
|
@ -1,30 +1,20 @@
|
|||
# Copy this to .env and fill in your values
|
||||
|
||||
# --- Required ---
|
||||
# 10-digit phone number (no + or country code)
|
||||
PHONE_NUMBER=4805405363
|
||||
|
||||
# Your carrier's SMS email gateway
|
||||
# Verizon: vtext.com | T-Mobile: tmomail.net | AT&T: txt.att.net | Cricket: sms.cricketwireless.net
|
||||
CARRIER_GATEWAY=vtext.com
|
||||
|
||||
# Gmail address to send from
|
||||
GMAIL_USER=you@gmail.com
|
||||
|
||||
# Gmail App Password (myaccount.google.com → Security → App passwords)
|
||||
# Remove spaces from the 16-char code
|
||||
GMAIL_APP_PASSWORD=xxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
# --- Optional ---
|
||||
# Home Assistant webhook URL to push the day's menu to (for a calendar-event
|
||||
# automation). Leave unset to skip. e.g. http://192.168.86.X:8123/api/webhook/<id>
|
||||
# Home Assistant webhook URL that receives the day's menu and creates a
|
||||
# calendar event (see automation.lunch_menu_family_calendar in HA).
|
||||
# e.g. http://192.168.86.X:8123/api/webhook/<random-token>
|
||||
HA_WEBHOOK_URL=
|
||||
|
||||
# Time to send the text each day (24-hour HH:MM, container timezone)
|
||||
RUN_TIME=07:00
|
||||
# --- Optional ---
|
||||
# Day(s) of week to pull the upcoming school week and push it to the
|
||||
# calendar (comma-separated: mon,tue,wed,thu,fri,sat,sun). Picking more
|
||||
# than one day creates duplicate events for days already pushed — most
|
||||
# people want just one.
|
||||
CALENDAR_RUN_DAYS=sun
|
||||
|
||||
# Days to run (comma-separated: mon,tue,wed,thu,fri,sat,sun)
|
||||
RUN_DAYS=mon,tue,wed,thu,fri
|
||||
# Time to run the pull (24-hour HH:MM, container timezone)
|
||||
CALENDAR_RUN_TIME=18:00
|
||||
|
||||
# HTTP trigger server port
|
||||
# HTTP server port
|
||||
PORT=2323
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue