mirror of
https://github.com/esphome/esphome-docs.git
synced 2025-01-13 20:11:53 +01:00
Add docs for rotary encoder on_clockwise and on_anticlockwise triggers (#807)
This commit is contained in:
parent
9c375048f3
commit
72aa6a1281
@ -59,6 +59,10 @@ Configuration variables:
|
||||
the knob further will not decrease the number. Defaults to no minimum.
|
||||
- **max_value** (*Optional*, int): The maximum value this rotary encoder will go to, turning
|
||||
the knob further will not increase the number. Defaults to no maximum.
|
||||
- **on_clockwise** (*Optional*, :ref:`Automation <automation>`): Actions to be performed when
|
||||
the knob is turned clockwise. See :ref:`sensor-rotary_encoder-triggers`.
|
||||
- **on_anticlockwise** (*Optional*, :ref:`Automation <automation>`): Actions to be performed when
|
||||
the knob is turned anticlockwise. See :ref:`sensor-rotary_encoder-triggers`.
|
||||
- All other options from :ref:`Sensor <config-sensor>`.
|
||||
|
||||
.. _sensor-rotary_encoder-set_value_action:
|
||||
@ -95,6 +99,23 @@ Configuration options:
|
||||
- **value** (**Required**, int, :ref:`templatable <config-templatable>`):
|
||||
The value to set the internal counter to.
|
||||
|
||||
.. _sensor-rotary_encoder-triggers:
|
||||
|
||||
``on_clockwise`` and ``on_anticlockwise`` Triggers
|
||||
--------------------------------------------------
|
||||
|
||||
With these configuration options, you can run automations based on the direction
|
||||
that the encoder has been turned, and not the value that it currently holds.
|
||||
These triggers ignore the min and max values and will trigger on every step.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
on_clockwise:
|
||||
- logger.log: "Turned Clockwise"
|
||||
on_anticlockwise:
|
||||
- logger.log: "Turned Anticlockwise"
|
||||
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user