Class UpdateState
public class UpdateState extends Object
-
Field Summary
Fields Modifier and Type Field Description static intLOWEST_POSSIBLE_BRIGHTNESSstatic intMAX_BRIGHTNESS -
Constructor Summary
Constructors Constructor Description UpdateState() -
Method Summary
Modifier and Type Method Description UpdateStatealert()Alerts, i.e.UpdateStatebrightness(int brightness)UpdateStateclearTimedEffect()Stops the timed effect.UpdateStatecolor(Color color)One way of setting the color of the light(s).UpdateStateeffect(EffectType effectType)Starts an effect, or stops it with theEffectType.NO_EFFECT.UpdateStategradient(List<Color> colors)Gradient color setting, for lights that support gradients.UpdateStateoff()Makes this state turn the light(s) off.UpdateStateon()Makes this state turn the light(s) on.UpdateStateon(boolean on)Toggles the on/off status of the light(s).UpdateStatesunrise(Duration duration)Starts the timed sunrise effect.UpdateStatetimedEffect(TimedEffectType effect, Duration duration)Starts a timed effect.UpdateStatexy(float x, float y)Other way of setting the color of the light(s): CIE XY gamut position.
-
Field Details
-
LOWEST_POSSIBLE_BRIGHTNESS
public static final int LOWEST_POSSIBLE_BRIGHTNESS- See Also:
- Constant Field Values
-
MAX_BRIGHTNESS
public static final int MAX_BRIGHTNESS- See Also:
- Constant Field Values
-
-
Constructor Details
-
UpdateState
public UpdateState()
-
-
Method Details
-
on
Makes this state turn the light(s) on.- Returns:
- This state, for easy chaining of different methods.
- See Also:
off(),on(boolean)
-
off
Makes this state turn the light(s) off.- Returns:
- This state, for easy chaining of different methods.
- See Also:
on(),on(boolean)
-
on
Toggles the on/off status of the light(s). -
brightness
- Parameters:
brightness- Brightness, from 0 to 100, 0 setting brightness to the lowest possible value.- Returns:
- This state, for easy chaining of different methods.
-
color
One way of setting the color of the light(s).- Parameters:
color- AColorobject to specify a color.- Returns:
- This state, for easy chaining of different methods.
- See Also:
xy(float, float)
-
xy
Other way of setting the color of the light(s): CIE XY gamut position.- Parameters:
x- A value from 0 to 1.y- A value from 0 to 1.- Returns:
- This state, for easy chaining of different methods.
- See Also:
color(Color)
-
effect
Starts an effect, or stops it with theEffectType.NO_EFFECT. Note that not all lights, not even all the color ones, support effects. You may check the supported effects with theLight.getSupportedEffects()method. Also note that rooms and zones do not support effects.- Parameters:
effectType- Type of effect.- Returns:
- This state, for easy chaining of different methods.
-
alert
Alerts, i.e. flashes the light a few times.- Returns:
- This state, for easy chaining of different methods.
-
sunrise
Starts the timed sunrise effect. The maximum duration is six hours. The timed effect may be stopped with the
clearTimedEffect()method.Note that not all lights, not even all the color ones, support timed effects. Also note that rooms and zones do not support timed effects.
- Parameters:
duration- Duration of the sunrise effect.- Returns:
- This state, for easy chaining of different methods.
- See Also:
clearTimedEffect()
-
clearTimedEffect
Stops the timed effect.
Note that not all lights, not even all the color ones, support timed effects. Also note that rooms and zones do not support timed effects.
- Returns:
- This state, for easy chaining of different methods.
- See Also:
sunrise(Duration)
-
timedEffect
Starts a timed effect. As of December 2022, "sunrise" and "no effect" are the only two options that the Bridge offers. There are helper methods for both of those in this class, but this method exists here for extra convenience so that you can start and stop the effect with the same method, just changing the parameters.
Note that not all lights, not even all the color ones, support timed effects. Also note that rooms and zones do not support timed effects.
- Parameters:
effect- Type of the effect.duration- How long should the effect last.- Returns:
- This state, for easy chaining of different methods.
- See Also:
sunrise(Duration),clearTimedEffect()
-
gradient
Gradient color setting, for lights that support gradients. There must be exactly two, three, four, or five colors in the list.- Parameters:
colors- A List ofColorobjects to specify the colors. List length must be between 2 and 5, inclusive.- Returns:
- This state, for easy chaining of different methods.
-