duncan3dc\Sonos\Network::getControllerByRoom PHP Method

getControllerByRoom() public method

Get the coordinator for the specified room name.
public getControllerByRoom ( string $room ) : Controller | null
$room string The name of the room to look for
return Controller | null
    public function getControllerByRoom($room)
    {
        if (!($speaker = $this->getSpeakerByRoom($room))) {
            return;
        }
        $group = $speaker->getGroup();
        $controllers = $this->getControllers();
        foreach ($controllers as $controller) {
            if ($controller->getGroup() === $group) {
                return $controller;
            }
        }
    }