ColorControlCommands

interface ColorControlCommands

Known direct subclasses
ColorControl

API for the ColorControl trait.


Summary

Public functions

suspend Unit
colorLoopSet(
    updateFlags: ColorControlTrait.ColorLoopUpdateFlags,
    action: ColorControlTrait.ColorLoopAction,
    direction: ColorControlTrait.ColorLoopDirection,
    time: UShort,
    startHue: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
)

Cycles the device through its range of hues.

suspend Unit
enhancedMoveHue(
    moveMode: ColorControlTrait.HueMoveMode,
    rate: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
)

Change a device's enhanced hue based on a rate of movement.

suspend Unit
enhancedMoveToHue(
    enhancedHue: UShort,
    direction: ColorControlTrait.HueDirection,
    transitionTime: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
)

Move a device from its current hue to the provided enhanced hue.

suspend Unit
enhancedMoveToHueAndSaturation(
    enhancedHue: UShort,
    saturation: UByte,
    transitionTime: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
)

Move a device from its current enhanced hue and saturation to the provided enhanced hue and saturation.

suspend Unit
enhancedStepHue(
    stepMode: ColorControlTrait.HueStepMode,
    stepSize: UShort,
    transitionTime: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
)

Move a device's enhanced hue a specific amount over a period of time.

suspend Unit
moveColor(
    rateX: Short,
    rateY: Short,
    optionsMask: UByte,
    optionsOverride: UByte
)

Move a device from its current color in a continuous fashion according to the rates specified.

suspend Unit
moveColorTemperature(
    moveMode: ColorControlTrait.HueMoveMode,
    rate: UShort,
    colorTemperatureMinimumMireds: UShort,
    colorTemperatureMaximumMireds: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
)

Change a device's color temperature based on a rate of movement.

suspend Unit
moveHue(
    moveMode: ColorControlTrait.HueMoveMode,
    rate: UByte,
    optionsMask: UByte,
    optionsOverride: UByte
)

Change a device's hue based on a rate of movement.

suspend Unit
moveSaturation(
    moveMode: ColorControlTrait.SaturationMoveMode,
    rate: UByte,
    optionsMask: UByte,
    optionsOverride: UByte
)

Change a device's saturation based on a rate of movement.

suspend Unit
moveToColor(
    colorX: UShort,
    colorY: UShort,
    transitionTime: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
)

Move a device from its current color to the color given in the colorX and colorY parameters.

suspend Unit
moveToColorTemperature(
    colorTemperatureMireds: UShort,
    transitionTime: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
)

Move a device from its current color to a new color, using the scaled inverse of the color temperature, in mireds.

suspend Unit
moveToHue(
    hue: UByte,
    direction: ColorControlTrait.HueDirection,
    transitionTime: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
)

Move a device from its current hue to the provided hue.

suspend Unit
moveToHueAndSaturation(
    hue: UByte,
    saturation: UByte,
    transitionTime: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
)

Move a device from its current hue and saturation to the provided hue and saturation.

suspend Unit
moveToSaturation(
    saturation: UByte,
    transitionTime: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
)

Move a device from its current saturation to the provided saturation.

suspend Unit
stepColor(
    stepX: Short,
    stepY: Short,
    transitionTime: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
)

Move a device from its current color by the specified color step.

suspend Unit
stepColorTemperature(
    stepMode: ColorControlTrait.HueStepMode,
    stepSize: UShort,
    transitionTime: UShort,
    colorTemperatureMinimumMireds: UShort,
    colorTemperatureMaximumMireds: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
)

Change a device's color temperature a specific amount over a period of time.

suspend Unit
stepHue(
    stepMode: ColorControlTrait.HueStepMode,
    stepSize: UByte,
    transitionTime: UByte,
    optionsMask: UByte,
    optionsOverride: UByte
)

Move a device's hue a specific amount over a period of time.

suspend Unit
stepSaturation(
    stepMode: ColorControlTrait.SaturationStepMode,
    stepSize: UByte,
    transitionTime: UByte,
    optionsMask: UByte,
    optionsOverride: UByte
)

