From 12f0886920708b7b0851ea528a3dda4141c83bd0 Mon Sep 17 00:00:00 2001 From: Tim Niemueller Date: Wed, 3 Nov 2021 17:56:23 +0100 Subject: [PATCH] ili9341: document auto_clear_enabled flag (#1568) Also reference in section about rendering engine. Co-authored-by: Tim Niemueller --- components/display/ili9341.rst | 2 ++ components/display/index.rst | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/components/display/ili9341.rst b/components/display/ili9341.rst index 78f8366dc..e48bf31f4 100644 --- a/components/display/ili9341.rst +++ b/components/display/ili9341.rst @@ -56,6 +56,8 @@ Configuration variables: - **lambda** (*Optional*, :ref:`lambda `): The lambda to use for rendering the content on the display. See :ref:`display-engine` for more information. - **update_interval** (*Optional*, :ref:`config-time`): The interval to re-draw the screen. Defaults to ``5s``. +- **auto_clear_enabled** (*Optional*, boolean): Whether to automatically clear the display in each loop (''true'', default), + or to keep the existing display content (must overwrite explicitly, e.g., only on data change). - **pages** (*Optional*, list): Show pages instead of a single lambda. See :ref:`display-pages`. - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. diff --git a/components/display/index.rst b/components/display/index.rst index b6d50e9f5..b312ba18c 100644 --- a/components/display/index.rst +++ b/components/display/index.rst @@ -35,7 +35,9 @@ individually. So, first a few basics: When setting up a display platform in ESPHome there will be a configuration option called ``lambda:`` which will be called every time ESPHome wants to re-render the display. -In there, you can write code like in any :ref:`lambda ` in ESPHome. Display +In each cycle, the display is automatically cleared before the lambda is executed. You can disable +this behavior by setting ``auto_clear_enabled: false``. +In the lambda, you can write code like in any :ref:`lambda ` in ESPHome. Display lambdas are additionally passed a variable called ``it`` which represents the rendering engine object. .. code-block:: yaml