Skip to content

[LVGL] New input group handling + new Encoder/Keypad set_group action #5086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: next
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions components/lvgl/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ The following configuration variables apply to the main ``lvgl`` component, in o
- **touchscreen_id** (**Required**, :ref:`config-id`): ID of a touchscreen configuration related to a display.
- **long_press_time** (*Optional*, :ref:`Time <config-time>`): For the touchscreen, delay after which the ``on_long_pressed`` :ref:`interaction trigger <lvgl-automation-triggers>` will be called. Defaults to ``400ms``.
- **long_press_repeat_time** (*Optional*, :ref:`Time <config-time>`): For the touchscreen, repeated interval after ``long_press_time``, when ``on_long_pressed_repeat`` :ref:`interaction trigger <lvgl-automation-triggers>` will be called. Defaults to ``100ms``.
- **groups** (*Optional*, list, string): All available groups for widgets, encoders and keypads. See the :doc:`common properties </components/lvgl/widgets>` of the widgets for more information on groups.
- **encoders** (*Optional*, list): A list of rotary encoders interacting with the LVGL widgets on the display.
- **group** (*Optional*, string): A name for a group of widgets which will interact with the the input device. See the :doc:`common properties </components/lvgl/widgets>` of the widgets for more information on groups.
- **group** (*Optional*, string): A name for a group of widgets which will interact with the the input device. This **must** match one of the groups defined in the `groups` list. See the :doc:`common properties </components/lvgl/widgets>` of the widgets for more information on groups.
- **initial_focus** (*Optional*, :ref:`config-id`): An optional ID for a widget to be given focus on startup (especially useful if there is only one focusable widget.)
- **enter_button** (**Required**, :ref:`config-id`): The ID of a :doc:`Binary Sensor </components/binary_sensor/index>`, to be used as ``ENTER`` key.
- **sensor** (*Optional*, :ref:`config-id`): The ID of a :doc:`/components/sensor/rotary_encoder`; or a list with buttons for left/right interaction with the widgets:
Expand All @@ -118,7 +119,7 @@ The following configuration variables apply to the main ``lvgl`` component, in o
- **long_press_time** (*Optional*, :ref:`Time <config-time>`): For the rotary encoder, delay after which the ``on_long_pressed`` :ref:`interaction trigger <lvgl-automation-triggers>` will be called. Defaults to ``400ms``. Can be disabled with ``never``.
- **long_press_repeat_time** (*Optional*, :ref:`Time <config-time>`): For the rotary encoder, repeated interval after ``long_press_time``, when ``on_long_pressed_repeat`` :ref:`interaction trigger <lvgl-automation-triggers>` will be called. Defaults to ``100ms``. Can be disabled with ``never``.
- **keypads** (*Optional*, list): A list of keypads interacting with the LVGL widgets on the display.
- **group** (*Optional*, string): A name for a group of widgets which will interact with the the input device. See the :doc:`common properties </components/lvgl/widgets>` of the widgets for more information on groups.
- **group** (*Optional*, string): A name for a group of widgets which will interact with the the input device. This **must** match one of the groups defined in the `groups` list. See the :doc:`common properties </components/lvgl/widgets>` of the widgets for more information on groups.
- **up** (*Optional*, :ref:`config-id`): The ID of a :doc:`Binary Sensor </components/binary_sensor/index>`, to be used as ``UP`` key.
- **down** (*Optional*, :ref:`config-id`): The ID of a :doc:`Binary Sensor </components/binary_sensor/index>`, to be used as ``DOWN`` key.
- **right** (*Optional*, :ref:`config-id`): The ID of a :doc:`Binary Sensor </components/binary_sensor/index>`, to be used as ``RIGHT`` key.
Expand Down Expand Up @@ -926,6 +927,39 @@ The ``mark`` action will save the currently focused widget within the group, and
then:
- lvgl.widget.focus: previous

``lvgl.encoder.set_group``
**************************

This :ref:`action <actions-action>` sets the group for an encoder. This is useful for organizing encoders into specific groups for focused input handling.

- **id** (**Required**): The ID of the encoder to be configured.
- **group** (**Required**): The name of the group to assign the encoder to. This must match one of the groups defined in the `groups` list.

.. code-block:: yaml

on_...:
then:
- lvgl.encoder.set_group:
id: my_encoder
group: encoder_group


``lvgl.keypad.set_group``
*************************

This :ref:`action <actions-action>` sets the group for a keypad. This is useful for organizing keypads into specific groups for focused input handling.

- **id** (**Required**): The ID of the keypad to be configured.
- **group** (**Required**): The name of the group to assign the keypad to. This must match one of the groups defined in the `groups` list.

.. code-block:: yaml

on_...:
then:
- lvgl.keypad.set_group:
id: my_keypad
group: keypad_group


.. _lvgl-conditions:

Expand Down