Dominevo
ReferenceDevice capabilities

color

Color-light cap.

Color-light cap. Coexists with switch (on/off) and brightness (level) on the same device — switch toggles the bulb, brightness sets the dim level, this cap sets the chromaticity.

Three mutually-exclusive color modes are modelled — a single setColor mutation accepts whichever mode the caller wants and the provider rejects modes the bulb doesn't support:

  • rgb — direct red/green/blue triplet (0..255 each).
  • hsv — hue/saturation/value (0..360 / 0..100 / 0..100).
  • mired — color-temperature reciprocal in mireds (warm ≈ 500, cool ≈ 150). Used by tunable-white bulbs.

The slice carries the LAST-applied mode + its associated value; the provider does NOT auto-convert between modes (e.g. setting mireds zeroes out the rgb/hsv fields). UI surfaces a single color picker that picks one mode per interaction.

Sub-feature gating uses the granular DeviceFeature.LightColorRgb / LightColorHsv / LightColorMired flags — a Hue full-color bulb sets all three; a CCT-only tunable-white bulb sets only LightColorMired. The UI uses these flags to decide which color modes to expose in the picker without a slice fetch.

At a glance

Capabilitycolor
Provided byThe device's own driver provides it: each device registers its own provider.
Active providers per deviceone
Device typeslight
Sourcepackages/types/src/capabilities/color.cap.ts

Methods

Every method takes the device id (deviceId) to address the device; the input tables below list the other fields.

MethodKindRequired of a providerAccess
setColormutationyesprotected

setColor

mutation

Input

FieldTypeRequiredDescription
color{ mode: "rgb"; rgb: { r: number; g: number; b: number } } | { mode: "hsv"; hsv: { h: number; s: number; v: number } } | { mode: "mired"; colorTemperature: number }yes

Output

Nothing.

Actions (offered in automations and on device cards)

ActionLabelSets
color.warmWhiteWarm white
color.coolWhiteCool white
color.redRed
color.greenGreen
color.blueBlue

Runtime state

The state Dominevo keeps for each device with this capability, readable without calling the provider.

Runtime-state slice — the last applied color, mirrored by the kernel. Read via device.state.color.value so UI pickers surface the current chromaticity without polling the provider.

FieldTypeRequiredDescription
mode"rgb" | "hsv" | "mired"yesActive color mode — which of rgb / hsv / colorTemperature reflects the bulb's current state.
rgb{ r: number; g: number; b: number }noPopulated when mode === 'rgb'.
hsv{ h: number; s: number; v: number }noPopulated when mode === 'hsv'.
colorTemperaturenumbernoPopulated when mode === 'mired'.
lastChangedAtnumberyesMs epoch of the last operator-driven change.

Events

onColorChanged

Emitted whenever the color changes — operator action OR firmware push. Subscribers (UI color pickers, automation engines) react without polling.

FieldTypeRequiredDescription
deviceIdnumberyes
mode"rgb" | "hsv" | "mired"yes
rgb{ r: number; g: number; b: number }no
hsv{ h: number; s: number; v: number }no
colorTemperaturenumberno
lastChangedAtnumberyes