Skip to content

Commit deddf55

Browse files
authored
[lvgl] Document on_draw_start and on_draw_end (#5545)
1 parent 547c4b2 commit deddf55

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

content/components/lvgl/_index.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ embedded graphics library to create beautiful UIs for any MCU, MPU and display t
1616

1717
To use LVGL with a [display](#display-hw) in ESPHome, you'll need an ESP32 or RP2040. PSRAM is not a strict requirement but it is generally recommended, especially for large color displays.
1818

19-
The graphic display should be configured with `auto_clear_enabled: false` and should not have any `lambda` set. The LVGL component will take care of the display rendering. For most displays, the `update_interval` should be set to `never`, but note that some displays such as OLED and ePaper will need the update interval set to a suitable value.
19+
The graphic display should be configured with `auto_clear_enabled: false` and should not have any `lambda` set.
20+
The LVGL component will take care of the display rendering. For most displays, the `update_interval` should be
21+
set to `never`, but note that some displays such as OLED and e-paper will need the update interval set to a suitable
22+
interval, or make use of the [`on_draw_end`](#on_draw_end) trigger to manually update the display.
2023

2124
For interactivity, a {{< docref "/components/touchscreen/index" "Touchscreen" >}} (capacitive highly preferred), a {{< docref "/components/sensor/rotary_encoder" >}} or a custom keypad made up from discrete {{< docref "/components/binary_sensor/index" "Binary Sensors" >}} can be used.
2225

@@ -983,6 +986,22 @@ This [trigger](#lvgl-automation-triggers) is triggered when LVGL is resumed. Thi
983986

984987
This [trigger](#lvgl-automation-triggers) is triggered after LVGL has been setup. It is also available on any widget, but the timing is the same.
985988

989+
### `on_draw_start`
990+
991+
This [trigger](#lvgl-automation-triggers) is executed before each LVGL drawing operation.
992+
993+
### `on_draw_end`
994+
995+
This [trigger](#lvgl-automation-triggers) is executed after LVGL has completed drawing all updated screen elements. It
996+
may be used for example to trigger an update of a display component like an e-paper screen that requires the buffer
997+
to be sent to the display for it to be updated.
998+
999+
```yaml
1000+
lvgl:
1001+
on_draw_end:
1002+
component.update: my_display_id
1003+
```
1004+
9861005
## See Also
9871006

9881007
- {{< docref "/cookbook/lvgl" "LVGL Examples in the Cookbook" >}}

0 commit comments

Comments
 (0)