Move a device's saturation a specific amount over a period of time.

suspend Unit
stopMoveStep(optionsMask: UByte, optionsOverride: UByte)

Stop a MoveTo, Move, or Step command that is currently in process.

Public functions

colorLoopSet

suspend fun colorLoopSet(
    updateFlags: ColorControlTrait.ColorLoopUpdateFlags,
    action: ColorControlTrait.ColorLoopAction,
    direction: ColorControlTrait.ColorLoopDirection,
    time: UShort,
    startHue: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
): Unit

Cycles the device through its range of hues.

Parameters
updateFlags: ColorControlTrait.ColorLoopUpdateFlags

The attributes to update before the color loop starts. See ColorLoopUpdateFlags for the list of flags to use.

action: ColorControlTrait.ColorLoopAction

The action to take if updateAction is set in updateFlags. Must be a value from the ColorLoopAction enum.

direction: ColorControlTrait.ColorLoopDirection

The direction of the color loop if updateDirection is set in updateFlags. Must be a value from the ColorLoopDirection enum.

time: UShort

The number of seconds over which to perform the full color loop if updateTime is set in updateFlags.

startHue: UShort

The starting hue to use if updateStartHue is set in updateFlags.

optionsMask: UByte

Determines which bits in the options attribute should be overridden by optionsOverride.

optionsOverride: UByte

If the corresponding bit in optionsMask is set to 1, the bit set here overrides the corresponding bit in options attribute.

enhancedMoveHue

suspend fun enhancedMoveHue(
    moveMode: ColorControlTrait.HueMoveMode,
    rate: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
): Unit

Change a device's enhanced hue based on a rate of movement.

Parameters
moveMode: ColorControlTrait.HueMoveMode

The direction in which to move the enhanced hue. This must be one of the values in HueMoveMode.

rate: UShort

The rate (in steps per seconds) used to change the device's enhancedCurrentHue.

optionsMask: UByte

Determines which bits in the options attribute should be overridden by optionsOverride.

optionsOverride: UByte

If the corresponding bit in optionsMask is set to 1, the bit set here overrides the corresponding bit in options attribute.

enhancedMoveToHue

suspend fun enhancedMoveToHue(
    enhancedHue: UShort,
    direction: ColorControlTrait.HueDirection,
    transitionTime: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
): Unit

Move a device from its current hue to the provided enhanced hue.

Parameters
enhancedHue: UShort

The enhanced hue to be moved to. The valid range of values is 0 to 65534.

direction: ColorControlTrait.HueDirection

The direction in which to move the enhanced hue. This must be one of the values in HueDirection.

transitionTime: UShort

The time (in 0.1 seconds) taken to move the device to the new hue.

optionsMask: UByte

Determines which bits in the options attribute should be overridden by optionsOverride.

optionsOverride: UByte

If the corresponding bit in optionsMask is set to 1, the bit set here overrides the corresponding bit in options attribute.

enhancedMoveToHueAndSaturation

suspend fun enhancedMoveToHueAndSaturation(
    enhancedHue: UShort,
    saturation: UByte,
    transitionTime: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
): Unit

Move a device from its current enhanced hue and saturation to the provided enhanced hue and saturation.

Parameters
enhancedHue: UShort

The enhanced hue to be moved to. The valid range of values is 0 to 65534.

saturation: UByte

The saturation to be moved to. The valid range of values is 0 to 254.

transitionTime: UShort

The time (in 0.1 seconds) taken to move the device to the new enhanced hue and saturation.

optionsMask: UByte

Determines which bits in the options attribute should be overridden by optionsOverride.

optionsOverride: UByte

If the corresponding bit in optionsMask is set to 1, the bit set here overrides the corresponding bit in options attribute.

enhancedStepHue

suspend fun enhancedStepHue(
    stepMode: ColorControlTrait.HueStepMode,
    stepSize: UShort,
    transitionTime: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
): Unit

