Skip to content

Add configurable sleep hours to blank ring light at night#108

Merged
GageLawton merged 1 commit into
mainfrom
claude/sleepy-feynman-SIYML
May 27, 2026
Merged

Add configurable sleep hours to blank ring light at night#108
GageLawton merged 1 commit into
mainfrom
claude/sleepy-feynman-SIYML

Conversation

@GageLawton
Copy link
Copy Markdown
Owner

Summary

Closes #102

The ring light stays on overnight, which is bright enough to disrupt sleep. This PR adds led.sleep_start and led.sleep_end to config.json — a local-time window (0–23 hours) during which the ring is completely blanked.

Default ships as 10 pm – 7 am (sleep_start: 22, sleep_end: 7). The window correctly wraps midnight. Setting either value to -1 disables the feature.

Changes

  • config.json: added led.sleep_start: 22 and led.sleep_end: 7
  • include/config.h: added ledSleepStart and ledSleepEnd fields
  • src/config.cpp: parse and validate the new fields; warn and disable if out of range
  • include/ring.h: added setSleepHours(int, int) method
  • src/ring.cpp: blank ring and return early when current local hour is inside the sleep window
  • src/main.cpp: call setSleepHours() at startup; log whether sleep hours are active

Test plan

  • Set sleep window to bracket the current hour and confirm the ring stays off
  • Confirm the ring resumes normal behavior once the hour moves outside the window
  • Test a midnight-wrapping window (e.g. sleep_start: 23, sleep_end: 1)
  • Set either value to -1 and confirm the feature is disabled

Adds led.sleep_start and led.sleep_end (0-23 local hour) to config.json
and the led block. When the current local time falls within the window
the ring is blanked entirely so it won't disturb sleep. The window wraps
midnight (e.g. sleep_start=22, sleep_end=7 covers 10 pm - 7 am).
Set either value to -1 to disable the feature.

Closes #102

https://claude.ai/code/session_0166Zd59EUgWgYd3FrphQAio
@GageLawton GageLawton merged commit c1fc80d into main May 27, 2026
2 checks passed
@GageLawton GageLawton deleted the claude/sleepy-feynman-SIYML branch May 27, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sleep hours

2 participants