\duncan3dc\Sonos\DevicesDevice

Make http requests to a Sonos device.

Summary

Methods
Properties
Constants
__construct()
getIp()
getXml()
soap()
getModel()
isSpeaker()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$ip
$model
$cache
$logger
N/A

Properties

$ip

$ip : string

Type

string — The IP address of the device.

$model

$model : string

Type

string — The model of the device.

$cache

$cache : \Psr\SimpleCache\CacheInterface

Type

\Psr\SimpleCache\CacheInterface — The long-lived cache object from the Collection instance.

$logger

$logger : \Psr\Log\LoggerInterface

Type

\Psr\Log\LoggerInterface — The logging object.

Methods

__construct()

__construct(string  $ip, \Psr\SimpleCache\CacheInterface  $cache = null, \Psr\Log\LoggerInterface  $logger = null) 

Create an instance of the Device class.

Parameters

string $ip

The ip address that the device is listening on

\Psr\SimpleCache\CacheInterface $cache

The cache object to use for finding Sonos devices on the network

\Psr\Log\LoggerInterface $logger

A logging object

getIp()

getIp() : string

Get the IP address of this device.

Returns

string

getXml()

getXml(string  $url) : \duncan3dc\DomParser\XmlParser

Retrieve some xml from the device.

Parameters

string $url

The url to retrieve

Returns

\duncan3dc\DomParser\XmlParser

soap()

soap(string  $service, string  $action, array  $params = array()) : mixed

Send a soap request to the device.

Parameters

string $service

The service to send the request to

string $action

The action to call

array $params

The parameters to pass

Returns

mixed

getModel()

getModel() : string

Get the model of this device.

Returns

string

isSpeaker()

isSpeaker() : boolean

Check if this sonos device is a speaker.

Returns

boolean