RCFC uses a Rest API to provide buttons to whatever the UI is.
This will return the following JSON information
{
"buttons": [
<button-1>,
<button-2>,
...
<button-n>
]
}
Each button will be its own JSON object, described below Every button will have the following:
- ID: a string used for uniquely identifying buttons
- Type: A string stating the type (described below)
- Groups: A list of strings stating the groups that the button belongs to (can be empty)
- Button-specific fields
A button that you can press, containing some text
Data:
{
"id": <id>,
"type": "button.simple",
"groups": "List of groups"
"text": <text of button>
}
The text is the text displayed on the actual button.
To interact with this button, send a POST request to /buttons/<id>
A button that can be flipped on/off.
Data:
{
"id": <id>,
"type": "button.toggle",
"groups": "List of groups"
"state": True/False
"text": "Label for the toggle"
}
To interact with this button, send a POST request to /buttons/<id> and pass it a json object {value: true/false}
A slider with a range Data:
{
"id": <id>,
"type": "input.slider",
"groups": "List of groups",
"state": current slider value,
"min": minimum of slider,
"max": maximum of slider,
"text": "Label for the slider"
}
To interact with this button, send a POST request to /buttons/<id> and pass it a json object {value: <value of slider>}
Arrows that can be left or right Data:
{
"id": <id>,
"type": "input.leftright",
"groups": "List of groups",
"text": "Label for the arrows"
}
To interact with this button, send a POST request to /buttons/<id> and pass it a json object {value: left/right>}
Allows for RGB values to be set Data:
{
"id": <id>,
"type": "input.colorpicker",
"groups": "List of groups",
"state": Current color
"text": "Label for the colorpicker"
}
To interact with this button, send a POST request to /buttons/<id> and pass it a json object {value: [red, green, blue]}, where red,green, and blue are values from 0 to 255.