duncan3dc\Sonos\Network::getSpeakersByRoom PHP Method

getSpeakersByRoom() public method

Get all the speakers with the specified room name.
public getSpeakersByRoom ( string $room ) : duncan3dc\Sonos\Speaker[]
$room string The name of the room to look for
return duncan3dc\Sonos\Speaker[]
    public function getSpeakersByRoom($room)
    {
        $return = [];
        $speakers = $this->getSpeakers();
        foreach ($speakers as $controller) {
            if ($controller->room === $room) {
                $return[] = $controller;
            }
        }
        return $return;
    }