Skip to content

Updating Rooms

Maxi Zink edited this page Feb 13, 2022 · 2 revisions

Info

Updating Rooms does work exactly like updating Lamps.

Usage

private void updateRooms(final HueBridge hueBridge) {
  HueRoomDiscovery hueRoomDiscovery = ServiceAccessor.accessService(HueRoomDiscovery.class);

  Optional<HueRoom> hueRoomByName = hueBridge.getHueRoomByName("Room");
    hueRoomByName.ifPresent(hueRoom -> {
    hueRoom.turnOn();
     
    hueRoom.updateRoomLamps(LampUpdateType.COLOR, Color.RED);
    hueRoom.updateRoomLamps(LampUpdateType.BRIGHTNESS, 50);
  });
}