Skip to content

Commit 6bfbdbc

Browse files
committed
final cleanup of implementation; completing basic documentation of new feature
final cleanup of implementation; completing basic documentation of new feature
1 parent b48f95c commit 6bfbdbc

2 files changed

Lines changed: 37 additions & 14 deletions

File tree

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,3 +344,39 @@ $ go-chromecast tts '<speak>Hello<break time="500ms"/>world.</speak>' \
344344
--google-service-account=/path/to/service/account.json \
345345
--ssml
346346
```
347+
348+
### Enhanced Device Discovery (Experimental)
349+
350+
**Broad Search** - For complex network topologies with multiple subnets or VLANs, the `--broad-search` flag enables comprehensive device discovery that combines mDNS discovery with targeted port scanning across detected network interfaces.
351+
352+
```bash
353+
# Use broad search to find devices across multiple subnets
354+
$ go-chromecast ls --broad-search
355+
356+
# Works with all commands that connect to devices
357+
$ go-chromecast status --broad-search
358+
$ go-chromecast load media.mp4 --broad-search
359+
$ go-chromecast ui --broad-search
360+
```
361+
362+
**Multi-Subnet Scanning** - The `scan` command supports scanning specific subnets or auto-detecting all available subnets:
363+
364+
```bash
365+
# Scan specific subnets
366+
$ go-chromecast scan --subnets 192.168.4.0/24,192.168.3.0/24
367+
368+
# Scan all detected subnets
369+
$ go-chromecast scan --subnets *
370+
371+
# Traditional single subnet scan (default behavior)
372+
$ go-chromecast scan --cidr 192.168.1.0/24
373+
```
374+
375+
**When to use:**
376+
- Multiple VLANs or subnets in your network
377+
- Chromecast devices not appearing in device list
378+
- Network setups with WiFi isolation or complex routing
379+
- Corporate networks with segmented subnets
380+
- Chromecast Audio groups on different ports
381+
382+
**Note:** Broad search is slower than standard discovery as it performs more comprehensive network scanning. The enhanced discovery automatically detects your network topology and finds devices that standard mDNS discovery might miss, including Chromecast groups on non-standard ports.

cmd/ui.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ package cmd
1616

1717
import (
1818
"github.com/spf13/cobra"
19-
"github.com/vishen/go-chromecast/application"
2019
"github.com/vishen/go-chromecast/ui"
2120
)
2221

@@ -25,19 +24,7 @@ var uiCmd = &cobra.Command{
2524
Use: "ui",
2625
Short: "Run the UI",
2726
Run: func(cmd *cobra.Command, args []string) {
28-
broadSearch, _ := cmd.Flags().GetBool("broad-search")
29-
30-
var app application.App
31-
var err error
32-
33-
if broadSearch {
34-
// Use broad search for device discovery
35-
app, err = castApplicationWithBroadSearch(cmd, args)
36-
} else {
37-
// Use standard device discovery
38-
app, err = castApplication(cmd, args)
39-
}
40-
27+
app, err := castApplication(cmd, args)
4128
if err != nil {
4229
exit("unable to get cast application: %v", err)
4330
return

0 commit comments

Comments
 (0)