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 Summary
Modifier and Type Method Description Map<UUID,Button>getButtons()Lists the buttons of this switch.UUIDgetId()Returns the technical id of the switch, as assigned by the Bridge.Optional<Button>getLatestPressedButton()The latest button that was pressed.StringgetName()Returns the name of the switch, as set by the user.
-
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.
-
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. -
getLatestPressedButton
The latest button that was pressed. Use
Button.getLatestEvent()for the exact event then. The resultingOptional<ButtonEventType>is guaranteed to have a value if thisOptional<Button>has a value.- Returns:
- May be empty if no button has been pressed on this switch.
-