From 6a3c4ef63fc2b22149ee737a60c9e37d7d4bb55e Mon Sep 17 00:00:00 2001 From: niklasweber Date: Tue, 2 Nov 2021 19:32:30 +0100 Subject: [PATCH] Add restore_mode to rotary_encoder sensor (#1584) --- components/sensor/rotary_encoder.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/sensor/rotary_encoder.rst b/components/sensor/rotary_encoder.rst index 772ef7fb7..d2a4f96ee 100644 --- a/components/sensor/rotary_encoder.rst +++ b/components/sensor/rotary_encoder.rst @@ -63,6 +63,13 @@ Configuration variables: upon start of ESPHome. By default the value is only published when it changes, causing an "unknown" value at first. If you set this option to true, the value is published once after boot and when it changes. Defaults to ``false``. +- **restore_mode** (*Optional*): Control how the Rotary Encoder attempts to restore state on bootup. + For restoring on ESP8266s, also see ``esp8266_restore_from_flash`` in the + :doc:`esphome section `. + + - ``RESTORE_DEFAULT_ZERO`` (Default) - Attempt to restore state and default to zero (0) if not possible to restore. + - ``ALWAYS_ZERO`` - Always initialize the counter with value zero (0). + - **on_clockwise** (*Optional*, :ref:`Automation `): Actions to be performed when the knob is turned clockwise. See :ref:`sensor-rotary_encoder-triggers`. - **on_anticlockwise** (*Optional*, :ref:`Automation `): Actions to be performed when