Enum HeatingCoolingMode

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

public enum HeatingCoolingMode extends Enum<HeatingCoolingMode>
What a thermostat is doing, for Trait.CURRENT_HEATING_COOLING, or what it has been asked to do, for Trait.TARGET_HEATING_COOLING.
  • Enum Constant Details

  • Method Details

    • values

      public static HeatingCoolingMode[] 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 HeatingCoolingMode 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 HeatingCoolingMode of(TraitValue value)

      Reads a mode out of a trait value, total: a value that is not an enum, or whose ordinal is outside this set, answers OFF.

      OFF rather than OTHER as the fallback, deliberately: OTHER means "the accessory named a mode we cannot express", which is a claim about the accessory. A value this code could not read at all is not evidence of that.

      Parameters
      • value: a value read from one of the heating-cooling traits, or null
      Returns

      the mode, never null

    • isWritable

      public boolean isWritable()

      Whether this mode may be written to Trait.TARGET_HEATING_COOLING.

      Returns

      true for everything except OTHER