Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
Off-due as a real reminder in the care log (follow-up to #639) #642
Merged 37d 21h ago
Stacked on #640: this branch starts from #640's head (c5b064e), since lightOn/lightOff and src/light-day.ts exist only there. Merge #640 first; after that, this diff is just the one commit on top. The off-time is now a real care reminder, Switch the grow light off (light-off).
-
Reviews
ApprovedApproved. The light-off reminder is in reminders(), so the page, /care/api, health strip, grow card and watchdog all get it. The owner check on /care/reminder is unchanged. The terminal (/care done light-off, /care snooze light-off) goes through the same route, so it logs lightOff. Tests cover the due time, the 14 h cap, the snooze, the page buttons and the route. The preview answers on /care/api. I did not see the reminder on the preview, since no lightOn is logged there.
Two things next:
/care snooze light-offfrom the terminal defaults to 24 h, while the page snoozes for 1 h. Default light-off to 1 h in src/care-terminal.ts, or cap it in the route, so a terminal snooze cannot hide tonight's off-time.- Make the daily "Light ran" reminder reset on lightOn (you listed this as not done). Until then it can sit overdue beside a light that is on.
-
Checks
shipped merged
-
History
- Merge main (#640 landed) into the light-off reminder branch 60eb792
- Track the light's real day: lightOn/lightOff in the care log, off-due from the actual on-time (today: on 8:30 → off 20:30) (#640) b506101
- Light off as a real care reminder: due at the actual lightOn plus the schedule's hours, gone on lightOff, Done logs lightOff, a 1 h snooze cleared by the next lightOn, in the watchdog's overdue list (#641) 563ef75
- Light day: ask the Pi for its zone before wording or back-dating (refuse 'at' while unknown), order by time not insertion, tests for the check-in route and the card c5b064e
- Good night no longer logs lightOff (nothing turns the light off); drop dead import; /care checkin light on|off [HH:MM]; README cc87699
- Track the light's real day: lightOn/lightOff care-log actions, off due from the actual on-time, check-in Light button, Wake up / Good night log them (#639) d419139
- Night mode: the saplings are sleeping (animation flowing into a multiplayer game with a leaderboard), and Wake up / Good night for the owner with a morning check-in (water, sprout count) (#633) 7c15b9a
- uhubctl try-out outlasts the relay's 2.5 s light write timeout: the card shows "the arm server did not answer" while the try-out succeeds (#638) 9a22d95
- Cited sources in the care app: every target, reminder and stage links to a trusted reference (extension and peer-reviewed first); a Learn page per plant (#627) 3764d1f
- Grow watchdog: while plants are in the box, the app checks cameras, the Pi, stills and the light every 5 min and files an issue for the crew when something breaks (#630) 79a6bf9
- P0: sign-in works while the workshop is closed: allow /_plat/* (redirect to /__forge/signin) and the owner paths through the resting guard (#636) 888bdc7
- Grow light schedule: a switch driver (smart plug, GPIO relay, or uhubctl only when it switches the light alone) with a photoperiod that runs on the Pi (#631) 26776eb
- The workshop on a phone: camera at its real shape (not cropped), both cameras, no broken empty timelapse, controls on one line, offline vs not-planted, owner can set the sow date (#629) b57b2c6
- so101 serve picks the arm up when it is plugged back in, and lets it go when it is unplugged, without a restart (#622) fbdacf3
- Cameras stream with the arm unplugged: serve starts with no serial port, and resting stops driving, not cameras (#624) c33c342
- A dosing loop set to auto doses by itself once a minute, inside the same limits, and tests prove it never doses when it must not (#621) 49a9eb7
- /care refreshes itself when dosing changes: a mode change, a resume or a stop sends an event on /care/events (#620) 73a59b8
- so101 serve boots with the arm unplugged: /status says "arm: not connected", cameras and the grow box keep serving (#617) 71dc2a8
- Arm server: /grow/dosing (and /grow/light, /grow/pump) answer anyone who reaches the arm's port (#612) 21cb2b4
- Dosing: real peristaltic and top-off pump drivers with ml/s calibration, replacing the fake pumps (#610) fa0051d
Stacked on #640: this branch starts from #640's head (c5b064e), since lightOn/lightOff and src/light-day.ts exist only there. Merge #640 first; after that, this diff is just the one commit on top.
The off-time is now a real care reminder, Switch the grow light off (light-off). It appears in reminders() whenever the light is logged on. Because the care page, /care/api, the terminal, the health strip, the grow card's "Next" and the watchdog's overdue list all read that function, it reaches all of them without more wiring.
- Due time: the latest
lightOnplus the schedule's hours, using thelightSeen.hoursthe relay already keeps from the Pi. It falls back to 12 h before the Pi has answered and is held to 10–14 h, throughopenDay()insrc/light-day.ts. A laterlightOffremoves the reminder, and the nextlightOnstarts a new one. - Done posts to
/care/reminderand logs alightOffwithcause: "owner", so the day closes on the grow card too. On the page the button reads "It's off". - Snooze is 1 h on the page. A new
lightOnclears the snooze inCareLog.push, so last night's snooze can't hide today's off-time. - Cadence can't be edited:
everyonlight-offis refused, because the day length belongs to the light's schedule. - Citations are the current stage's photoperiod sources, so the reminder is cited like every other one.
- Plumbing:
snapshot(log, lightHours?), plusCareContext.lightHoursandCareView.lightHours, carry the Pi's hours to the care route and page.
src/light-off.test.ts covers the due time and the 14 h cap, reset on lightOff, the overdue list and health line, snooze expiry and its clearing on lightOn, the grow card's next-due, the page buttons, and the route (Done logs lightOff, every gets a 400, the reminder shows in /care/api). Those 6 tests and the 15 test files that touch care, the grow card or the watchdog pass (184 tests). The type check shows no errors in the changed files; the ones it reports elsewhere are in files this change doesn't touch. I didn't look at the preview.
Not done: the profile's daily "Light ran" reminder still doesn't reset on lightOn.
To try it: as the owner, tap Light on on /care/checkin (or /care checkin light on 08:30). /care then lists "Switch the grow light off" due 12 h later; It's off clears it and closes the day on the grow card.
🤖 Generated with Claude Code
The off-time is now a real care reminder, Switch the grow light off (light-off), shown while the light is logged on. It lives in reminders(), so the care page, /care/api, the terminal, the health strip, the grow card's "Next" and the watchdog's overdue list all show it. #640 has merged into main, so this pull's diff is just the reminder.
- Due time: the latest
lightOnplus the schedule's hours as the Pi last reported them. Before the Pi has answered it uses 12 h, and it is always held to 10–14 h (openDay()insrc/light-day.ts). LogginglightOffremoves the reminder, and the nextlightOnstarts a new one. - Done logs a
lightOff, so the day also closes on the grow card. On the page the button reads "It's off". - Snooze is 1 h on the page. A new
lightOnclears it, so last night's snooze can't hide today's off-time. - Cadence: changing the cadence (
every) onlight-offis refused, because the day length comes from the light's schedule. - Citations: it uses the current stage's photoperiod sources, like every other reminder.
- Plumbing:
snapshot(log, lightHours?),CareContext.lightHoursandCareView.lightHourscarry the Pi's hours to the care route and page.
src/light-off.test.ts covers the due time and the 14 h cap, reset on lightOff, the overdue list and health line, the snooze expiring and being cleared by lightOn, the grow card's "Next", the page buttons, and the route (Done logs lightOff, every is refused with 400, the reminder appears in /care/api). After merging main, the care, light, watchdog, workshop and night-switch tests pass (103), and the type check reports no errors in the changed files. The merge conflicts in care-routes.ts, light-day.ts and relay.ts came only from #640's squash, which matches the commit this branch was built on, so I kept this branch's side. I didn't check the preview.
Not done: the profile's daily "Light ran" reminder still doesn't reset on lightOn.
To try it: as the owner, tap Light on on /care/checkin (or run /care checkin light on 08:30). /care then lists "Switch the grow light off" due 12 h later, and It's off clears it.
🤖 Generated with Claude Code
Stacked on #640: this branch starts from #640's head (c5b064e), since
lightOn/lightOffandsrc/light-day.tsexist only there. Merge #640 first; after that, this diff is just the one commit on top.The off-time is now a real care reminder, Switch the grow light off (
light-off). It appears inreminders()whenever the light is logged on. Because the care page,/care/api, the terminal, the health strip, the grow card's "Next" and the watchdog's overdue list all read that function, it reaches all of them without more wiring.lightOnplus the schedule's hours, using thelightSeen.hoursthe relay already keeps from the Pi. It falls back to 12 h before the Pi has answered and is held to 10–14 h, throughopenDay()insrc/light-day.ts. A laterlightOffremoves the reminder, and the nextlightOnstarts a new one./care/reminderand logs alightOffwithcause: "owner", so the day closes on the grow card too. On the page the button reads "It's off".lightOnclears the snooze inCareLog.push, so last night's snooze can't hide today's off-time.everyonlight-offis refused, because the day length belongs to the light's schedule.snapshot(log, lightHours?), plusCareContext.lightHoursandCareView.lightHours, carry the Pi's hours to the care route and page.src/light-off.test.tscovers the due time and the 14 h cap, reset onlightOff, the overdue list and health line, snooze expiry and its clearing onlightOn, the grow card's next-due, the page buttons, and the route (Done logslightOff,everygets a 400, the reminder shows in/care/api). Those 6 tests and the 15 test files that touch care, the grow card or the watchdog pass (184 tests). The type check shows no errors in the changed files; the ones it reports elsewhere are in files this change doesn't touch. I didn't look at the preview.Not done: the profile's daily "Light ran" reminder still doesn't reset on
lightOn.To try it: as the owner, tap Light on on
/care/checkin(or/care checkin light on 08:30)./carethen lists "Switch the grow light off" due 12 h later; It's off clears it and closes the day on the grow card.🤖 Generated with Claude Code
Closes #641