Interface Group
- All Known Implementing Classes:
GroupImpl
public interface Group
A group of lights, i.e. a room, a zone, or a "grouped light", such as a ceiling fixture with multiple bulbs.
- Since:
- 3.0.0
-
Method Summary
Modifier and Type Method Description UUIDgetId()Returns the technical id of the room, zone, or light group, as assigned by the Bridge.Optional<Light>getLightByName(String lightName)Returns one light, if found by the given name.Collection<Light>getLights()Returns all the lights that have been assigned to this group.StringgetName()Returns the name of the room or zone, as set by the user.Optional<Scene>getSceneByName(String sceneName)Returns the scene matching the given human-readable name, if one exists.List<Scene>getScenes()Lists all scenes that can be used with this group.ResourceTypegetType()Returns the type of this group, whether it is a room, zone, or grouped light.booleanisAnyOn()Queries the state of the group of lights.voidsetBrightness(int brightness)Sets the brightness of the lights.voidsetState(UpdateState state)Sets a state for the light.voidturnOff()Turns the lights off.voidturnOn()Turns the lights on.
-
Method Details
-
getId
UUID getId()Returns the technical id of the room, zone, or light group, as assigned by the Bridge. The id stays the same even if the room name is changed by the user.
- Returns:
- Id of the room/zone/light group.
-
getName
String getName()Returns the name of the room or zone, as set by the user.- Returns:
- Name of the room or zone.
-
getScenes
Lists all scenes that can be used with this group.- Returns:
- List of scenes.
-
getSceneByName
Returns the scene matching the given human-readable name, if one exists.- Parameters:
sceneName- The human-readable name of the scene- Returns:
- Optional Scene
-
getLights
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.
-
getType
ResourceType getType()Returns the type of this group, whether it is a room, zone, or grouped light.- Returns:
- The type of this group of lights.
-
isAnyOn
boolean isAnyOn()Queries the state of the group of lights.- Returns:
- True if any light is on in this group, false if not.
-
turnOn
void turnOn()Turns the lights on. -
turnOff
void turnOff()Turns the lights off. -
setBrightness
void setBrightness(int brightness)Sets the brightness of the lights. If the lights are off, does not turn them on, nor does0turn them off.- Parameters:
brightness- A value from1(minimum brightness) to100(maximum brightness).
-
setState
Sets a state for the light.- Parameters:
state- A state to be set for this light.
-