sonos

package module
Version: v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2020 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	XMLName                 xml.Name  `xml:"device"`
	DeviceType              string    `xml:"deviceType"`
	FriendlyName            string    `xml:"friendlyName"`
	Manufacturer            string    `xml:"manufacturer"`
	ManufacturerURL         string    `xml:"manufacturerURL"`
	ModelNumber             string    `xml:"modelNumber"`
	ModelDescription        string    `xml:"modelDescription"`
	ModelName               string    `xml:"modelName"`
	ModelURL                string    `xml:"modelURL"`
	SoftwareVersion         string    `xml:"softwareVersion"`
	SwGen                   string    `xml:"swGen"`
	HardwareVersion         string    `xml:"hardwareVersion"`
	SerialNum               string    `xml:"serialNum"`
	MACAddress              string    `xml:"MACAddress"`
	UDN                     string    `xml:"UDN"`
	Icons                   []Icon    `xml:"iconList>icon"`
	MinCompatibleVersion    string    `xml:"minCompatibleVersion"`
	LegacyCompatibleVersion string    `xml:"legacyCompatibleVersion"`
	ApiVersion              string    `xml:"apiVersion"`
	MinApiVersion           string    `xml:"minApiVersion"`
	DisplayVersion          string    `xml:"displayVersion"`
	ExtraVersion            string    `xml:"extraVersion"`
	RoomName                string    `xml:"roomName"`
	DisplayName             string    `xml:"displayName"`
	ZoneType                int       `xml:"zoneType"`
	Feature1                string    `xml:"feature1"`
	Feature2                string    `xml:"feature2"`
	Feature3                string    `xml:"feature3"`
	Seriesid                string    `xml:"seriesid"`
	Variant                 int       `xml:"variant"`
	InternalSpeakerSize     float32   `xml:"internalSpeakerSize"`
	BassExtension           float32   `xml:"bassExtension"`
	SatGainOffset           float32   `xml:"satGainOffset"`
	Memory                  int       `xml:"memory"`
	Flash                   int       `xml:"flash"`
	FlashRepartitioned      int       `xml:"flashRepartitioned"`
	AmpOnTime               int       `xml:"ampOnTime"`
	RetailMode              int       `xml:"retailMode"`
	Services                []Service `xml:"serviceList>service"`
	Devices                 []Device  `xml:"deviceList>device"`
}

type Icon

type Icon struct {
	XMLName  xml.Name `xml:"icon"`
	Id       string   `xml:"id"`
	Mimetype string   `xml:"mimetype"`
	Width    int      `xml:"width"`
	Height   int      `xml:"height"`
	Depth    int      `xml:"depth"`
	Url      url.URL  `xml:"url"`
}

type Root

type Root struct {
	XMLName     xml.Name    `xml:"root"`
	Xmlns       string      `xml:"xmlns,attr"`
	SpecVersion SpecVersion `xml:"specVersion"`
	Device      Device      `xml:"device"`
}

type Satellite

type Satellite struct {
	XMLName                 xml.Name `xml:"Satellite"`
	UUID                    string   `xml:"UUID"`
	Location                string   `xml:"Location"`
	ZoneName                string   `xml:"ZoneName"`
	Icon                    string   `xml:"Icon"`
	Configuration           string   `xml:"Configuration"`
	SoftwareVersion         string   `xml:"SoftwareVersion"`
	SWGen                   string   `xml:"SWGen"`
	MinCompatibleVersion    string   `xml:"MinCompatibleVersion"`
	LegacyCompatibleVersion string   `xml:"LegacyCompatibleVersion"`
	BootSeq                 string   `xml:"BootSeq"`
	TVConfigurationError    string   `xml:"TVConfigurationError"`
	HdmiCecAvailable        string   `xml:"HdmiCecAvailable"`
	WirelessMode            string   `xml:"WirelessMode"`
	WirelessLeafOnly        string   `xml:"WirelessLeafOnly"`
	HasConfiguredSSID       string   `xml:"HasConfiguredSSID"`
	ChannelFreq             string   `xml:"ChannelFreq"`
	BehindWifiExtender      string   `xml:"BehindWifiExtender"`
	WifiEnabled             string   `xml:"WifiEnabled"`
	Orientation             string   `xml:"Orientation"`
	RoomCalibrationState    string   `xml:"RoomCalibrationState"`
	SecureRegState          string   `xml:"SecureRegState"`
	VoiceConfigState        string   `xml:"VoiceConfigState"`
	MicEnabled              string   `xml:"MicEnabled"`
	AirPlayEnabled          string   `xml:"AirPlayEnabled"`
	IdleState               string   `xml:"IdleState"`
	MoreInfo                string   `xml:"MoreInfo"`
}

