Add select and button to REST API docs (#1805)

This commit is contained in:
Jesse Hills 2022-01-17 11:50:14 +13:00 committed by GitHub
parent 6769f4be6b
commit aa80622136
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -249,3 +249,29 @@ can be used:
Creating a POST request to ``/cover/front_window_blinds/set?position=0.1&tilt=0.3`` will Creating a POST request to ``/cover/front_window_blinds/set?position=0.1&tilt=0.3`` will
start moving the blinds towards an almost completely closed position and a new tilt start moving the blinds towards an almost completely closed position and a new tilt
angle. angle.
Select
******
Selects can be set to an option and will return their current option. For example sending
a GET request to ``/select/house_mode`` could yield this payload:
.. code-block:: json
{
"id": "select-house_mode",
"state": "party",
"value": "party"
}
POST requests on the other hand allow setting the select, the available
method is ``set``. The following parameter can be used:
- **option**: The string option to set it to. Must be a valid option.
For example POST ``/select/house_mode/set?option=guest`` will set the select to ``guest``.
Button
******
A button can be ``pressed`` from the REST API by sending a POST request to ``button/do_something/press``.