Alarms

interface Alarms

User operations interface, contains methods for user operations.

All operations that change alarms are grouped and sent to the wristband by blocks. Method isAlarmsInProcessing return Flowable that emits state of alarm processing and errors if wristband communications failed or illegal data passed in parameters.

Properties

Link copied to clipboard
abstract val alarms: Observable<UserAlarm>

Get list of alarms.

Link copied to clipboard
abstract val alarmsCount: Single<Int>

Get user alarms count.

Link copied to clipboard
abstract val maxAlarmsCount: Int

Get maximum alarms count. When wristband does not connected will be returned default value.

Functions

Link copied to clipboard
abstract fun add(alarm: UserAlarm)

Add new alarm.

abstract fun add(alarms: List<UserAlarm>)

Add list of new alarms.

Link copied to clipboard
abstract fun create(): Single<UserAlarm>

Create and return enabled alarm with default values.

Link copied to clipboard
abstract fun getAlarm(id: Int): Single<UserAlarm>

Get alarm by id.

Link copied to clipboard
abstract fun isAlarmsInProcessing(): Flowable<Notification<Boolean>>

Returns Flowable that emits notifications about alarms processing.

Link copied to clipboard
abstract fun observeAlarms(): Flowable<List<UserAlarm>>

Get list of user alarms every time they changed.

Link copied to clipboard
abstract fun remove(id: Int)
abstract fun remove(ids: List<Int>)

Remove existing alarm by id.

Link copied to clipboard
abstract fun removeAll()

Remove all alarms.

Link copied to clipboard
abstract fun setEnabled(id: Int, isEnabled: Boolean)

Enabled or disabled alarm with specified id.

Link copied to clipboard
abstract fun update(alarm: UserAlarm)

Update existing alarm.

abstract fun update(alarms: List<UserAlarm>)

Update existing alarms.