mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-18 16:46:17 +00:00
Groups (stereo pairs of ST10 speakers) were read-only — the GET endpoint
always returned an empty <group/>. Add POST /account/{account}/group,
POST /account/{account}/group/{groupId}, and DELETE
/account/{account}/group/{groupId} with datastore persistence, matching
the API shape observed in soundcork. The GET endpoint now reads live
group state from the datastore.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
26 lines
771 B
Go
26 lines
771 B
Go
package models
|
|
|
|
import "encoding/xml"
|
|
|
|
// Group represents a stereo pair of two ST10 SoundTouch speakers.
|
|
type Group struct {
|
|
XMLName xml.Name `xml:"group"`
|
|
ID string `xml:"id,attr,omitempty"`
|
|
Name string `xml:"name"`
|
|
MasterDeviceID string `xml:"masterDeviceId"`
|
|
Roles GroupRoles `xml:"roles"`
|
|
SenderIPAddress string `xml:"senderIPAddress,omitempty"`
|
|
}
|
|
|
|
// GroupRoles contains the role assignments for devices in a group.
|
|
type GroupRoles struct {
|
|
Roles []GroupRole `xml:"groupRole"`
|
|
}
|
|
|
|
// GroupRole describes the role (LEFT or RIGHT) of a single device in a group.
|
|
type GroupRole struct {
|
|
DeviceID string `xml:"deviceId"`
|
|
Role string `xml:"role"`
|
|
IPAddress string `xml:"ipAddress,omitempty"`
|
|
}
|