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 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

      List<Scene> getScenes()
      Lists all scenes that can be used with this group.
      Returns:
      List of scenes.
    • getSceneByName

      Optional<Scene> getSceneByName​(String sceneName)
      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

      Optional<Light> getLightByName​(String lightName)
      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 does 0 turn them off.
      Parameters:
      brightness - A value from 1 (minimum brightness) to 100 (maximum brightness).
    • setState

      void setState​(UpdateState state)
      Sets a state for the light.
      Parameters:
      state - A state to be set for this light.
    • addLight

      Collection<Light> addLight​(Light newLight)
      Adds the given light into this group. Note that if the light already belongs to a room, you must remove it from there first, or this operation will fail!
      Parameters:
      newLight - The light to be added
      Returns:
      A Collection of Lights in this group after the operation.
    • removeLight

      Collection<Light> removeLight​(Light lightToBeRemoved)
      Removes the given light from this group.
      Parameters:
      lightToBeRemoved - The light to be removed
      Returns:
      A Collection of Lights in this group after the operation.