mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-18 08:36:13 +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>
22 lines
943 B
Go
22 lines
943 B
Go
package spotify
|
|
|
|
import "github.com/gesellix/bose-soundtouch/pkg/service/zeroconf"
|
|
|
|
// ErrAddUserNoOp re-exports zeroconf.ErrAddUserNoOp so callers in the spotify
|
|
// package don't need a direct dependency on the zeroconf package to recognise
|
|
// the benign-no-op sentinel.
|
|
var ErrAddUserNoOp = zeroconf.ErrAddUserNoOp
|
|
|
|
// ZeroConfGetInfo fetches the speaker's DH public key via GET ?action=getInfo.
|
|
func ZeroConfGetInfo(zcBaseURL string) ([]byte, error) {
|
|
return zeroconf.GetInfo(zcBaseURL)
|
|
}
|
|
|
|
// PushSpotifyCredentials pushes Spotify credentials to a speaker using the full
|
|
// ZeroConf DH key exchange protocol. Falls back to simplified token push if
|
|
// the speaker does not support DH (older firmware).
|
|
// zcBaseURL is the base URL of the ZeroConf endpoint, e.g. "http://192.168.10.10:8200/zc".
|
|
func PushSpotifyCredentials(zcBaseURL, username, accessToken string) error {
|
|
return zeroconf.PushCredentials(zcBaseURL, username, accessToken)
|
|
}
|