mirror of
https://github.com/usetrmnl/inker.git
synced 2026-08-13 23:19:06 -07:00
* Add per-device night sleep schedule (quiet hours) Devices can now be configured with a nightly quiet-hours window. During the window the display endpoint returns refresh_rate = seconds-until-wake, so the device deep-sleeps the whole night in one cycle (battery saving, no nighttime e-ink refreshes) and wakes at the configured time. Two per-device modes (showSleepScreen): - false (default): keep the current screen frozen until morning - true: show a dedicated sleep screen (crescent moon + "Sleeping until HH:MM"), generated as a 1-bit e-ink PNG via Sharp (new SleepScreenService) The window is evaluated in the global DEFAULT_TIMEZONE and supports ranges that cross midnight. The sleepStartAt/sleepStopAt columns already existed in the schema; adds showSleepScreen (applied via prisma db push, no migration). Wires the fields through the device update DTO/service and the device edit form (toggle + time inputs). Unit tests cover the quiet-hours logic.