LevelControlCommands

interface LevelControlCommands

Known direct subclasses
LevelControl

API for the LevelControl trait.


Summary

Public functions

suspend Unit
move(
    moveMode: LevelControlTrait.MoveModeEnum,
    rate: UByte?,
    optionsMask: LevelControlTrait.OptionsBitmap,
    optionsOverride: LevelControlTrait.OptionsBitmap
)

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

suspend Unit

Change a device's current frequency.

suspend Unit
moveToLevel(
    level: UByte,
    transitionTime: UShort?,
    optionsMask: LevelControlTrait.OptionsBitmap,
    optionsOverride: LevelControlTrait.OptionsBitmap
)

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

suspend Unit
moveToLevelWithOnOff(
    level: UByte,
    transitionTime: UShort?,
    optionsMask: LevelControlTrait.OptionsBitmap,
    optionsOverride: LevelControlTrait.OptionsBitmap
)

Move a device from its current level to the provided level and toggle the onOff attribute of the OnOff cluster depending on the end value of currentLevel.

suspend Unit
moveWithOnOff(
    moveMode: LevelControlTrait.MoveModeEnum,
    rate: UByte?,
    optionsMask: LevelControlTrait.OptionsBitmap,
    optionsOverride: LevelControlTrait.OptionsBitmap
)

Move a device's level based on a rate of movement and toggle the onOff attribute of the OnOff cluster depending on the end value of currentLevel.

suspend Unit
step(
    stepMode: LevelControlTrait.StepModeEnum,
    stepSize: UByte,
    transitionTime: UShort?,
    optionsMask: LevelControlTrait.OptionsBitmap,
    optionsOverride: LevelControlTrait.OptionsBitmap
)

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

suspend Unit
stepWithOnOff(
    stepMode: LevelControlTrait.StepModeEnum,
    stepSize: UByte,
    transitionTime: UShort?,
    optionsMask: LevelControlTrait.OptionsBitmap,
    optionsOverride: LevelControlTrait.OptionsBitmap
)

Move a device's level a specific amount over a period of time and toggle the onOff attribute of the OnOff cluster depending on the end value of currentLevel.

suspend Unit
stop(
    optionsMask: LevelControlTrait.OptionsBitmap,
    optionsOverride: LevelControlTrait.OptionsBitmap
)

Terminate a Move, MoveToLevel, or Step command (including their OnOff variants) currently in progress, and sets the remainingTime attribute to 0.

suspend Unit
stopWithOnOff(
    optionsMask: LevelControlTrait.OptionsBitmap,
    optionsOverride: LevelControlTrait.OptionsBitmap
)

Terminate a Move, MoveToLevel, or Step command (including their OnOff variants) currently in progress, and sets the remainingTime attribute to 0.

Public functions

move

suspend fun move(
    moveMode: LevelControlTrait.MoveModeEnum,
    rate: UByte?,
    optionsMask: LevelControlTrait.OptionsBitmap,
    optionsOverride: LevelControlTrait.OptionsBitmap
): Unit

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

Parameters
moveMode: LevelControlTrait.MoveModeEnum

The direction in which to move the level. This must be one of the values in LevelControlTrait.MoveModeEnum.

rate: UByte?

The rate (in units per seconds) used to move the device's currentLevel to the minLevel or maxLevel.

optionsMask: LevelControlTrait.OptionsBitmap

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

optionsOverride: LevelControlTrait.OptionsBitmap

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

moveToClosestFrequency

suspend fun moveToClosestFrequency(frequency: UShort): Unit

Change a device's current frequency.

Parameters
frequency: UShort

The frequency to change the currentFrequency to.

moveToLevel

suspend fun moveToLevel(
    level: UByte,
    transitionTime: UShort?,
    optionsMask: LevelControlTrait.OptionsBitmap,
    optionsOverride: LevelControlTrait.OptionsBitmap
): Unit

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

Parameters
level: UByte

The level to move the device to.

transitionTime: UShort?

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

optionsMask: LevelControlTrait.OptionsBitmap

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

optionsOverride: LevelControlTrait.OptionsBitmap

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

moveToLevelWithOnOff

suspend fun moveToLevelWithOnOff(
    level: UByte,
    transitionTime: UShort?,
    optionsMask: LevelControlTrait.OptionsBitmap,
    optionsOverride: LevelControlTrait.OptionsBitmap
): Unit

Move a device from its current level to the provided level and toggle the onOff attribute of the OnOff cluster depending on the end value of currentLevel.

