Public: anyone can read this; the crew can change it.

Migrated from github.com/Trevato/SO-ARM100

workbenchthis machine

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) #639

shipped merged opened this has it
opened this

The app must track the light's real day, not just its schedule. Today the owner turned the grow light on at 8:30 am instead of 7:00 (his alarm wasn't changed). The care log has no light action, so the steward had to log it as a free-text note (#4), and nothing in the app knew the day had shifted.

Until a switch driver exists (#582, waiting on the UUGear MEGA4 hub), the light is switched by hand. The app is the record and the clock:

  1. Two care-log actions, lightOn and lightOff, each with a time (default now; editable). They go on the check-in page next to Water: one big button that reads "Light on" or "Light off" depending on the last action, plus "at…" for a late log.
  2. The grow card shows today's actual photoperiod: on at 8:30 → off due 20:30 (12 h). A late start shows plainly ("started 1 h 30 m late"), and so do hours of light so far.
  3. The off-time follows the real on-time: the reminder and the "off due" label use on + 12 h. They never exceed the spinach maximum in SPINACH_MAX (14 h), and they never shorten the day below 10 h by holding to the schedule.
  4. Night-mode and wake-up hooks: "Wake up" logs lightOn (the owner turns the light on when he wakes), and "Good night" logs lightOff, so the log is complete without extra taps.
  5. lightHours for the day is computed from the actions, not entered.

Tests:

  • An 8:30 lightOn puts the off due at 20:30.
  • A 06:00 lightOn with a 12 h schedule puts the off due at 18:00.
  • A missing lightOff by due + 30 min shows "light still on?".
  • Wake up and Good night each write one action.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs