Constants

ONCE

ONCE = 0

MONDAY

MONDAY = 1

TUESDAY

TUESDAY = self::MONDAY * 2

WEDNESDAY

WEDNESDAY = self::TUESDAY * 2

THURSDAY

THURSDAY = self::WEDNESDAY * 2

FRIDAY

FRIDAY = self::THURSDAY * 2

SATURDAY

SATURDAY = self::FRIDAY * 2

SUNDAY

SUNDAY = self::SATURDAY * 2

DAILY

DAILY = self::SUNDAY * 2 - 1

Methods

getId()

getId() : integer

Get the id of the alarm.

Returns

integer

getRoom()

getRoom() : string

Get the room of the alarm.

Returns

string

setRoom()

setRoom(string  $uuid) : \duncan3dc\Sonos\Interfaces\AlarmInterface

Set the room of the alarm.

Parameters

string $uuid

The unique id of the room (eg, RINCON_B8E93758723601400)

Returns

\duncan3dc\Sonos\Interfaces\AlarmInterface

getFrequency()

getFrequency() : integer

Get the frequency of the alarm.

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).

Returns

integer

setFrequency()

setFrequency(integer  $frequency) : \duncan3dc\Sonos\Interfaces\AlarmInterface

Set the frequency of the alarm.

Parameters

integer $frequency

The integer representing the frequency (using the bitwise class constants)

Returns

\duncan3dc\Sonos\Interfaces\AlarmInterface

onMonday()

onMonday(boolean  $set = null) : boolean|static

Check or set whether this alarm is active on mondays.

Parameters

boolean $set

Set this alarm to be active or not on mondays

Returns

boolean|static —

Returns true/false when checking, or static when setting

onTuesday()

onTuesday(boolean  $set = null) : boolean|static

Check or set whether this alarm is active on tuesdays.

Parameters

boolean $set

Set this alarm to be active or not on tuesdays

Returns

boolean|static —

Returns true/false when checking, or static when setting

onWednesday()

onWednesday(boolean  $set = null) : boolean|static

Check or set whether this alarm is active on wednesdays.

Parameters

boolean $set

Set this alarm to be active or not on wednesdays

Returns

boolean|static —

Returns true/false when checking, or static when setting

onThursday()

onThursday(boolean  $set = null) : boolean|static

Check or set whether this alarm is active on thursdays.

Parameters

boolean $set

Set this alarm to be active or not on thursdays

Returns

boolean|static —

Returns true/false when checking, or static when setting

onFriday()

onFriday(boolean  $set = null) : boolean|static

Check or set whether this alarm is active on fridays.

Parameters

boolean $set

Set this alarm to be active or not on fridays

Returns

boolean|static —

Returns true/false when checking, or static when setting

onSaturday()

onSaturday(boolean  $set = null) : boolean|static

Check or set whether this alarm is active on saturdays.

Parameters

boolean $set

Set this alarm to be active or not on saturdays

Returns

boolean|static —

Returns true/false when checking, or static when setting

onSunday()

onSunday(boolean  $set = null) : boolean|static

Check or set whether this alarm is active on sundays.

Parameters

boolean $set

Set this alarm to be active or not on sundays

Returns

boolean|static —

Returns true/false when checking, or static when setting

once()

once(boolean  $set = null) : boolean|static

Check or set whether this alarm is a one time only alarm.

Parameters

boolean $set

Set this alarm to be a one time only alarm

Returns

boolean|static —

Returns true/false when checking, or static when setting

daily()

daily(boolean  $set = null) : boolean|static

Check or set whether this alarm runs every day or not.

Parameters

boolean $set

Set this alarm to be active every day

Returns

boolean|static —

Returns true/false when checking, or static when setting

getFrequencyDescription()

getFrequencyDescription() : string

Get the frequency of the alarm as a human readable description.

Returns

string

getVolume()

getVolume() : integer

Get the volume of the alarm.

Returns

integer

setVolume()

setVolume(integer  $volume) : \duncan3dc\Sonos\Interfaces\AlarmInterface

Set the volume of the alarm.

Parameters

integer $volume

The volume of the alarm

Returns

\duncan3dc\Sonos\Interfaces\AlarmInterface

getRepeat()

getRepeat() : boolean

Check if repeat is active.

Returns

boolean

setRepeat()

setRepeat(boolean  $repeat) : \duncan3dc\Sonos\Interfaces\AlarmInterface

Turn repeat mode on or off.

Parameters

boolean $repeat

Whether repeat should be on or not

Returns

\duncan3dc\Sonos\Interfaces\AlarmInterface

getShuffle()

getShuffle() : boolean

Check if shuffle is active.

Returns

boolean

setShuffle()

setShuffle(boolean  $shuffle) : \duncan3dc\Sonos\Interfaces\AlarmInterface

Turn shuffle mode on or off.

Parameters

boolean $shuffle

Whether shuffle should be on or not

Returns

\duncan3dc\Sonos\Interfaces\AlarmInterface

isActive()

isActive() : boolean

Check if the alarm is active.

Returns

boolean

delete()

delete() : void

Delete this alarm.