public enum FanMode
- Object
- Enum<FanMode>
- FanMode
ImplementsComparable<FanMode>
How a fan is running, for Trait.FAN_MODE.
This one is heavily lossy on HomeKit
Matter’s Fan Control cluster has a real mode attribute with seven values. HomeKit has no equivalent: its fan service carries a speed percentage and a two-state “manual or auto” characteristic, and off is expressed through the power characteristic rather than as a mode.
So on iOS: writing LOW, MEDIUM or HIGH is translated into a
Trait.FAN_SPEED write of 33, 66 or 100 percent, and a read never
returns them – it answers OFF, AUTO or ON. If your UI needs to
show the speed the user picked, read Trait.FAN_SPEED and render that; it
works the same everywhere.
OFF is read from the power characteristic rather than from the mode,
because that is where HomeKit keeps it – a fan standing still still
reports “manual” or “auto” as its mode. A subscription to Trait.FAN_MODE
watches the power characteristic for the same reason, so switching the fan
off is a mode change your listener hears.
Enum constants
OFF | Not running. |
LOW | Low speed. |
MEDIUM | Medium speed. |
HIGH | High speed. |
ON | Running at whatever speed Trait.FAN_SPEED says. |
AUTO | The fan is choosing its own speed. |
SMART | The fan is choosing its own speed using its own sensors and schedule. |
Methods
public static FanMode[] values() | |
public static FanMode valueOf(String name) | |
public static FanMode of(TraitValue value) | Reads a fan mode out of a trait value, total: a value that is not an enum, or whose ordinal is outside this set, answers OFF. |
Inherited methods
Enum constant details
OFF
OFFLOW
LOWMEDIUM
MEDIUMHIGH
HIGHON
ONTrait.FAN_SPEED says.AUTO
AUTOSMART
SMARTThe fan is choosing its own speed using its own sensors and schedule.
Matter and Google Home only. HomeKit reports AUTO instead.
Method details
values
public static FanMode[] values()valueOf
public static FanMode valueOf(String name)of
public static FanMode of(TraitValue value)OFF.Parameters
valueTraitValue- a value read from
Trait.FAN_MODE, ornull
Returns
null