Add mDNS autodiscovery, presets, and multi-light support#10
Open
marzagao wants to merge 10 commits into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--discover/-dflag auto-finds all Elgato Keylights on the local network, removing the need to manually specify--elgato-ip--brightness low/medium/highand percentage support with validation (--brightness 50%)--temperature warm/medium/coolalongside numeric valueson/offno longer overwrite brightness and temperature--timeoutflag (default 10s)onair.shand plist updated to use autodiscovery--number-of-lightsflagTest plan
keylight status --discoverfinds lights and shows settingskeylight on --discover --brightness 50 --temperature warmsets valueskeylight off --discover/keylight on --discoverpreserves settingskeylight on -i <ip>still works (backwards compatible)keylight --helpshows updated flags🤖 Generated with Claude Code