If this command sets the currentLevel above the minLevel, the onOff attribute is set to true.

If this command sets the currentLevel to the minLevel, the onOff attribute is set to false.

Parameters
level: UByte

The level to move the device to.

transitionTime: UShort?

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

optionsMask: LevelControlTrait.OptionsBitmap

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

optionsOverride: LevelControlTrait.OptionsBitmap

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

moveWithOnOff

suspend fun moveWithOnOff(
    moveMode: LevelControlTrait.MoveModeEnum,
    rate: UByte?,
    optionsMask: LevelControlTrait.OptionsBitmap,
    optionsOverride: LevelControlTrait.OptionsBitmap
): Unit

Move a device's level based on a rate of movement and toggle the onOff attribute of the OnOff cluster depending on the end value of currentLevel.

If this command sets the currentLevel above the minLevel, the onOff attribute is set to true.

If this command sets the currentLevel to the minLevel, the onOff attribute is set to false.

Parameters
moveMode: LevelControlTrait.MoveModeEnum

The direction in which to move the level. This must be one of the values in LevelControlTrait.MoveModeEnum.

rate: UByte?

The rate (in units per seconds) used to move the device's currentLevel to the minLevel or maxLevel.

optionsMask: LevelControlTrait.OptionsBitmap

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

optionsOverride: LevelControlTrait.OptionsBitmap

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

step

suspend fun step(
    stepMode: LevelControlTrait.StepModeEnum,
    stepSize: UByte,
    transitionTime: UShort?,
    optionsMask: LevelControlTrait.OptionsBitmap,
    optionsOverride: LevelControlTrait.OptionsBitmap
): Unit

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

If the stepSize used results in a currentLevel that is greater than the maxLevel or less than the minLevel, then the command stops when the currentLevel reaches the maxLevel or minLevel, respectively.

The command may complete in a shorter time than specified for transitionTime if the maxLevel or minLevel is reached before the transition time is over.

Parameters
stepMode: LevelControlTrait.StepModeEnum

The direction in which to move the level. This must be one of the values in LevelControlTrait.StepModeEnum.

stepSize: UByte

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

transitionTime: UShort?

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

optionsMask: LevelControlTrait.OptionsBitmap

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

optionsOverride: LevelControlTrait.OptionsBitmap

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

stepWithOnOff

suspend fun stepWithOnOff(
    stepMode: LevelControlTrait.StepModeEnum,
    stepSize: UByte,
    transitionTime: UShort?,
    optionsMask: LevelControlTrait.OptionsBitmap,
    optionsOverride: LevelControlTrait.OptionsBitmap
): Unit

Move a device's level a specific amount over a period of time and toggle the onOff attribute of the OnOff cluster depending on the end value of currentLevel.

If the stepSize used results in a currentLevel that is greater than the maxLevel or less than the minLevel, then the command stops when the currentLevel reaches the maxLevel or minLevel, respectively.

The command may complete in a shorter time than specified for transitionTime if the maxLevel or minLevel is reached before the transition time is over.

If this command sets the currentLevel above the minLevel, the onOff attribute is set to true.

If this command sets the currentLevel to the minLevel, the onOff attribute is set to false.

Parameters
stepMode: LevelControlTrait.StepModeEnum

The direction in which to move the level. This must be one of the values in LevelControlTrait.StepModeEnum.

stepSize: UByte

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

transitionTime: UShort?

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

optionsMask: LevelControlTrait.OptionsBitmap

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

optionsOverride: LevelControlTrait.OptionsBitmap

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

stop

suspend fun stop(
    optionsMask: LevelControlTrait.OptionsBitmap,
    optionsOverride: LevelControlTrait.OptionsBitmap
): Unit

Terminate a Move, MoveToLevel, or Step command (including their OnOff variants) currently in progress, and sets the remainingTime attribute to 0.

This command and StopWithOnOff are identical.

Parameters
optionsMask: LevelControlTrait.OptionsBitmap

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

optionsOverride: LevelControlTrait.OptionsBitmap

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

stopWithOnOff

suspend fun stopWithOnOff(
    optionsMask: LevelControlTrait.OptionsBitmap,
    optionsOverride: LevelControlTrait.OptionsBitmap
): Unit

Terminate a Move, MoveToLevel, or Step command (including their OnOff variants) currently in progress, and sets the remainingTime attribute to 0.

This command and Stop are identical.

Parameters
optionsMask: LevelControlTrait.OptionsBitmap

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

optionsOverride: LevelControlTrait.OptionsBitmap

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