ButtonPress / ButtonPressEx

Public Sub ButtonPress(button_name As String)

 

When a device is owned by your plug-in (see Creating Devices) and it is set up to display buttons, this procedure is called when a user presses one of the buttons.  See Device Buttons for information on creating buttons for a device.

 

Note that no other information is provided other than the button name, so it is difficult to support like buttons on several different devices without some creative button naming.  For this reason, HomeSeer version 2.0.2027.0 or later supports functionality to address this:

 

If your plug-in returns True to SupportsExtendedButtons, then ButtonPressEx will be called instead, and that procedure has this prototype:

 

Public Sub ButtonPressEx(button_name As String, dv As Object)

This procedure only applies to .NET plug-ins.

Check to make sure dv is valid, and you will then have access to all of the characteristics of the device object for determining what to do with the button press.