AlarmInterface
in
Provides an interface for managing the alarms on the network.
Table of Contents
Constants
- DAILY : mixed = self::SUNDAY * 2 - 1
- FRIDAY : mixed = self::THURSDAY * 2
- MONDAY : mixed = 1
- ONCE : mixed = 0
- SATURDAY : mixed = self::FRIDAY * 2
- SUNDAY : mixed = self::SATURDAY * 2
- THURSDAY : mixed = self::WEDNESDAY * 2
- TUESDAY : mixed = self::MONDAY * 2
- WEDNESDAY : mixed = self::TUESDAY * 2
Methods
- activate() : AlarmInterface
- Make the alarm active.
- daily() : $this|bool
- Check or set whether this alarm runs every day or not.
- deactivate() : AlarmInterface
- Make the alarm inactive.
- delete() : void
- Delete this alarm.
- getDuration() : TimeInterface
- Get the duration of the alarm.
- getFrequency() : int
- Get the frequency of the alarm.
- getFrequencyDescription() : string
- Get the frequency of the alarm as a human readable description.
- getId() : int
- Get the id of the alarm.
- getMusic() : UriInterface
- Get the music that will be played when this alarm goes off.
- getRepeat() : bool
- Check if repeat is active.
- getRoom() : string
- Get the room of the alarm.
- getShuffle() : bool
- Check if shuffle is active.
- getSpeaker() : SpeakerInterface
- Get the speaker of the alarm.
- getTime() : TimeInterface
- Get the start time of the alarm.
- getVolume() : int
- Get the volume of the alarm.
- isActive() : bool
- Check if the alarm is active.
- once() : $this|bool
- Check or set whether this alarm is a one time only alarm.
- onFriday() : $this|bool
- Check or set whether this alarm is active on fridays.
- onMonday() : $this|bool
- Check or set whether this alarm is active on mondays.
- onSaturday() : $this|bool
- Check or set whether this alarm is active on saturdays.
- onSunday() : $this|bool
- Check or set whether this alarm is active on sundays.
- onThursday() : $this|bool
- Check or set whether this alarm is active on thursdays.
- onTuesday() : $this|bool
- Check or set whether this alarm is active on tuesdays.
- onWednesday() : $this|bool
- Check or set whether this alarm is active on wednesdays.
- setDuration() : AlarmInterface
- Set the duration of the alarm.
- setFrequency() : AlarmInterface
- Set the frequency of the alarm.
- setMusic() : AlarmInterface
- Set the music that will be played when this alarm goes off.
- setRepeat() : AlarmInterface
- Turn repeat mode on or off.
- setRoom() : AlarmInterface
- Set the room of the alarm.
- setShuffle() : AlarmInterface
- Turn shuffle mode on or off.
- setSpeaker() : AlarmInterface
- Set the speaker of the alarm.
- setTime() : AlarmInterface
- Set the start time of the alarm.
- setVolume() : AlarmInterface
- Set the volume of the alarm.
Constants
DAILY
public
mixed
DAILY
= self::SUNDAY * 2 - 1
FRIDAY
public
mixed
FRIDAY
= self::THURSDAY * 2
MONDAY
public
mixed
MONDAY
= 1
ONCE
public
mixed
ONCE
= 0
SATURDAY
public
mixed
SATURDAY
= self::FRIDAY * 2
SUNDAY
public
mixed
SUNDAY
= self::SATURDAY * 2
THURSDAY
public
mixed
THURSDAY
= self::WEDNESDAY * 2
TUESDAY
public
mixed
TUESDAY
= self::MONDAY * 2
WEDNESDAY
public
mixed
WEDNESDAY
= self::TUESDAY * 2
Methods
activate()
Make the alarm active.
public
activate() : AlarmInterface
Return values
AlarmInterfacedaily()
Check or set whether this alarm runs every day or not.
public
daily([bool|null $set = null ]) : $this|bool
Parameters
- $set : bool|null = null
-
Set this alarm to be active every day
Return values
$this|bool —Returns true/false when checking, or itself when setting
deactivate()
Make the alarm inactive.
public
deactivate() : AlarmInterface
Return values
AlarmInterfacedelete()
Delete this alarm.
public
delete() : void
getDuration()
Get the duration of the alarm.
public
getDuration() : TimeInterface
Return values
TimeInterfacegetFrequency()
Get the frequency of the alarm.
public
getFrequency() : int
The result is an integer which can be compared using the bitwise operators and the class constants for each day. If the alarm is a one time only alarm then it will only be equal to the class constant ONCE (none of the days).
Return values
intgetFrequencyDescription()
Get the frequency of the alarm as a human readable description.
public
getFrequencyDescription() : string
Return values
stringgetId()
Get the id of the alarm.
public
getId() : int
Return values
intgetMusic()
Get the music that will be played when this alarm goes off.
public
getMusic() : UriInterface
Return values
UriInterfacegetRepeat()
Check if repeat is active.
public
getRepeat() : bool
Return values
boolgetRoom()
Get the room of the alarm.
public
getRoom() : string
Return values
stringgetShuffle()
Check if shuffle is active.
public
getShuffle() : bool
Return values
boolgetSpeaker()
Get the speaker of the alarm.
public
getSpeaker() : SpeakerInterface
Return values
SpeakerInterfacegetTime()
Get the start time of the alarm.
public
getTime() : TimeInterface
Return values
TimeInterfacegetVolume()
Get the volume of the alarm.
public
getVolume() : int
Return values
intisActive()
Check if the alarm is active.
public
isActive() : bool
Return values
boolonce()
Check or set whether this alarm is a one time only alarm.
public
once([bool|null $set = null ]) : $this|bool
Parameters
- $set : bool|null = null
-
Set this alarm to be a one time only alarm
Return values
$this|bool —Returns true/false when checking, or itself when setting
onFriday()
Check or set whether this alarm is active on fridays.
public
onFriday([bool|null $set = null ]) : $this|bool
Parameters
- $set : bool|null = null
-
Set this alarm to be active or not on fridays
Return values
$this|bool —Returns true/false when checking, or itself when setting
onMonday()
Check or set whether this alarm is active on mondays.
public
onMonday([bool|null $set = null ]) : $this|bool
Parameters
- $set : bool|null = null
-
Set this alarm to be active or not on mondays
Return values
$this|bool —Returns true/false when checking, or itself when setting
onSaturday()
Check or set whether this alarm is active on saturdays.
public
onSaturday([bool|null $set = null ]) : $this|bool
Parameters
- $set : bool|null = null
-
Set this alarm to be active or not on saturdays
Return values
$this|bool —Returns true/false when checking, or itself when setting
onSunday()
Check or set whether this alarm is active on sundays.
public
onSunday([bool|null $set = null ]) : $this|bool
Parameters
- $set : bool|null = null
-
Set this alarm to be active or not on sundays
Return values
$this|bool —Returns true/false when checking, or itself when setting
onThursday()
Check or set whether this alarm is active on thursdays.
public
onThursday([bool|null $set = null ]) : $this|bool
Parameters
- $set : bool|null = null
-
Set this alarm to be active or not on thursdays
Return values
$this|bool —Returns true/false when checking, or itself when setting
onTuesday()
Check or set whether this alarm is active on tuesdays.
public
onTuesday([bool|null $set = null ]) : $this|bool
Parameters
- $set : bool|null = null
-
Set this alarm to be active or not on tuesdays
Return values
$this|bool —Returns true/false when checking, or itself when setting
onWednesday()
Check or set whether this alarm is active on wednesdays.
public
onWednesday([bool|null $set = null ]) : $this|bool
Parameters
- $set : bool|null = null
-
Set this alarm to be active or not on wednesdays
Return values
$this|bool —Returns true/false when checking, or itself when setting
setDuration()
Set the duration of the alarm.
public
setDuration(TimeInterface $duration) : AlarmInterface
Parameters
- $duration : TimeInterface
Return values
AlarmInterfacesetFrequency()
Set the frequency of the alarm.
public
setFrequency(int $frequency) : AlarmInterface
Parameters
- $frequency : int
-
The integer representing the frequency (using the bitwise class constants)
Return values
AlarmInterfacesetMusic()
Set the music that will be played when this alarm goes off.
public
setMusic(UriInterface $uri) : AlarmInterface
Parameters
- $uri : UriInterface
Return values
AlarmInterfacesetRepeat()
Turn repeat mode on or off.
public
setRepeat(bool $repeat) : AlarmInterface
Parameters
- $repeat : bool
-
Whether repeat should be on or not
Return values
AlarmInterfacesetRoom()
Set the room of the alarm.
public
setRoom(string $uuid) : AlarmInterface
Parameters
- $uuid : string
-
The unique id of the room (eg, RINCON_B8E93758723601400)
Return values
AlarmInterfacesetShuffle()
Turn shuffle mode on or off.
public
setShuffle(bool $shuffle) : AlarmInterface
Parameters
- $shuffle : bool
-
Whether shuffle should be on or not
Return values
AlarmInterfacesetSpeaker()
Set the speaker of the alarm.
public
setSpeaker(SpeakerInterface $speaker) : AlarmInterface
Parameters
- $speaker : SpeakerInterface
-
The speaker to attach this alarm to
Return values
AlarmInterfacesetTime()
Set the start time of the alarm.
public
setTime(TimeInterface $time) : AlarmInterface
Parameters
- $time : TimeInterface
Return values
AlarmInterfacesetVolume()
Set the volume of the alarm.
public
setVolume(int $volume) : AlarmInterface
Parameters
- $volume : int
-
The volume of the alarm