type Service

type Service struct {
	XMLName     xml.Name `xml:"service"`
	ServiceType string   `xml:"serviceType"`
	ServiceId   string   `xml:"serviceId"`
	ControlURL  string   `xml:"controlURL"`
	EventSubURL string   `xml:"eventSubURL"`
	SCPDURL     string   `xml:"SCPDURL"`
}

type Sonos

type Sonos struct {
	// contains filtered or unexported fields
}

func NewSonos

func NewSonos() (*Sonos, error)

func (*Sonos) Close

func (s *Sonos) Close()

func (*Sonos) Search

func (s *Sonos) Search() (chan *ZonePlayer, error)

type SpecVersion

type SpecVersion struct {
	XMLName xml.Name `xml:"specVersion"`
	Major   int      `xml:"major"`
	Minor   int      `xml:"minor"`
}

type VanishedDevice

type VanishedDevice struct {
	XMLName                 xml.Name `xml:"VanishedDevice"`
	UUID                    string   `xml:"UUID"`
	Location                string   `xml:"Location"`
	ZoneName                string   `xml:"ZoneName"`
	Icon                    string   `xml:"Icon"`
	Configuration           string   `xml:"Configuration"`
	SoftwareVersion         string   `xml:"SoftwareVersion"`
	SWGen                   string   `xml:"SWGen"`
	MinCompatibleVersion    string   `xml:"MinCompatibleVersion"`
	LegacyCompatibleVersion string   `xml:"LegacyCompatibleVersion"`
	BootSeq                 string   `xml:"BootSeq"`
	TVConfigurationError    string   `xml:"TVConfigurationError"`
	HdmiCecAvailable        string   `xml:"HdmiCecAvailable"`
	WirelessMode            string   `xml:"WirelessMode"`
	WirelessLeafOnly        string   `xml:"WirelessLeafOnly"`
	HasConfiguredSSID       string   `xml:"HasConfiguredSSID"`
	ChannelFreq             string   `xml:"ChannelFreq"`
	BehindWifiExtender      string   `xml:"BehindWifiExtender"`
	WifiEnabled             string   `xml:"WifiEnabled"`
	Orientation             string   `xml:"Orientation"`
	RoomCalibrationState    string   `xml:"RoomCalibrationState"`
	SecureRegState          string   `xml:"SecureRegState"`
	VoiceConfigState        string   `xml:"VoiceConfigState"`
	MicEnabled              string   `xml:"MicEnabled"`
	AirPlayEnabled          string   `xml:"AirPlayEnabled"`
	IdleState               string   `xml:"IdleState"`
	MoreInfo                string   `xml:"MoreInfo"`
}

type ZoneGroup

type ZoneGroup struct {
	XMLName         xml.Name          `xml:"ZoneGroup"`
	Coordinator     string            `xml:"Coordinator,attr"`
	ID              string            `xml:"ID,attr"`
	ZoneGroupMember []ZoneGroupMember `xml:"ZoneGroupMember"`
}

type ZoneGroupMember

