AlarmInstance
@Document(name = "builtin:AlarmInstance")
class AlarmInstance : Thing
AppSearch document representing an AlarmInstance entity.
An AlarmInstance must be associated with an Alarm. It represents a particular point in time for that Alarm. For example, if an Alarm is set to repeat every Monday, then each AlarmInstance for it will be the exact Mondays that the Alarm did trigger.
The scheduled time should be timezone independent so that it remains unchanged across timezones. E.g.: An AlarmInstance set to fire at 7am GMT should also fire at 7am when the timezone is changed to PST.
Summary
Nested types |
|---|
|
Builder for |
Constants |
|
|---|---|
const Int |
STATUS_DISMISSED = 3The |
const Int |
STATUS_FIRING = 2The |
const Int |
STATUS_MISSED = 5The |
const Int |
STATUS_SCHEDULED = 1The |
const Int |
STATUS_SNOOZED = 4The |
const Int |
STATUS_UNKNOWN = 0The |
Public functions |
|
|---|---|
String |
Returns the time that this is expected to fire in ISO 8601 format. |
Long |
Returns the length of time in milliseconds the |
Int |
Returns the current status. |
Inherited functions |
||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Constants
STATUS_DISMISSED
const val STATUS_DISMISSED = 3: Int
The AlarmInstance has been dismissed.
STATUS_SCHEDULED
const val STATUS_SCHEDULED = 1: Int
The AlarmInstance is scheduled to fire at some point in the future.
STATUS_UNKNOWN
const val STATUS_UNKNOWN = 0: Int
The AlarmInstance is in an unknown error state.
Public functions
getScheduledTime
fun getScheduledTime(): String
Returns the time that this is expected to fire in ISO 8601 format. E.g.: 2022-01-14T00:00:00
The scheduledTime is a timezone independent date time. When used, it should be converted into a date time in the local timezone.
getSnoozeDurationMillis
fun getSnoozeDurationMillis(): Long
Returns the length of time in milliseconds the AlarmInstance will remain snoozed before it fires again, or -1 if it does not support snoozing.
getStatus
fun getStatus(): Int
Returns the current status.
Status can be either STATUS_UNKNOWN, STATUS_SCHEDULED, STATUS_FIRING, STATUS_DISMISSED, STATUS_SNOOZED, or STATUS_MISSED.