Move a device's enhanced hue a specific amount over a period of time.

Parameters
stepMode: ColorControlTrait.HueStepMode

The direction in which to move the enhanced hue. This must be one of the values in HueStepMode.

stepSize: UShort

The amount of units to move the device's enhancedCurrentHue to.

transitionTime: UShort

The time (in 0.1 seconds) taken to move the device to the new enhanced hue.

optionsMask: UByte

Determines which bits in the options attribute should be overridden by optionsOverride.

optionsOverride: UByte

If the corresponding bit in optionsMask is set to 1, the bit set here overrides the corresponding bit in options attribute.

moveColor

suspend fun moveColor(
    rateX: Short,
    rateY: Short,
    optionsMask: UByte,
    optionsOverride: UByte
): Unit

Move a device from its current color in a continuous fashion according to the rates specified.

This command will continue to process until the target color for the next step cannot be implemented on the device.

Setting both rateX and rateY to 0 stops any previously received command of the ColorControl cluster.

Parameters
rateX: Short

The rate of movement in steps per second. A step is a change of one unit to the currentX attribute.

rateY: Short

The rate of movement in steps per second. A step is a change of one unit to the currentY attribute.

optionsMask: UByte

Determines which bits in the options attribute should be overridden by optionsOverride.

optionsOverride: UByte

If the corresponding bit in optionsMask is set to 1, the bit set here overrides the corresponding bit in options attribute.

moveColorTemperature

suspend fun moveColorTemperature(
    moveMode: ColorControlTrait.HueMoveMode,
    rate: UShort,
    colorTemperatureMinimumMireds: UShort,
    colorTemperatureMaximumMireds: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
): Unit

Change a device's color temperature based on a rate of movement.

Parameters
moveMode: ColorControlTrait.HueMoveMode

The direction in which to move the color temperature. This must be one of the values in HueMoveMode.

rate: UShort

The rate (in steps per seconds) used to change the device's colorTemperatureMireds.

colorTemperatureMinimumMireds: UShort

The lower bound of the colorTemperatureMireds attribute for the command. This value must be between the colorTempPhysicalMinMireds and colorTemperatureMireds attributes. If this value is set to 0, colorTempPhysicalMinMireds is used as the lower bound.

colorTemperatureMaximumMireds: UShort

The upper bound of the colorTemperatureMireds attribute for the command. This value must be between the colorTemperatureMireds and colorTempPhysicalMaxMireds attributes. If this value is set to 0, colorTempPhysicalMaxMireds is used as the upper bound.

optionsMask: UByte

Determines which bits in the options attribute should be overridden by optionsOverride.

optionsOverride: UByte

If the corresponding bit in optionsMask is set to 1, the bit set here overrides the corresponding bit in options attribute.

moveHue

suspend fun moveHue(
    moveMode: ColorControlTrait.HueMoveMode,
    rate: UByte,
    optionsMask: UByte,
    optionsOverride: UByte
): Unit

Change a device's hue based on a rate of movement.

Parameters
moveMode: ColorControlTrait.HueMoveMode

The direction in which to move the hue. This must be one of the values in HueMoveMode.

rate: UByte

The rate (in steps per seconds) used to change the device's currentHue.

optionsMask: UByte

Determines which bits in the options attribute should be overridden by optionsOverride.

optionsOverride: UByte

If the corresponding bit in optionsMask is set to 1, the bit set here overrides the corresponding bit in options attribute.

moveSaturation

suspend fun moveSaturation(
    moveMode: ColorControlTrait.SaturationMoveMode,
    rate: UByte,
    optionsMask: UByte,
    optionsOverride: UByte
): Unit

Change a device's saturation based on a rate of movement.

Parameters
moveMode: ColorControlTrait.SaturationMoveMode

The direction in which to move the saturation. This must be one of the values in SaturationMoveMode.

rate: UByte

The rate (in steps per seconds) used to change the device's currentSaturation.

optionsMask: UByte

