Interface Switch

All Superinterfaces:
Device
All Known Implementing Classes:
SwitchImpl

public interface Switch
extends Device
Any switch with one or more buttons, such as a Philips Hue dimmer switch or a Philips Hue Tap switch.
Since:
3.0.0
  • Method Details

    • getId

      UUID getId()

      Returns the technical id of the switch, as assigned by the Bridge. The id stays the same even if the switch name is changed by the user.

      Specified by:
      getId in interface Device
      Returns:
      Id of the switch.
    • getButtons

      Map<UUID,​Button> getButtons()
      Lists the buttons of this switch.
      Returns:
      A map of buttons on this switch, keys being the UUIDs of the buttons.
    • getName

      String getName()
      Returns the name of the switch, as set by the user.
      Specified by:
      getName in interface Device
      Returns:
      Name of the switch.
    • getLatestPressedButton

      Optional<Button> getLatestPressedButton()

      The latest button that was pressed. Use Button.getLatestEvent() for the exact event then. The resulting Optional<ButtonEventType> is guaranteed to have a value if this Optional<Button> has a value.

      Returns:
      May be empty if no button has been pressed on this switch.