PHP Class duncan3dc\Sonos\Device

Show file Open project: duncan3dc/sonos Class Usage Examples

Public Properties

Property Type Description
$ip string The IP address of the device.

Protected Properties

Property Type Description
$cache Doctrine\Common\Cache\Cache The long-lived cache object from the Network instance.
$logger Psr\Log\LoggerInterface The logging object.
$model string The model of the device.

Public Methods

Method Description
__construct ( string $ip, Doctrine\Common\Cache\Cache $cache = null, Psr\Log\LoggerInterface $logger = null ) Create an instance of the Device class.
getModel ( ) : string Get the model of this device.
getXml ( string $url ) : duncan3dc\DomParser\XmlParser Retrieve some xml from the device.
isSpeaker ( ) : boolean Check if this sonos device is a speaker.
soap ( string $service, string $action, array $params = [] ) : mixed Send a soap request to the device.

Method Details

__construct() public method

Create an instance of the Device class.
public __construct ( string $ip, Doctrine\Common\Cache\Cache $cache = null, Psr\Log\LoggerInterface $logger = null )
$ip string The ip address that the device is listening on
$cache Doctrine\Common\Cache\Cache The cache object to use for the expensive multicast discover to find Sonos devices on the network
$logger Psr\Log\LoggerInterface A logging object

getModel() public method

Get the model of this device.
public getModel ( ) : string
return string

getXml() public method

Retrieve some xml from the device.
public getXml ( string $url ) : duncan3dc\DomParser\XmlParser
$url string The url to retrieve
return duncan3dc\DomParser\XmlParser

isSpeaker() public method

Check if this sonos device is a speaker.
public isSpeaker ( ) : boolean
return boolean

soap() public method

Send a soap request to the device.
public soap ( string $service, string $action, array $params = [] ) : mixed
$service string The service to send the request to
$action string The action to call
$params array The parameters to pass
return mixed

Property Details

$cache protected property

The long-lived cache object from the Network instance.
protected Cache,Doctrine\Common\Cache $cache
return Doctrine\Common\Cache\Cache

$ip public property

The IP address of the device.
public string $ip
return string

$logger protected property

The logging object.
protected LoggerInterface,Psr\Log $logger
return Psr\Log\LoggerInterface

$model protected property

The model of the device.
protected string $model
return string