Class SwitchImpl

java.lang.Object
io.github.zeroone3010.yahueapi.v2.SwitchImpl
All Implemented Interfaces:
Device, Switch

public class SwitchImpl
extends Object
implements Switch
  • Constructor Details

  • Method Details

    • getId

      public UUID getId()
      Description copied from interface: Switch

      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
      Specified by:
      getId in interface Switch
      Returns:
      Id of the switch.
    • getButtons

      public Map<UUID,​Button> getButtons()
      Description copied from interface: Switch
      Lists the buttons of this switch.
      Specified by:
      getButtons in interface Switch
      Returns:
      A map of buttons on this switch, keys being the UUIDs of the buttons.
    • getName

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

      public Optional<Button> getLatestPressedButton()
      Description copied from interface: Switch

      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.

      Specified by:
      getLatestPressedButton in interface Switch
      Returns:
      May be empty if no button has been pressed on this switch.
    • toString

      public String toString()
      Overrides:
      toString in class Object