type ZoneGroupMember struct {
	XMLName                 xml.Name         `xml:"ZoneGroupMember"`
	UUID                    string           `xml:"UUID"`
	Location                string           `xml:"Location"`
	ZoneName                string           `xml:"ZoneName"`
	Icon                    string           `xml:"Icon"`
	Configuration           string           `xml:"Configuration"`
	SoftwareVersion         string           `xml:"SoftwareVersion"`
	SWGen                   string           `xml:"SWGen"`
	MinCompatibleVersion    string           `xml:"MinCompatibleVersion"`
	LegacyCompatibleVersion string           `xml:"LegacyCompatibleVersion"`
	BootSeq                 string           `xml:"BootSeq"`
	TVConfigurationError    string           `xml:"TVConfigurationError"`
	HdmiCecAvailable        string           `xml:"HdmiCecAvailable"`
	WirelessMode            string           `xml:"WirelessMode"`
	WirelessLeafOnly        string           `xml:"WirelessLeafOnly"`
	HasConfiguredSSID       string           `xml:"HasConfiguredSSID"`
	ChannelFreq             string           `xml:"ChannelFreq"`
	BehindWifiExtender      string           `xml:"BehindWifiExtender"`
	WifiEnabled             string           `xml:"WifiEnabled"`
	Orientation             string           `xml:"Orientation"`
	RoomCalibrationState    string           `xml:"RoomCalibrationState"`
	SecureRegState          string           `xml:"SecureRegState"`
	VoiceConfigState        string           `xml:"VoiceConfigState"`
	MicEnabled              string           `xml:"MicEnabled"`
	AirPlayEnabled          string           `xml:"AirPlayEnabled"`
	IdleState               string           `xml:"IdleState"`
	MoreInfo                string           `xml:"MoreInfo"`
	Satellite               []Satellite      `xml:"Satellite>Satellite"`
	VanishedDevice          []VanishedDevice `xml:"VanishedDevices>VanishedDevice"`
}

type ZoneGroupState

type ZoneGroupState struct {
	XMLName    xml.Name    `xml:"ZoneGroupState"`
	ZoneGroups []ZoneGroup `xml:"ZoneGroups>ZoneGroup"`
}

type ZonePlayer

type ZonePlayer struct {
	Root                 *Root
	HttpClient           *http.Client
	DeviceDescriptionURL *url.URL
	// services
	AlarmClock            *clk.Service
	AVTransport           *avt.Service
	ConnectionManager     *con.Service
	ContentDirectory      *dir.Service
	DeviceProperties      *dev.Service
	GroupManagement       *gmn.Service
	GroupRenderingControl *rcg.Service
	MusicServices         *mus.Service
	QPlay                 *ply.Service
	Queue                 *que.Service
	RenderingControl      *ren.Service
	SystemProperties      *sys.Service
	VirtualLineIn         *vli.Service
	ZoneGroupTopology     *zgt.Service
}

func FindRoom

func FindRoom(room string, timeout time.Duration) (*ZonePlayer, error)

func NewZonePlayer

func NewZonePlayer(deviceDescriptionURL *url.URL) (*ZonePlayer, error)

func (*ZonePlayer) GetVolume

func (z *ZonePlayer) GetVolume() (int, error)

func (*ZonePlayer) GetZoneGroupState

func (z *ZonePlayer) GetZoneGroupState() (*ZoneGroupState, error)

func (*ZonePlayer) HardwareVersion

func (z *ZonePlayer) HardwareVersion() string

func (*ZonePlayer) IsCoordinator

func (z *ZonePlayer) IsCoordinator() bool

func (*ZonePlayer) ModelName

func (z *ZonePlayer) ModelName() string

func (*ZonePlayer) Play

func (z *ZonePlayer) Play() error

func (*ZonePlayer) RoomName

func (z *ZonePlayer) RoomName() string

func (*ZonePlayer) SerialNum

func (z *ZonePlayer) SerialNum() string

func (*ZonePlayer) SetAVTransportURI

func (z *ZonePlayer) SetAVTransportURI(url string) error

func (*ZonePlayer) SetVolume

func (z *ZonePlayer) SetVolume(desiredVolume int) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL