Add homeycli-inspired features, connection modes, and mDNS discovery#8
Add homeycli-inspired features, connection modes, and mDNS discovery#8
Conversation
- Add devices on/off shorthand commands - Add devices values command for all capability values - Add snapshot command for system overview - Add --match filter for devices list and flows list - Update homeyctl ai documentation
- Add Mode field (auto/local/cloud) to config - Add LocalConfig and CloudConfig for separate credentials - Add config commands: set-mode, set-local, set-cloud - Update config show to display mode and connection info - Maintain backwards compatibility with legacy host/port/token - Add comprehensive tests for EffectiveMode and EffectiveToken
- Replace hashicorp/mdns with raw mDNS using miekg/dns (hashicorp/mdns doesn't work properly on macOS) - Add discovery package with proper mDNS multicast queries - Parse TXT records for Homey metadata (id, name, model, version) - Add unit tests for mDNS response parsing - Update AI context documentation: - Add discovery output example - Add token management commands - Add utility commands section - Fix overview to mention both local and cloud API
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis PR introduces local network discovery via mDNS, connection mode support (local/cloud/auto), enhanced device and flow filtering, token management with masking, new configuration subcommands, and a system snapshot feature to the Homey CLI. Changes
Sequence DiagramssequenceDiagram
participant CLI as CLI Command
participant Resolver as mDNS Resolver
participant Network as Network
participant API as HTTP API
participant Header as Response Header
CLI->>Resolver: DiscoverAndVerify(ctx, timeout)
Resolver->>Network: Query _homey._tcp.local & _athom._tcp.local
Network-->>Resolver: DNS responses (PTR, SRV, TXT, A/AAAA)
Resolver->>Resolver: Parse candidates & deduplicate
loop For each candidate
Resolver->>API: VerifyHomey(address, 2s timeout)
API->>API: GET /api/manager/system/ping
API-->>Header: X-Homey-ID header
Header-->>Resolver: HomeyID & success status
Resolver->>Resolver: Update candidate if verified
end
Resolver-->>CLI: []HomeyCandidate (verified)
sequenceDiagram
participant CLI as CLI Command
participant API1 as API: GetSystem
participant API2 as API: GetZones
participant API3 as API: GetDevices
participant API4 as API: GetFlows (optional)
participant JSON as JSON Parser
participant Output as Output Formatter
CLI->>API1: GetSystem()
API1-->>JSON: System data
JSON->>JSON: Parse & store
CLI->>API2: GetZones()
API2-->>JSON: Zones data
JSON->>JSON: Parse & store
CLI->>API3: GetDevices()
API3-->>JSON: Devices data
JSON->>JSON: Parse & store
alt include-flows flag set
CLI->>API4: GetFlows()
API4-->>JSON: Flows data
JSON->>JSON: Parse & add to snapshot
end
JSON->>Output: Unified snapshot object
Output-->>CLI: Table or JSON output
Estimated Code Review Effort🎯 4 (Complex) | ⏱️ ~50 minutes
✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (12)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Major feature release adding homeycli-inspired commands, flexible connection modes, and automatic device discovery.
New Features
Device Shortcuts
Snapshot Command
Filter Support
Connection Modes
mDNS Discovery
Improved AI Documentation
Technical Notes
hashicorp/mdnswith raw mDNS usingmiekg/dns(macOS compatibility)Test plan
make test- all tests passmake lint- no issuesSummary by CodeRabbit
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.