Determines which bits in the options attribute should be overridden by optionsOverride.

optionsOverride: UByte

If the corresponding bit in optionsMask is set to 1, the bit set here overrides the corresponding bit in options attribute.

moveToColor

suspend fun moveToColor(
    colorX: UShort,
    colorY: UShort,
    transitionTime: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
): Unit

Move a device from its current color to the color given in the colorX and colorY parameters.

Parameters
colorX: UShort

The normalized chromaticity value x, as defined in the CIE xyY Color Space, to move the device's color to.

colorY: UShort

The normalized chromaticity value y, as defined in the CIE xyY Color Space, to move the device's color to.

transitionTime: UShort

The time (in 0.1 seconds) taken to move the device to the new color.

optionsMask: UByte

Determines which bits in the options attribute should be overridden by optionsOverride.

optionsOverride: UByte

If the corresponding bit in optionsMask is set to 1, the bit set here overrides the corresponding bit in options attribute.

moveToColorTemperature

suspend fun moveToColorTemperature(
    colorTemperatureMireds: UShort,
    transitionTime: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
): Unit

Move a device from its current color to a new color, using the scaled inverse of the color temperature, in mireds.

Parameters
colorTemperatureMireds: UShort

The color temperature, in mireds, to move the device to.

transitionTime: UShort

The time (in 0.1 seconds) taken to move the device to the new color temperature.

optionsMask: UByte

Determines which bits in the options attribute should be overridden by optionsOverride.

optionsOverride: UByte

If the corresponding bit in optionsMask is set to 1, the bit set here overrides the corresponding bit in options attribute.

moveToHue

suspend fun moveToHue(
    hue: UByte,
    direction: ColorControlTrait.HueDirection,
    transitionTime: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
): Unit

Move a device from its current hue to the provided hue.

Parameters
hue: UByte

The hue to be moved to. The valid range of values is 0 to 254.

direction: ColorControlTrait.HueDirection

The direction in which to move the hue. This must be one of the values in HueDirection.

transitionTime: UShort

The time (in 0.1 seconds) taken to move the device to the new hue.

optionsMask: UByte

Determines which bits in the options attribute should be overridden by optionsOverride.

optionsOverride: UByte

If the corresponding bit in optionsMask is set to 1, the bit set here overrides the corresponding bit in options attribute.

moveToHueAndSaturation

suspend fun moveToHueAndSaturation(
    hue: UByte,
    saturation: UByte,
    transitionTime: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
): Unit

Move a device from its current hue and saturation to the provided hue and saturation.

Parameters
hue: UByte

The hue to be moved to. The valid range of values is 0 to 254.

saturation: UByte

The saturation to be moved to. The valid range of values is 0 to 254.

transitionTime: UShort

The time (in 0.1 seconds) taken to move the device to the new hue and saturation.

optionsMask: UByte

Determines which bits in the options attribute should be overridden by optionsOverride.

optionsOverride: UByte

If the corresponding bit in optionsMask is set to 1, the bit set here overrides the corresponding bit in options attribute.

moveToSaturation

suspend fun moveToSaturation(
    saturation: UByte,
    transitionTime: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
): Unit

Move a device from its current saturation to the provided saturation.

Parameters
saturation: UByte

The saturation to be moved to. The valid range of values is 0 to 254.

transitionTime: UShort

The time (in 0.1 seconds) taken to move the device to the new saturation.

optionsMask: UByte

Determines which bits in the options attribute should be overridden by optionsOverride.

optionsOverride: UByte

If the corresponding bit in optionsMask is set to 1, the bit set here overrides the corresponding bit in options attribute.

stepColor

suspend fun stepColor(
    stepX: Short,
    stepY: Short,
    transitionTime: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
): Unit

Move a device from its current color by the specified color step.

If the required step is larger than supported by the stepX and stepY parameters, use this command multiple times.

Parameters
stepX: Short

The change to be added to the device's currentX attribute.

stepY: Short

The change to be added to the device's currentY attribute.

transitionTime: UShort

