public enum HeatingCoolingMode

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

ImplementsComparable<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 constants

OFFIdle.
HEATHeating.
COOLCooling.
AUTOMaintaining a band between Trait.TARGET_HEATING_TEMPERATURE and Trait.TARGET_COOLING_TEMPERATURE, choosing for itself which to run.
OTHERA mode this API cannot name, carried so it is not misreported as something it is not.

Methods

public static HeatingCoolingMode[] values()
public static HeatingCoolingMode valueOf(String name)
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.
public boolean isWritable()Whether this mode may be written to Trait.TARGET_HEATING_COOLING.

Inherited methods

Enum constant details

OFF

OFF
Idle.

HEAT

HEAT
Heating.

COOL

COOL
Cooling.

AUTO

AUTO

Maintaining a band between Trait.TARGET_HEATING_TEMPERATURE and Trait.TARGET_COOLING_TEMPERATURE, choosing for itself which to run.

A target only. Trait.CURRENT_HEATING_COOLING never 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_TEMPERATURE reports no value: there is no single setpoint to report, and answering with either threshold would silently be the wrong one half the time.

OTHER

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, Dry and Sleep, none of which HomeKit can express and none of which have a portable meaning. Folding them into OFF would tell an app a running dehumidifier is idle. Read TraitValue.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

public static HeatingCoolingMode[] values()

valueOf

public static HeatingCoolingMode valueOf(String name)

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 TraitValue
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