public enum TraitValueKind
- Object
- Enum<TraitValueKind>
- TraitValueKind
ImplementsComparable<TraitValueKind>
What sort of value a Trait carries, and therefore which
TraitValue getter is the one that works.
There is deliberately no TLV
HomeKit characteristics can carry TLV8 blobs, which is how accessory
vendors ship extensions outside the published characteristic set. Those
have no portable meaning – decoding one requires the vendor’s own schema,
and there is nothing on the Matter side to map them to. Exposing a byte
array here would look like a capability and be an invitation to write
iOS-only code inside a cross-platform API. A trait whose platform value is
TLV8 is simply not in the Trait table.
Enum constants
BOOLEAN | True or false. |
INT | A whole number with no unit. |
DOUBLE | A measured quantity with a TraitUnit. |
STRING | Free text. |
ENUM | One of a fixed set, carried as an ordinal into one of this package’s domain enums – LockState, HeatingCoolingMode, AirQualityLevel and the rest. |
Methods
public static TraitValueKind[] values() | |
public static TraitValueKind valueOf(String name) |
Inherited methods
Enum constant details
BOOLEAN
BOOLEANTrue or false. Read with
TraitValue.getBoolean().INT
INTA whole number with no unit. Read with
TraitValue.getInt().DOUBLE
DOUBLEA measured quantity with a
TraitUnit. Read with
TraitValue.getDouble(TraitUnit), which makes you name the unit you
expect.STRING
STRINGFree text. Read with
TraitValue.getString().ENUM
ENUMOne of a fixed set, carried as an ordinal into one of this package’s
domain enums –
LockState, HeatingCoolingMode, AirQualityLevel
and the rest. Read it through that enum’s own lookup rather than
through TraitValue.getEnumOrdinal(), which exists for the codec.Method details
values
public static TraitValueKind[] values()valueOf
public static TraitValueKind valueOf(String name)