\duncan3dc\SonosSpeaker

Represents an individual Sonos speaker, to allow volume, equalisation, and other settings to be managed.

Summary

Methods
Properties
Constants
__construct()
soap()
getIp()
getName()
getRoom()
getGroup()
updateGroup()
setGroup()
isCoordinator()
getUuid()
getVolume()
setVolume()
adjustVolume()
isMuted()
mute()
unmute()
setIndicator()
getIndicator()
getTreble()
setTreble()
getBass()
setBass()
getLoudness()
setLoudness()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
setEqLevel()
$ip
$device
$name
$room
$uuid
$group
N/A

Properties

$ip

$ip : string

Type

string — The IP address of the speaker.

$name

$name : string

Type

string — The "Friendly" name reported by the speaker.

$room

$room : string

Type

string — The room name assigned to this speaker.

$uuid

$uuid : string

Type

string — The unique id of this speaker.

$group

$group : string|null

Type

string|null — The group id this speaker is a part of.

Methods

__construct()

__construct(\duncan3dc\Sonos\Interfaces\Devices\DeviceInterface|string  $param) 

Create an instance of the Speaker class.

Parameters

\duncan3dc\Sonos\Interfaces\Devices\DeviceInterface|string $param

An Device instance or the ip address that the speaker is listening on

soap()

soap(\duncan3dc\Sonos\string  $service, \duncan3dc\Sonos\string  $action, array  $params = array()) 

Parameters

\duncan3dc\Sonos\string $service
\duncan3dc\Sonos\string $action
array $params

getIp()

getIp() : string

Get the IP address of this speaker.

Returns

string

getName()

getName() : string

Get the "Friendly" name of this speaker.

Returns

string

getRoom()

getRoom() : string

Get the room name of this speaker.

Returns

string

getGroup()

getGroup() : string

Get the uuid of the group this speaker is a member of.

Returns

string

updateGroup()

updateGroup() : void

Remove any previously established group for this speaker.

setGroup()

setGroup(\duncan3dc\Sonos\string  $group) : void

Set which group this speaker belongs to.

Parameters

\duncan3dc\Sonos\string $group

The group id

isCoordinator()

isCoordinator() : boolean

Check if this speaker is the coordinator of it's current group.

Returns

boolean

getUuid()

getUuid() : string

Get the uuid of this speaker.

Returns

string —

The uuid of this speaker

getVolume()

getVolume() : integer

Get the current volume of this speaker.

Returns

integer —

The current volume between 0 and 100

setVolume()

setVolume(integer  $volume) : $this

Adjust the volume of this speaker to a specific value.

Parameters

integer $volume

The amount to set the volume to between 0 and 100

Returns

$this

adjustVolume()

adjustVolume(integer  $adjust) : $this

Adjust the volume of this speaker by a relative amount.

Parameters

integer $adjust

The amount to adjust by between -100 and 100

Returns

$this

isMuted()

isMuted() : boolean

Check if this speaker is currently muted.

Returns

boolean

mute()

mute(boolean  $mute = true) : $this

Mute this speaker.

Parameters

boolean $mute

Whether the speaker should be muted or not

Returns

$this

unmute()

unmute() : $this

Unmute this speaker.

Returns

$this

setIndicator()

setIndicator(boolean  $on) : $this

Turn the indicator light on or off.

Parameters

boolean $on

Whether the indicator should be on or off

Returns

$this

getIndicator()

getIndicator() : boolean

Check whether the indicator light is on or not.

Returns

boolean

getTreble()

getTreble() : integer

Get the treble equalisation level.

Returns

integer

setTreble()

setTreble(integer  $treble) : $this

Set the treble equalisation.

Parameters

integer $treble

The treble level (between -10 and 10)

Returns

$this

getBass()

getBass() : integer

Get the bass equalisation level.

Returns

integer

setBass()

setBass(integer  $bass) : $this

Set the bass equalisation.

Parameters

integer $bass

The bass level (between -10 and 10)

Returns

$this

getLoudness()

getLoudness() : boolean

Check whether loudness normalisation is on or not.

Returns

boolean

setLoudness()

setLoudness(boolean  $on) : $this

Set whether loudness normalisation is on or not.

Parameters

boolean $on

Whether loudness should be on or not

Returns

$this

setEqLevel()

setEqLevel(string  $type, integer  $value) : $this

Set the bass/treble equalisation level.

Parameters

string $type

Which setting to update (bass or treble)

integer $value

The value to set (between -10 and 10)

Returns

$this