Skip to main content
Version: 1.0

Button

The virtual Button component is used to simulate button events same as Input component. It uses Button as RPC namespace and has the following methods:

Methods​

Button.SetConfig​

PropertyTypeDescription

id

number

Id of the component instance Required

config

object

Configuration that the method takes Required

Find more about the config properties in config section

Button.GetConfig​

Parameters:

PropertyTypeDescription

id

number

Id of the component instance Required

Find the Button.GetConfig response properties in config section

Button.Trigger​

Parameters:

PropertyTypeDescription

id

number

Id of the component instance Required

event

string

Event name. Range of values: single_push, double_push, triple_push, long_push Required

Button.GetStatus​

Parameters:

PropertyTypeDescription

id

number

Id of the component instance

Find more about the status response properties in status section

Configuration​

The configuration of the Button component contains properties of how it will be rendered in the UI. To Get/Set the configuration of the Button component its id must be specified.

Parameters:

PropertyTypeDescription

id

number

Id of the component instance

name

string or null

Name of the component instance

meta

object or null

Stores the component's metadata

Status​

The status of the Button component is empty.

Webhook Events​

Currently, these are the events related to the Button component that can trigger webhooks:

  • button.single_push
  • button.double_push
  • button.triple_push
  • button.long_push

Examples​

Button.SetConfig example​

http://192.168.33.1/rpc/Button.SetConfig?id=200&config={"name":"Button 1"}

Response

{
"restart_required": false
}

Button.GetConfig example​

http://192.168.33.1/rpc/Button.GetConfig?id=200

Response

{
"id": 200,
"name": "Button 1",
"meta": null
}

Button.Trigger example​

http://192.168.33.1/rpc/Button.Trigger?id=200&event="single_push"

Response

null

Button.GetStatus example​

http://192.168.33.1/rpc/Button.GetStatus?id=200

Response

{}