1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 03:12:20 +01:00

[lvgl] PR stage 3 (#7160)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Clyde Stubbs
2024-07-31 14:31:15 +10:00
committed by GitHub
parent 8849443bf6
commit 3920029aff
18 changed files with 895 additions and 98 deletions

View File

@@ -7,6 +7,7 @@ lvgl:
long_press_time: 500ms
widgets:
- label:
id: hello_label
text: Hello world
text_color: 0xFF8000
align: center
@@ -95,9 +96,43 @@ lvgl:
height: 10%
pressed:
bg_color: light_blue
checkable: true
checked:
bg_color: 0x000000
widgets:
- label:
text: Button
on_click:
lvgl.label.update:
id: hello_label
bg_color: 0x123456
text: clicked
on_value:
logger.log:
format: "state now %d"
args: [x]
on_short_click:
lvgl.widget.hide: hello_label
on_long_press:
lvgl.widget.show: hello_label
on_cancel:
lvgl.widget.enable: hello_label
on_ready:
lvgl.widget.disable: hello_label
on_defocus:
lvgl.widget.hide: hello_label
on_focus:
logger.log: Button clicked
on_scroll:
logger.log: Button clicked
on_scroll_end:
logger.log: Button clicked
on_scroll_begin:
logger.log: Button clicked
on_release:
logger.log: Button clicked
on_long_press_repeat:
logger.log: Button clicked
font:
- file: "gfonts://Roboto"

View File

@@ -6,6 +6,23 @@ i2c:
sda: GPIO18
scl: GPIO19
sensor:
- platform: rotary_encoder
name: "Rotary Encoder"
id: encoder
pin_a: 2
pin_b: 1
internal: true
binary_sensor:
- platform: gpio
id: pushbutton
name: Pushbutton
pin:
number: 0
inverted: true
ignore_strapping_warning: true
display:
- platform: ili9xxx
model: st7789v
@@ -50,5 +67,9 @@ lvgl:
displays:
- tft_display
- second_display
rotary_encoders:
sensor: encoder
enter_button: pushbutton
group: general
<<: !include common.yaml