public enum TraitValueKind

  1. Object
  2. Enum<TraitValueKind>
  3. 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

BOOLEANTrue or false.
INTA whole number with no unit.
DOUBLEA measured quantity with a TraitUnit.
STRINGFree text.
ENUMOne 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

BOOLEAN
True or false. Read with TraitValue.getBoolean().

INT

INT
A whole number with no unit. Read with TraitValue.getInt().

DOUBLE

DOUBLE
A measured quantity with a TraitUnit. Read with TraitValue.getDouble(TraitUnit), which makes you name the unit you expect.

STRING

STRING
Free text. Read with TraitValue.getString().

ENUM

ENUM
One 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)