public enum TraitUnitDimension

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

ImplementsComparable<TraitUnitDimension>

What a TraitUnit measures. Two units convert into one another only when they share a dimension; asking for anything else is a bug in the calling code and throws.

Enum constants

DIMENSIONLESSA bare number with no unit – an ordinal, a count, a boolean carried as a number.
RATIOA proportion.
TEMPERATURETemperature.
ANGLEA plane angle, used for colour hue.
COLOR_TEMPERATUREThe correlated colour temperature of a light.
ILLUMINANCEIlluminance.
CONCENTRATION_PARTSA concentration expressed as a fraction of the whole – parts per million and its relatives.
CONCENTRATION_MASSA concentration expressed as mass per volume, used for particulate matter.

Methods

public static TraitUnitDimension[] values()
public static TraitUnitDimension valueOf(String name)

Inherited methods

Enum constant details

DIMENSIONLESS

DIMENSIONLESS
A bare number with no unit – an ordinal, a count, a boolean carried as a number.

RATIO

RATIO
A proportion. Canonical unit TraitUnit.PERCENT.

TEMPERATURE

TEMPERATURE
Temperature. Canonical unit TraitUnit.CELSIUS. The only dimension here that needs the affine offset.

ANGLE

ANGLE
A plane angle, used for colour hue. Canonical unit TraitUnit.ARC_DEGREE.

COLOR_TEMPERATURE

COLOR_TEMPERATURE

The correlated colour temperature of a light. Canonical unit TraitUnit.MIRED.

Its own dimension rather than a member of TEMPERATURE, which it resembles only by name: a light at 250 mireds is not 250 degrees of anything, and letting the two convert would turn a thermostat setpoint into a colour by arithmetic that raises no error.

ILLUMINANCE

ILLUMINANCE
Illuminance. Canonical unit TraitUnit.LUX.

CONCENTRATION_PARTS

CONCENTRATION_PARTS

A concentration expressed as a fraction of the whole – parts per million and its relatives. Canonical unit TraitUnit.PPM.

Deliberately does not convert to CONCENTRATION_MASS. Going between parts-per and micrograms per cubic metre needs the molar mass of the gas and the ambient temperature and pressure, none of which this API has. Accessories report one or the other; where the platform gives a value in the dimension the trait does not use, the port reports no value rather than inventing the missing physics.

CONCENTRATION_MASS

CONCENTRATION_MASS
A concentration expressed as mass per volume, used for particulate matter. Canonical unit TraitUnit.MICROGRAM_PER_CUBIC_METER.

Method details

values

public static TraitUnitDimension[] values()

valueOf

public static TraitUnitDimension valueOf(String name)