Class LightImpl
java.lang.Object
io.github.zeroone3010.yahueapi.v2.LightImpl
public class LightImpl extends Object implements Light
-
Constructor Summary
Constructors Constructor Description LightImpl(UUID id, LightResource light, Supplier<LightResource> stateProvider, Function<UpdateLight,String> stateSetter) -
Method Summary
Modifier and Type Method Description UUIDgetId()Returns the technical id of the light, as assigned by the Bridge.StringgetName()Returns the name of the light, as set by the user.Collection<EffectType>getSupportedEffects()The effects that this light supports.booleanisOn()Queries the light state.voidsetBrightness(int brightness)Sets the brightness of the light.voidsetState(UpdateState state)Sets a state for the light.StringtoString()voidturnOff()Turns the light off.voidturnOn()Turns the light on.
-
Constructor Details
-
LightImpl
public LightImpl(UUID id, LightResource light, Supplier<LightResource> stateProvider, Function<UpdateLight,String> stateSetter)
-
-
Method Details
-
getId
Description copied from interface:LightReturns the technical id of the light, as assigned by the Bridge. The id stays the same even if the light name is changed by the user.
-
getName
Description copied from interface:LightReturns the name of the light, as set by the user. -
turnOn
public void turnOn()Description copied from interface:LightTurns the light on. -
turnOff
public void turnOff()Description copied from interface:LightTurns the light off. -
isOn
public boolean isOn()Description copied from interface:LightQueries the light state. -
setBrightness
public void setBrightness(int brightness)Description copied from interface:LightSets the brightness of the light. If the light is off, does not turn it on, nor does0turn it off.- Specified by:
setBrightnessin interfaceLight- Parameters:
brightness- A value from1(minimum brightness) to100(maximum brightness).
-
setState
Description copied from interface:LightSets a state for the light. -
getSupportedEffects
Description copied from interface:LightThe effects that this light supports. May be empty but never null.- Specified by:
getSupportedEffectsin interfaceLight- Returns:
- A collection of supported effect types.
-
toString
-