duncan3dc\Sonos\Controller::__construct PHP Method

__construct() public method

The speaker must be a coordinator.
public __construct ( duncan3dc\Sonos\Speaker $speaker, Network $network )
$speaker duncan3dc\Sonos\Speaker
$network Network
    public function __construct(Speaker $speaker, Network $network)
    {
        if (!$speaker->isCoordinator()) {
            throw new \InvalidArgumentException("You cannot create a Controller instance from a Speaker that is not the coordinator of it's group");
        }
        $this->ip = $speaker->ip;
        $this->device = $speaker->device;
        $this->network = $network;
        $this->name = $speaker->name;
        $this->room = $speaker->room;
        $this->group = $speaker->getGroup();
        $this->uuid = $speaker->getUuid();
    }