public static class CapabilityColor.SetRgb extends Command<CapabilityColor.CommandId>
Capability.sendResourceCommand(buzz.getcoco.iot.Command<T>, buzz.getcoco.iot.Capability.CommandStatusListener<T>) to set RGB for Resource such as color bulb.
capabilityColor = colorBulbResource.getCapability(Capability.COLOR_CTRL);
CapabilityColor.SetRgb rgb = new CapabilityColor.SetRgb(true);
rgb.red = 100;
rgb.green = 50;
rgb.blue = 190;
capabilityColor.sendResourceCommand(
rgb,
(commandResponse, tr) -> {
if (null != tr) {
// success case.
}
});
Command.State| Modifier and Type | Field and Description |
|---|---|
int |
blue
The Blue element to be set in the RGB color scale.
|
int |
green
The Green element to be set in the RGB color scale.
|
int |
red
The Red element to be set in the RGB color scale.
|
int |
transitionTime
Transition duration in milliseconds from the current level to the
levelPct value.
|
boolean |
useDefaultTransitionTime
A flag that represents if default transition duration from
current level to level pct shall be used.
|
| Constructor and Description |
|---|
SetRgb(boolean useDefaultTransitionTime)
Constructor of this class.
|
getCommandId, getTimeout, setCommandId, setTimeout, toJsonObject, toString@SerializedName(value="red") public int red
@SerializedName(value="green") public int green
@SerializedName(value="blue") public int blue
@SerializedName(value="useDefaultTransTimeFlag") public boolean useDefaultTransitionTime
@SerializedName(value="transitionTimeMs") public int transitionTime