The time (in 0.1 seconds) taken to move the device to the new color.

optionsMask: UByte

Determines which bits in the options attribute should be overridden by optionsOverride.

optionsOverride: UByte

If the corresponding bit in optionsMask is set to 1, the bit set here overrides the corresponding bit in options attribute.

stepColorTemperature

suspend fun stepColorTemperature(
    stepMode: ColorControlTrait.HueStepMode,
    stepSize: UShort,
    transitionTime: UShort,
    colorTemperatureMinimumMireds: UShort,
    colorTemperatureMaximumMireds: UShort,
    optionsMask: UByte,
    optionsOverride: UByte
): Unit

Change a device's color temperature a specific amount over a period of time.

Parameters
stepMode: ColorControlTrait.HueStepMode

The direction in which to move the color temperature. This must be one of the values in HueStepMode.

stepSize: UShort

The amount of units to move the device's colorTemperatureMireds to.

transitionTime: UShort

The time (in 0.1 seconds) taken to move the device to the new color temperature.

colorTemperatureMinimumMireds: UShort

The lower bound of the colorTemperatureMireds attribute for the command. This value must be between the colorTempPhysicalMinMireds and colorTemperatureMireds attributes. If this value is set to 0, colorTempPhysicalMinMireds is used as the lower bound.

colorTemperatureMaximumMireds: UShort

The upper bound of the colorTemperatureMireds attribute for the command. This value must be between the colorTemperatureMireds and colorTempPhysicalMaxMireds attributes. If this value is set to 0, colorTempPhysicalMaxMireds is used as the upper bound.

optionsMask: UByte

Determines which bits in the options attribute should be overridden by optionsOverride.

optionsOverride: UByte

If the corresponding bit in optionsMask is set to 1, the bit set here overrides the corresponding bit in options attribute.

stepHue

suspend fun stepHue(
    stepMode: ColorControlTrait.HueStepMode,
    stepSize: UByte,
    transitionTime: UByte,
    optionsMask: UByte,
    optionsOverride: UByte
): Unit

Move a device's hue a specific amount over a period of time.

Parameters
stepMode: ColorControlTrait.HueStepMode

The direction in which to move the hue. This must be one of the values in HueStepMode.

stepSize: UByte

The amount of units to move the device's currentHue to.

transitionTime: UByte

The time (in 0.1 seconds) taken to move the device to the new hue.

optionsMask: UByte

Determines which bits in the options attribute should be overridden by optionsOverride.

optionsOverride: UByte

If the corresponding bit in optionsMask is set to 1, the bit set here overrides the corresponding bit in options attribute.

stepSaturation

suspend fun stepSaturation(
    stepMode: ColorControlTrait.SaturationStepMode,
    stepSize: UByte,
    transitionTime: UByte,
    optionsMask: UByte,
    optionsOverride: UByte
): Unit

Move a device's saturation a specific amount over a period of time.

Parameters
stepMode: ColorControlTrait.SaturationStepMode

The direction in which to move the saturation. This must be one of the values in SaturationStepMode.

stepSize: UByte

The amount of units to move the device's currentSaturation to.

transitionTime: UByte

The time (in 0.1 seconds) taken to move the device to the new saturation.

optionsMask: UByte

Determines which bits in the options attribute should be overridden by optionsOverride.

optionsOverride: UByte

If the corresponding bit in optionsMask is set to 1, the bit set here overrides the corresponding bit in options attribute.

stopMoveStep

suspend fun stopMoveStep(optionsMask: UByte, optionsOverride: UByte): Unit

Stop a MoveTo, Move, or Step command that is currently in process.

The currentHue, enhancedCurrentHue, and currentSaturation attributes are left at their present value upon receipt of this command, and the remainingTime attribute is set to 0.

Parameters
optionsMask: UByte

Determines which bits in the options attribute should be overridden by optionsOverride.

optionsOverride: UByte

If the corresponding bit in optionsMask is set to 1, the bit set here overrides the corresponding bit in options attribute.