public enum AlarmState

  1. Object
  2. Enum<AlarmState>
  3. AlarmState

ImplementsComparable<AlarmState>

The state of a life-safety alarm, for Trait.SMOKE_DETECTED and Trait.CO_DETECTED. Read-only.

Read the caveat before you build on this

This API is not a fire-alarm system and must not be the only thing standing between a user and a fire. Notifications here arrive only while the app is running – see TraitSubscription.isPushDelivery() – and a sleeping phone is told nothing. Treat these values as information, never as a warning channel.

Enum constants

NORMALNothing detected.
WARNINGDetected below the alarm threshold.
CRITICALDetected at or above the alarm threshold.
UNKNOWNThe accessory could not say.

Methods

public static AlarmState[] values()
public static AlarmState valueOf(String name)
public static AlarmState of(TraitValue value)Reads an alarm state out of a trait value, total: a value that is not an enum, or whose ordinal is outside this set, answers UNKNOWN.

Inherited methods

Enum constant details

NORMAL

NORMAL
Nothing detected.

WARNING

WARNING

Detected below the alarm threshold.

HomeKit never produces this: its smoke and carbon-monoxide characteristics are two-state, so anything it detects arrives as CRITICAL.

CRITICAL

CRITICAL
Detected at or above the alarm threshold.

UNKNOWN

UNKNOWN
The accessory could not say.

Method details

values

public static AlarmState[] values()

valueOf

public static AlarmState valueOf(String name)

of

public static AlarmState of(TraitValue value)
Reads an alarm state out of a trait value, total: a value that is not an enum, or whose ordinal is outside this set, answers UNKNOWN.

Parameters

value TraitValue
a value read from Trait.SMOKE_DETECTED or Trait.CO_DETECTED, or null

Returns

the state, never null