mirror of
https://github.com/esphome/esphome.git
synced 2026-09-26 06:20:21 +00:00
61 lines
1.2 KiB
YAML
61 lines
1.2 KiB
YAML
esphome:
|
|
name: test-set-z-index
|
|
|
|
esp32:
|
|
board: esp32dev
|
|
framework:
|
|
type: esp-idf
|
|
|
|
spi:
|
|
- id: spi_bus
|
|
clk_pin: GPIO18
|
|
mosi_pin: GPIO23
|
|
|
|
display:
|
|
- platform: mipi_spi
|
|
spi_id: spi_bus
|
|
model: st7789v
|
|
id: tft_display
|
|
dimensions:
|
|
width: 240
|
|
height: 320
|
|
cs_pin: GPIO22
|
|
dc_pin: GPIO21
|
|
auto_clear_enabled: false
|
|
invert_colors: false
|
|
update_interval: never
|
|
|
|
lvgl:
|
|
displays: tft_display
|
|
widgets:
|
|
- label:
|
|
id: label_a
|
|
text: "A"
|
|
- label:
|
|
id: label_b
|
|
text: "B"
|
|
- button:
|
|
id: trigger_btn
|
|
on_click:
|
|
- lvgl.widget.set_z_index:
|
|
id: label_a
|
|
position: top
|
|
- lvgl.widget.set_z_index:
|
|
id: label_a
|
|
position: bottom
|
|
- lvgl.widget.set_z_index:
|
|
id: label_a
|
|
position: up
|
|
- lvgl.widget.set_z_index:
|
|
id: label_a
|
|
position: down
|
|
- lvgl.widget.set_z_index:
|
|
id: label_a
|
|
position: 3
|
|
- lvgl.widget.set_z_index:
|
|
id: label_a
|
|
position: -2
|
|
- lvgl.widget.set_z_index:
|
|
id: [label_a, label_b]
|
|
position: up
|