Skip to content

brycesub/d.light

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

d.light

A Raspberry Pi wake-up light alarm clock with a web interface.

Gradually brightens a multi-LED light over a configurable period before the alarm time. Controllable from any browser on the local network.

Requirements

  • Python 3.10+
  • Raspberry Pi with GPIO-connected LEDs (or runs in mock mode on any machine)

Install

# Standard install
pip install -e .

# With Raspberry Pi GPIO support
pip install -e ".[pi]"

# With dev tools
pip install -e ".[dev]"

Run

d-light

The web UI is available at http://<host>:8080/.

API

All endpoints return the current state as JSON.

Endpoint Effect
GET /stat Return current state
GET /light/on Turn light on (100%)
GET /light/off Turn light off
GET /dim/<0-100> Set brightness
GET /alarm/on Enable alarm
GET /alarm/off Disable alarm
GET /alarmset/<HH:MM> Set alarm time
GET /snoozeset/<minutes> Set snooze duration
GET /brightenset/<minutes> Set brightening duration
GET /snooze Snooze active alarm
GET /alarmoff Cancel active alarm

Development

pytest          # run tests (70% coverage required)
ruff check .    # lint
ruff format .   # format
mypy .          # type check

About

A Raspberry Pi Wakeup Light Alarm clock with Web Interface

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors