public enum DoorState

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

ImplementsComparable<DoorState>

The state of a door or garage door, for Trait.DOOR_STATE and Trait.TARGET_DOOR_STATE.

Backend support

HomeKit publishes this directly. The Google Home APIs have an equivalent through Google’s own garage-door trait. Matter has no standard garage cluster in the revisions shipping ecosystems support, so an Android build running on Play services Matter commissioning alone – see HomeAvailability.COMMISSIONING_ONLY – cannot see a garage door at all.

Enum constants

OPENFully open.
CLOSEDFully closed.
OPENINGMoving toward OPEN.
CLOSINGMoving toward CLOSED.
STOPPEDHalted part-way, usually because the user stopped it or an obstruction was hit.
UNKNOWNThe accessory could not say.

Methods

public static DoorState[] values()
public static DoorState valueOf(String name)
public static DoorState of(TraitValue value)Reads a door state out of a trait value, total: a value that is not an enum, or whose ordinal is outside this set, answers UNKNOWN.
public boolean isWritable()Whether this state may be written to Trait.TARGET_DOOR_STATE.

Inherited methods

Enum constant details

OPEN

OPEN
Fully open.

CLOSED

CLOSED
Fully closed.

OPENING

OPENING
Moving toward OPEN. A report only; not writable.

CLOSING

CLOSING
Moving toward CLOSED. A report only; not writable.

STOPPED

STOPPED
Halted part-way, usually because the user stopped it or an obstruction was hit. Check Trait.OBSTRUCTION_DETECTED. A report only.

UNKNOWN

UNKNOWN
The accessory could not say.

Method details

values

public static DoorState[] values()

valueOf

public static DoorState valueOf(String name)

of

public static DoorState of(TraitValue value)
Reads a door 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.DOOR_STATE or Trait.TARGET_DOOR_STATE, or null

Returns

the state, never null

isWritable

public boolean isWritable()
Whether this state may be written to Trait.TARGET_DOOR_STATE.

Returns

true for OPEN and CLOSED only