duncan3dc\Sonos\Device::__construct PHP Method

__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
    public function __construct($ip, CacheInterface $cache = null, LoggerInterface $logger = null)
    {
        $this->ip = $ip;
        if ($cache === null) {
            $cache = new Cache();
        }
        $this->cache = $cache;
        if ($logger === null) {
            $logger = new NullLogger();
        }
        $this->logger = $logger;
    }