mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-09 12:16:15 +00:00
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>
105 lines
3.3 KiB
Go
105 lines
3.3 KiB
Go
// Package soundtouch provides a comprehensive Go library, CLI tool, and local service for controlling and emulating Bose SoundTouch devices.
|
|
//
|
|
// This project implements the complete Bose SoundTouch Web API, enabling programmatic control
|
|
// of SoundTouch speakers including playback control, volume management, source selection,
|
|
// multiroom zone management, and real-time event monitoring.
|
|
//
|
|
// It also provides a local service (`soundtouch-service`) that can emulate the Bose Cloud,
|
|
// allowing for offline control and enhanced debugging through HTTP interaction recording.
|
|
//
|
|
// # Quick Start
|
|
//
|
|
// Install the library:
|
|
//
|
|
// go get github.com/gesellix/bose-soundtouch
|
|
//
|
|
// Basic usage example:
|
|
//
|
|
// package main
|
|
//
|
|
// import (
|
|
// "fmt"
|
|
// "log"
|
|
//
|
|
// "github.com/gesellix/bose-soundtouch/pkg/client"
|
|
// )
|
|
//
|
|
// func main() {
|
|
// // Create a client for your SoundTouch device
|
|
// config := &client.Config{
|
|
// Host: "192.0.2.100",
|
|
// Port: 8090,
|
|
// }
|
|
// client := client.NewClient(config)
|
|
//
|
|
// // Get device information
|
|
// info, err := client.GetInfo()
|
|
// if err != nil {
|
|
// log.Fatal(err)
|
|
// }
|
|
// fmt.Printf("Device: %s\n", info.Name)
|
|
//
|
|
// // Control playback
|
|
// err = client.Play()
|
|
// if err != nil {
|
|
// log.Fatal(err)
|
|
// }
|
|
// }
|
|
//
|
|
// # SoundTouch Service
|
|
//
|
|
// The `soundtouch-service` provides several advanced features:
|
|
//
|
|
// - Bose Cloud Emulation: Allows speakers to work without an internet connection.
|
|
// - HTTP Interaction Recording: Captures all traffic as IntelliJ-compatible .http files.
|
|
// - Speaker Migration: Automated tools to redirect speakers to the local service.
|
|
// - Web Interface: A management dashboard for proxy settings and speaker setup.
|
|
//
|
|
// Install the service:
|
|
//
|
|
// go install github.com/gesellix/bose-soundtouch/cmd/soundtouch-service@latest
|
|
//
|
|
// # CLI Tool
|
|
//
|
|
// The package includes a comprehensive CLI tool for device control:
|
|
//
|
|
// # Install the CLI
|
|
// go install github.com/gesellix/bose-soundtouch/cmd/soundtouch-cli@latest
|
|
//
|
|
// # Discover devices
|
|
// soundtouch-cli discover devices
|
|
//
|
|
// # Control a device
|
|
// soundtouch-cli --host 192.0.2.100 play start
|
|
//
|
|
// # Supported Features
|
|
//
|
|
// - ✅ Device Information & Capabilities
|
|
// - ✅ Playback, Volume, Bass, and Balance Control
|
|
// - ✅ Source Selection & Preset Management
|
|
// - ✅ Real-time WebSocket Events
|
|
// - ✅ Multiroom Zone Management
|
|
// - ✅ Device Discovery (UPnP/SSDP and mDNS)
|
|
// - ✅ Local Cloud Emulation (soundtouch-service)
|
|
// - ✅ HTTP Traffic Recording & Sanitization
|
|
// - ✅ Automated Speaker Migration & Revert
|
|
//
|
|
// # Package Structure
|
|
//
|
|
// - client: HTTP client for SoundTouch Web API
|
|
// - discovery: Device discovery using UPnP/SSDP and mDNS
|
|
// - models: Data structures for API requests/responses
|
|
// - service: Core logic for the soundtouch-service (proxy, recording, setup)
|
|
// - cmd/soundtouch-cli: Command-line interface tool
|
|
// - cmd/soundtouch-service: Local cloud emulation service
|
|
//
|
|
// # Implementation Notes
|
|
//
|
|
// This project is an independent effort to preserve the functionality of Bose SoundTouch
|
|
// devices and provide enhanced debugging and control capabilities. It is not
|
|
// affiliated with or endorsed by Bose Corporation.
|
|
//
|
|
// For detailed API documentation, examples, and advanced usage patterns, visit:
|
|
// https://pkg.go.dev/github.com/gesellix/bose-soundtouch
|
|
package soundtouch
|