chore: sweep example LAN IPs to RFC-5737 in source and config files

Completes the docs-tier RFC-5737 rollout by sweeping the remaining
192.168.1.x references that lived outside .md / .txt / test files:

  - .env.example                                — active PREFERRED_DEVICES default + examples
  - .github/ISSUE_TEMPLATE/*.yml + workflows    — issue template + CI examples
  - cmd/websocket-demo/main.go, doc.go          — top-level docs
  - examples/*/main.go (7 files)                — example program comments
  - pkg/client/client.go                        — godoc examples
  - pkg/models/doc.go                           — package godoc
  - pkg/service/{amazon,spotify,zeroconf}/zeroconf.go — godoc comments
  - pkg/service/handlers/web/index.html         — placeholder text in the UI
  - scripts/prepare-release.sh                  — example invocations
  - scripts/spotify/spotify-prime-speaker.sh    — usage comment
  - tests/integration/http-client/http-client.env.json — fixture IPs

Same mapping as the docs commit (136d24a): 192.168.1.X → 192.0.2.X
preserving the last octet.

One semantic carve-out: the three zeroconf `zcBaseURL` godoc comments
in pkg/service/{amazon,spotify,zeroconf}/zeroconf.go switched to
192.168.10.10 instead of the doc range, because validateZcBaseURL
only accepts RFC-1918 / loopback / link-local. The comment must show
a value the validator actually accepts — see the matching test fix
in 92f66a2 for the same reason.

go build ./... clean. go test ./... clean except the pre-existing
TestDocsConsistency (untracked DEVICE-LOCAL-INSTALL.md, unrelated).
golangci-lint run ./... — 0 issues after a gofmt fix on
examples/zone-slave-operations/main.go.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tobias Gesellchen
2026-05-17 22:05:13 +02:00
co-authored by Claude Opus 4.7
parent feadc478d5
commit 702092d772
23 changed files with 49 additions and 49 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ import (
func main() {
// Configure the SoundTouch client
config := &client.Config{
Host: "192.168.1.100", // Replace with your device IP
Host: "192.0.2.100", // Replace with your device IP
Port: 8090,
Timeout: 10 * time.Second,
}
+1 -1
View File
@@ -11,7 +11,7 @@ import (
func main() {
// Configure your device
deviceIP := "192.168.1.100" // Replace with your SoundTouch device IP
deviceIP := "192.0.2.100" // Replace with your SoundTouch device IP
// Create client
soundtouchClient := client.NewClientFromHost(deviceIP)
+2 -2
View File
@@ -163,7 +163,7 @@ func demoLocalMusic(c *client.Client) error {
location := "album:983"
sourceAccount := "3f205110-4a57-4e91-810a-123456789012" // Example GUID
itemName := "Welcome to the New"
containerArt := "http://192.168.1.14:8085/v1/albums/983/image"
containerArt := "http://192.0.2.14:8085/v1/albums/983/image"
fmt.Printf(" Album: %s\n", itemName)
fmt.Printf(" Location: %s\n", location)
@@ -276,7 +276,7 @@ func printUsage() {
fmt.Printf(" %s <device_ip>\n", os.Args[0])
fmt.Println()
fmt.Println("Example:")
fmt.Printf(" %s 192.168.1.100\n", os.Args[0])
fmt.Printf(" %s 192.0.2.100\n", os.Args[0])
fmt.Println()
fmt.Println("Prerequisites:")
fmt.Println("• SoundTouch device on your network")
+4 -4
View File
@@ -239,7 +239,7 @@ func printUsage() {
fmt.Printf(" %s <device_ip>\n", os.Args[0])
fmt.Println()
fmt.Println("Example:")
fmt.Printf(" %s 192.168.1.100\n", os.Args[0])
fmt.Printf(" %s 192.0.2.100\n", os.Args[0])
fmt.Println()
fmt.Println("Prerequisites:")
fmt.Println("• SoundTouch device on your network")
@@ -247,7 +247,7 @@ func printUsage() {
fmt.Println("• Device powered on and connected")
fmt.Println()
fmt.Println("CLI Equivalent Commands:")
fmt.Println("• Browse: soundtouch-cli --host 192.168.1.100 browse tunein")
fmt.Println("• Search: soundtouch-cli --host 192.168.1.100 station search-tunein --query jazz")
fmt.Println("• Add: soundtouch-cli --host 192.168.1.100 station add --source TUNEIN --token <token> --name <name>")
fmt.Println("• Browse: soundtouch-cli --host 192.0.2.100 browse tunein")
fmt.Println("• Search: soundtouch-cli --host 192.0.2.100 station search-tunein --query jazz")
fmt.Println("• Add: soundtouch-cli --host 192.0.2.100 station add --source TUNEIN --token <token> --name <name>")
}
+1 -1
View File
@@ -378,7 +378,7 @@ func printUsage() {
fmt.Printf(" %s <device_ip>\n", os.Args[0])
fmt.Println()
fmt.Println("Example:")
fmt.Printf(" %s 192.168.1.100\n", os.Args[0])
fmt.Printf(" %s 192.0.2.100\n", os.Args[0])
fmt.Println()
fmt.Println("Prerequisites:")
fmt.Println("• SoundTouch device on your network")
+1 -1
View File
@@ -16,7 +16,7 @@ func main() {
host := getSoundTouchHost()
if host == "" {
fmt.Println("Usage: go run main.go <soundtouch-host>")
fmt.Println(" or: SOUNDTOUCH_TEST_HOST=192.168.1.100 go run main.go")
fmt.Println(" or: SOUNDTOUCH_TEST_HOST=192.0.2.100 go run main.go")
os.Exit(1)
}
+3 -3
View File
@@ -11,7 +11,7 @@ import (
func main() {
// Configure your device
deviceIP := "192.168.1.100" // Replace with your SoundTouch device IP
deviceIP := "192.0.2.100" // Replace with your SoundTouch device IP
// Create client
soundtouchClient := client.NewClientFromHost(deviceIP)
@@ -24,7 +24,7 @@ func main() {
masterDeviceID := "ABCD1234EFGH" // Replace with actual master device ID
slaveDeviceID := "WXYZ5678IJKL" // Replace with actual slave device ID
slaveIP := "192.168.1.101" // Replace with actual slave IP
slaveIP := "192.0.2.101" // Replace with actual slave IP
err := soundtouchClient.AddZoneSlave(masterDeviceID, slaveDeviceID, slaveIP)
if err != nil {
@@ -117,7 +117,7 @@ func main() {
fmt.Println("\n8. Error handling example...")
// Try to add a non-existent device to demonstrate error handling
err = soundtouchClient.AddZoneSlave("INVALID123", "NOTFOUND456", "192.168.1.999")
err = soundtouchClient.AddZoneSlave("INVALID123", "NOTFOUND456", "192.0.2.999")
if err != nil {
fmt.Printf("⚠️ Expected error for invalid operation: %v\n", err)
fmt.Println(" This demonstrates proper error handling for invalid device IDs or IPs")