mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-12-26 17:27:47 +01:00
Add select and button to REST API docs (#1805)
This commit is contained in:
parent
6769f4be6b
commit
aa80622136
@ -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``.
|
||||||
|
Loading…
Reference in New Issue
Block a user