Skip to content

Add mDNS autodiscovery, presets, and multi-light support#10

Open
marzagao wants to merge 10 commits into
jldeen:mainfrom
marzagao:main
Open

Add mDNS autodiscovery, presets, and multi-light support#10
marzagao wants to merge 10 commits into
jldeen:mainfrom
marzagao:main

Conversation

@marzagao
Copy link
Copy Markdown

Summary

  • mDNS autodiscovery: --discover / -d flag auto-finds all Elgato Keylights on the local network, removing the need to manually specify --elgato-ip
  • Brightness presets: --brightness low/medium/high and percentage support with validation (--brightness 50%)
  • Temperature presets: --temperature warm/medium/cool alongside numeric values
  • Multi-light support: Commands target all discovered lights with per-light error resilience
  • Settings preservation: Plain on/off no longer overwrite brightness and temperature
  • Status improvements: Shows device names, brightness as percentage, temperature in Kelvin
  • Configurable discovery timeout: --timeout flag (default 10s)
  • Simplified daemon setup: onair.sh and plist updated to use autodiscovery
  • Scheduling docs: Added cron examples for weekday light scheduling
  • Bump to v0.3.0, Rust edition 2024, removed redundant --number-of-lights flag

Test plan

  • keylight status --discover finds lights and shows settings
  • keylight on --discover --brightness 50 --temperature warm sets values
  • keylight off --discover / keylight on --discover preserves settings
  • keylight on -i <ip> still works (backwards compatible)
  • keylight --help shows updated flags

🤖 Generated with Claude Code

marzagao and others added 10 commits March 30, 2026 23:20
Adds --discover/-d flag to automatically find Elgato Keylights on the
local network via mDNS (service type _elg._tcp.local.) using the mdns-sd
crate. The status command now uses GET instead of PUT to read current
settings (power, brightness, temperature) without modifying them.
Commands are sent to all discovered lights. Manual --elgato-ip usage
remains fully backwards compatible.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… bump to v0.3.0

- Brightness accepts presets (low, medium, high) and % suffix with 0-100 validation
- Temperature accepts presets (warm, medium, cool) alongside numeric values
- Bump version to 0.3.0 and Rust edition to 2024
- Add Thompson Marzagao as second author
- Mark all README TODO items as complete

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add error resilience: skip unreachable lights and continue to the rest
- Add --timeout flag for configurable discovery timeout (default 5s)
- Show device names alongside IPs in status output
- Display temperature in human-readable Kelvin (~3257K)
- Remove redundant --number-of-lights flag (hardcode to 1 per request)
- Strip mDNS suffix from discovered light names for cleaner output

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Don't break out of the recv loop on first timeout error — let the outer
loop run for the full duration. Increase default discovery timeout from
5s to 10s for more reliable multi-light discovery.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Only send brightness and temperature in the PUT body when explicitly
provided by the user. Plain on/off commands now only toggle power
without overwriting the light's current brightness and temperature.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update onair.sh to use --discover flag instead of requiring IP env vars.
Remove elgato_ip and number_of_lights from the plist. Simplify README
daemon setup instructions by removing the IP address configuration step.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add cron examples for weekday light scheduling. Update build
instructions to use --release flag and cp instead of mv.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use 1-second polling intervals instead of blocking for the full timeout
duration. After finding at least one light, wait a 5-second grace period
for additional lights before stopping. This reliably finds all lights
on the network while keeping response times reasonable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant