Enum HeatingCoolingMode
- All Implemented Interfaces:
Comparable<HeatingCoolingMode>
Trait.CURRENT_HEATING_COOLING, or what it
has been asked to do, for Trait.TARGET_HEATING_COOLING.-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionMaintaining a band betweenTrait.TARGET_HEATING_TEMPERATUREandTrait.TARGET_COOLING_TEMPERATURE, choosing for itself which to run.Cooling.Heating.Idle.A mode this API cannot name, carried so it is not misreported as something it is not. -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether this mode may be written toTrait.TARGET_HEATING_COOLING.static HeatingCoolingModeof(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, answersOFF.static HeatingCoolingModeReturns the enum constant of this type with the specified name.static HeatingCoolingMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
OFF
Idle. -
HEAT
Heating. -
COOL
Cooling. -
AUTO
Maintaining a band between
Trait.TARGET_HEATING_TEMPERATUREandTrait.TARGET_COOLING_TEMPERATURE, choosing for itself which to run.A target only.
Trait.CURRENT_HEATING_COOLINGnever reports it, because at any given moment the thermostat is heating, cooling or idle -- "auto" describes the policy, not the state.While this is the target,
Trait.TARGET_TEMPERATUREreports no value: there is no single setpoint to report, and answering with either threshold would silently be the wrong one half the time. -
OTHER
A mode this API cannot name, carried so it is not misreported as something it is not.
Matter's thermostat has
EmergencyHeat,Precooling,FanOnly,DryandSleep, none of which HomeKit can express and none of which have a portable meaning. Folding them intoOFFwould tell an app a running dehumidifier is idle. ReadTraitValue.getRawPlatformValue()for Matter's own ordinal when you need to know which.Writing this is rejected with
HomeError.INVALID_ARGUMENT-- an API that cannot name a mode cannot ask for it either.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
of
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.OFFrather thanOTHERas the fallback, deliberately:OTHERmeans "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, ornull
Returns
the mode, never
null -
isWritable
public boolean isWritable()Whether this mode may be written to
Trait.TARGET_HEATING_COOLING.Returns
truefor everything exceptOTHER
-