Skip to content

feat: Enhance LacyLights.app launcher with intelligent network interface selection#7

Merged
bbernstein merged 3 commits intomainfrom
feat/enhanced-app-launcher-interface-selection
Sep 12, 2025
Merged

feat: Enhance LacyLights.app launcher with intelligent network interface selection#7
bbernstein merged 3 commits intomainfrom
feat/enhanced-app-launcher-interface-selection

Conversation

@bbernstein
Copy link
Copy Markdown
Owner

Summary

Enhanced the LacyLights.app launcher with comprehensive network interface selection capabilities, providing a user-friendly GUI experience that matches the intelligent interface detection added to lacylights-node.

Key Features

🎯 Intelligent Interface Detection

  • Type Detection: Uses networksetup -listallhardwareports to identify interface types
  • Visual Indicators: Emoji icons for different interface types:
    • 🌐 Ethernet - Built-in wired connections
    • 🔌 USB Ethernet - USB-to-Ethernet adapters
    • 📶 WiFi - Wireless connections
    • Thunderbolt - Thunderbolt bridge connections
    • 🔗 Bridge - Network bridges

📊 Smart Sorting & Defaults

  • Reliability-Based Sorting: Orders interfaces by connection reliability
    1. Ethernet interfaces (most reliable for DMX)
    2. WiFi interfaces (good backup option)
    3. Other interface types
    4. Localhost (testing only)
    5. Global Broadcast (universal fallback)
  • Smart Default: Automatically selects first option (typically most reliable interface)

🎭 Broadcast-Only Options

  • Art-Net Optimized: Shows only broadcast addresses suitable for DMX transmission
  • No Unicast Confusion: Removes individual IP addresses that aren't appropriate for Art-Net
  • Clear Descriptions: Each option shows interface type, connection method, and broadcast address

🔄 Seamless Integration

  • Environment Variable Passing: Selected interface passed to start.sh via ARTNET_BROADCAST
  • Consistent Experience: Matches the enhanced interface selection in lacylights-node
  • User-Friendly Flow: Integrated naturally into existing app launch process

Interface Selection Example

Available Network Interface Options:
============================================================
[1] 🔌 en21 - USB Ethernet Broadcast (192.168.7.255)  ← DEFAULT
[2] 📶 en0 - WiFi Broadcast (192.168.7.255)
[3] 🏠 Localhost (for testing only)
[4] 🌍 Global Broadcast (255.255.255.255)
============================================================

📡 Select Art-Net broadcast destination:
   (This determines where DMX data will be sent)
   Press Enter for default (first option)

Select option [1-4] (default: 1): ⏎

✅ Selected: 🔌 en21 - USB Ethernet Broadcast (192.168.7.255)
   Broadcasting to: 192.168.7.255

Benefits

🎯 Better User Experience

  • Visual Clarity: Immediate identification of interface types
  • Informed Decisions: Users can choose the most appropriate connection
  • Reduced Confusion: Clear distinction between different interface types

🚀 Improved Reliability

  • Prioritizes Wired Connections: Default selection favors more stable connections
  • DMX-Appropriate Options: Only shows broadcast addresses suitable for lighting control
  • Intelligent Fallbacks: Graceful handling of edge cases and invalid selections

🔄 Consistent Experience

  • Matches Command Line: Same logic and sorting as lacylights-node interface selector
  • Unified Approach: Consistent behavior across all LacyLights launch methods
  • Professional Polish: Enhanced GUI experience for app-based launches

Technical Implementation

Interface Detection Logic

get_interface_type() {
    hardware_info=$(networksetup -listallhardwareports | grep -B2 "Device: $iface")
    
    if echo "$hardware_info" | grep -qi "wi-fi\|wifi\|wireless"; then
        echo "WiFi"
    elif echo "$hardware_info" | grep -qi "usb.*ethernet"; then
        echo "USB Ethernet"
    elif echo "$hardware_info" | grep -qi "thunderbolt"; then
        echo "Thunderbolt"
    # ... additional detection logic
}

Broadcast Address Integration

# Pass selected interface to start.sh
ARTNET_BROADCAST="$ARTNET_BROADCAST" ./start.sh --with-mcp

Test Plan

  • Verify interface type detection works across different hardware configurations
  • Confirm sorting prioritizes Ethernet → WiFi → Localhost → Global Broadcast
  • Test default selection chooses first (most reliable) option
  • Validate broadcast address extraction and validation
  • Ensure seamless integration with existing launcher flow
  • Verify environment variable passing to start.sh works correctly

Related Changes

This PR complements the enhanced interface selection added to lacylights-node in PR #18, providing a consistent experience across both GUI app launches and direct command-line usage.

🤖 Generated with Claude Code

…ace selection

- Add comprehensive network interface type detection using networksetup
- Remove unicast options, show only broadcast addresses suitable for Art-Net DMX
- Sort interfaces by reliability: Ethernet first, WiFi second, localhost, global broadcast
- Add visual indicators with emoji icons (🌐 Ethernet, 📶 WiFi, 🔌 USB Ethernet, ⚡ Thunderbolt, 🔗 Bridge)
- Change default selection from global broadcast to first option (prioritizes Ethernet)
- Integrate interface selection directly into LacyLights.app launcher flow
- Pass selected broadcast address to start.sh via ARTNET_BROADCAST environment variable

This provides a user-friendly GUI experience for network interface selection
while maintaining the same intelligent sorting and type detection as the
command-line lacylights-node interface selector.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 12, 2025 17:28
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the LacyLights.app launcher with intelligent network interface selection capabilities. It adds comprehensive network interface detection and a user-friendly GUI for selecting the appropriate broadcast interface for Art-Net DMX transmission.

  • Adds intelligent network interface type detection using macOS networksetup command
  • Implements smart sorting that prioritizes reliable connections (Ethernet → WiFi → Others → Localhost → Global)
  • Integrates selected interface into the existing launcher workflow via environment variables

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread LacyLights.app/Contents/MacOS/LacyLights Outdated
Comment thread LacyLights.app/Contents/MacOS/LacyLights Outdated
bbernstein and others added 2 commits September 12, 2025 13:35
- Fix redundant address display format by only showing "Address: X -> Y" when values differ
- Remove redundant conditional logic in interface type detection for en[1-9]* pattern
- Simplify code logic while maintaining the same functionality

Addresses all feedback from Copilot PR review comments for cleaner, more maintainable code.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…node

- Add local_ips arrays to track local interface IP addresses alongside broadcast addresses
- Update display format to show "Address: local_ip -> broadcast_ip" for network interfaces
- Maintain consistency with lacylights-node interface selection display format
- Keep broadcast addresses as the selected value for ARTNET_BROADCAST environment variable

Now both launchers show the same format:
[1] 🔌 en21 - USB Ethernet Broadcast (192.168.7.255)
    Address: 192.168.7.111 -> 192.168.7.255

This provides better clarity about which local interface is being used while
showing the destination broadcast address for Art-Net transmission.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bbernstein bbernstein merged commit 4634b31 into main Sep 12, 2025
@bbernstein bbernstein deleted the feat/enhanced-app-launcher-interface-selection branch September 12, 2025 17:59
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.

2 participants