Get all the speakers on the network.
public getSpeakers ( ) : duncan3dc\Sonos\Speaker[] | ||
리턴 | duncan3dc\Sonos\Speaker[] |
/** * Get the speaker of the alarm. * * @return Speaker */ public function getSpeaker() { foreach ($this->network->getSpeakers() as $speaker) { if ($speaker->getUuid() === $this->getRoom()) { return $speaker; } } throw new \RuntimeException("Unable to find a speaker for this alarm"); }
/** * Get the speakers that are in the group of this controller. * * @return Speaker[] */ public function getSpeakers() { $group = []; $speakers = $this->network->getSpeakers(); foreach ($speakers as $speaker) { if ($speaker->getGroup() === $this->getGroup()) { $group[] = $speaker; } } return $group; }