Skip to content

Commit

Permalink
add qrcode lvgl widget (#4347)
Browse files Browse the repository at this point in the history
  • Loading branch information
nagyrobi authored Oct 28, 2024
1 parent 9eee18e commit c841607
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions components/lvgl/widgets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,50 @@ You can use it as a parent container for other widgets. By default, it catches t
widgets:
- ...
.. _lvgl-widget-qrcode:

``qrcode``
----------

Use this widget to generate and display a QR-code containing a string at run time.

**Configuration variables:**

- **text** (**Required**, string): The string to be encoded in the QR.
- **size** (**Required**, int16): Set the desired size of the QR-code (in pixels). QR-codes with less data are smaller, but they scaled by an integer number to best fit to the given size.
- **light_color** (*Optional*, :ref:`color <lvgl-color>`): Color for the light areas of the QR. Defaults to white.
- **dark_color** (*Optional*, :ref:`color <lvgl-color>`): Color for the dark areas of the QR. Defaults to black.
- Style options from :ref:`lvgl-styling`.

**Actions:**

- ``lvgl.qrcode.update`` :ref:`action <actions-action>` updates the widget's ``text`` property to display a new QR-code.
- **id** (**Required**): The ID of the qrcode widget to be updated.
- **text** (**Required**): The new text to be encoded and displayed.

**Triggers:**

- :ref:`interaction <lvgl-automation-triggers>` LVGL event triggers.

**Example:**

.. code-block:: yaml
# Example widget:
- qrcode:
id: lv_qr
size: 100
light_color: whitesmoke
dark_color: steelblue
text: esphome.io
# Example action:
on_...:
then:
- lvgl.qrcode.update:
id: lv_qr
text: home-assistant.io
.. _lvgl-widget-roller:

``roller``
Expand Down

0 comments on commit c841607

Please sign in to comment.