Package io.github.zeroone3010.yahueapi
Interface Light
public interface Light
-
Method Summary
Modifier and Type Method Description java.lang.StringgetName()Returns the name of the light, as set by the user.StategetState()Gets the state of the light -- or returns the cached state if caching has been enabled withHue.setCaching(boolean).LightTypegetType()Returns info on the type of the light.booleanisOn()Queries the light state -- or returns the cached state if caching has been enabled withHue.setCaching(boolean).booleanisReachable()Queries the reachability of the light -- or returns the cached state if caching has been enabled withHue.setCaching(boolean).voidsetBrightness(int brightness)Sets the brightness of the light.voidsetState(State state)Sets a state for the light.voidturnOff()Turns the light off.voidturnOn()Turns the light on.
-
Method Details
-
getName
java.lang.String getName()Returns the name of the light, as set by the user.- Returns:
- Name of the light.
-
turnOn
void turnOn()Turns the light on. -
turnOff
void turnOff()Turns the light off. -
isOn
boolean isOn()Queries the light state -- or returns the cached state if caching has been enabled withHue.setCaching(boolean).- Returns:
- True if the light is on, false if it is off.
-
isReachable
boolean isReachable()Queries the reachability of the light -- or returns the cached state if caching has been enabled withHue.setCaching(boolean).- Returns:
- True if the light is reachable, false if it is not.
-
setBrightness
void setBrightness(int brightness)Sets the brightness of the light. If the light is off, does not turn it on, nor does0turn it off.- Parameters:
brightness- A value from0(minimum brightness) to254(maximum brightness).
-
getType
LightType getType()Returns info on the type of the light.- Returns:
- An enum value specifying the color and dimming capabilities of the light.
-
setState
Sets a state for the light.- Parameters:
state- A state to be set for this light.
-
getState
State getState()Gets the state of the light -- or returns the cached state if caching has been enabled withHue.setCaching(boolean).- Returns:
- The current state of the light.
-