Enum DoorState

java.lang.Object
java.lang.Enum<DoorState>
com.codename1.home.DoorState
All Implemented Interfaces:
Comparable<DoorState>

public enum DoorState extends Enum<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 Constant Details

    • OPEN

      public static final DoorState OPEN
      Fully open.
    • CLOSED

      public static final DoorState CLOSED
      Fully closed.
    • OPENING

      public static final DoorState OPENING
      Moving toward OPEN. A report only; not writable.
    • CLOSING

      public static final DoorState CLOSING
      Moving toward CLOSED. A report only; not writable.
    • STOPPED

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

      public static final DoorState UNKNOWN
      The accessory could not say.
  • Method Details

    • values

      public static DoorState[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static DoorState valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • 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
      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