Package io.github.zeroone3010.yahueapi
Interface Room
public interface Room
A room, a zone, or another type of group that has been configured into the Hue Bridge.
-
Method Summary
Modifier and Type Method Description java.util.Optional<Light>getLightByName(java.lang.String lightName)Returns one light, if found by the given name.java.util.Collection<Light>getLights()Returns all the lights that have been assigned to this group.java.lang.StringgetName()Returns the name of the room or zone, as set by the user.java.util.Optional<Scene>getSceneByName(java.lang.String sceneName)Returns one scene, if found by the given name.java.util.Collection<Scene>getScenes()Returns the scenes that belong to this group.GroupTypegetType()Returns the type of this group of lights, whether it is a room, a zone, or something else.booleanisAllOn()Queries the state of the group.booleanisAnyOn()Queries the state of the group of lights.voidsetBrightness(int brightness)Sets the brightness of the group.voidsetState(State state)Sets a state for the group.voidturnOff()Turns the lights off.voidturnOn()Turns the lights on.
-
Method Details
-
getName
java.lang.String getName()Returns the name of the room or zone, as set by the user.- Returns:
- Name of the room or zone.
-
getLights
java.util.Collection<Light> getLights()Returns all the lights that have been assigned to this group.- Returns:
- A Collection of Light objects.
-
getLightByName
Returns one light, if found by the given name.- Parameters:
lightName- Name of a light in this group.- Returns:
- Optional.empty() if a light is not found by this name, an Optional<Light> if it is.
-
isAnyOn
boolean isAnyOn()Queries the state of the group of lights.- Returns:
- True if any light is on in this group, false if not.
-
isAllOn
boolean isAllOn()Queries the state of the group.- Returns:
- True if all lights in this group are on, false if they are not.
-
turnOn
void turnOn()Turns the lights on. -
turnOff
void turnOff()Turns the lights off. -
setState
Sets a state for the group.- Parameters:
state- A state to be set for this group.
-
setBrightness
void setBrightness(int brightness)Sets the brightness of the group. If the lights in the group are off, does not turn them on, nor does0turn them off.- Parameters:
brightness- A value from0(minimum brightness) to254(maximum brightness).- Since:
- 1.2.0
-
getType
GroupType getType()Returns the type of this group of lights, whether it is a room, a zone, or something else.- Returns:
- The type of this group of lights.
- Since:
- 1.3.0
-
getScenes
java.util.Collection<Scene> getScenes()Returns the scenes that belong to this group.- Returns:
- The scenes of this group.
- Since:
- 1.3.0
-
getSceneByName
Returns one scene, if found by the given name.- Parameters:
sceneName- Name of the scene, e.g. "Tropical twilight" or "Concentrate".- Returns:
- Optional.empty() if a scene is not found by this name, an Optional<Scene> if it is.
- Since:
- 1.3.0
-