mirror of
https://github.com/esphome/esphome.git
synced 2025-09-02 03:12:20 +01:00
LVGL stage 2 (#7129)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
touchscreen:
|
||||
- platform: ft63x6
|
||||
id: tft_touch
|
||||
display: tft_display
|
||||
update_interval: 50ms
|
||||
threshold: 1
|
||||
calibration:
|
||||
x_max: 240
|
||||
y_max: 320
|
||||
|
||||
|
25
tests/components/lvgl/logo-text.svg
Normal file
25
tests/components/lvgl/logo-text.svg
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 596.64 116.88">
|
||||
<defs>
|
||||
<style>
|
||||
.cls-1 {
|
||||
fill: #1d2126;
|
||||
stroke-width: 0px;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<g id="Layer_1-2" data-name="Layer 1">
|
||||
<g>
|
||||
<g>
|
||||
<path class="cls-1" d="M211.37,84.7v11.25h-43.5V25.87h43.5v11.34h-31.59v18.14h28.22v10.55h-28.22v18.8h31.59Z"/>
|
||||
<path class="cls-1" d="M245.41,24.6c6.41,0,11.73,1.56,15.98,4.69,4.25,3.12,6.86,7.3,7.83,12.52l-11.2,3.05c-.63-3-2.09-5.31-4.38-6.94-2.3-1.62-5.13-2.44-8.51-2.44-3.63,0-6.5.87-8.62,2.6-2.13,1.73-3.19,4.04-3.19,6.91,0,4.53,2.81,7.47,8.44,8.81l11.44,2.86c5.91,1.53,10.33,3.96,13.27,7.29,2.94,3.33,4.41,7.43,4.41,12.3,0,6.25-2.27,11.3-6.8,15.16-4.53,3.86-10.59,5.79-18.19,5.79-6.84,0-12.63-1.61-17.34-4.83-4.66-3.34-7.41-7.75-8.25-13.22l11.2-2.91c.41,3.09,1.95,5.52,4.62,7.27,2.67,1.75,6.07,2.62,10.2,2.62s7.09-.84,9.35-2.51c2.27-1.67,3.4-3.94,3.4-6.82,0-4.5-2.81-7.47-8.44-8.91l-11.44-2.77c-5.88-1.34-10.29-3.73-13.24-7.15s-4.43-7.6-4.43-12.54c0-6.19,2.2-11.21,6.59-15.07,4.39-3.86,10.16-5.79,17.32-5.79Z"/>
|
||||
<path class="cls-1" d="M332.92,48.7c0,6.88-2.09,12.44-6.26,16.69-4.17,4.25-9.79,6.38-16.85,6.38h-15.75v24.19h-11.91V25.87h27.75c7.12,0,12.74,2.06,16.85,6.16,4.11,4.11,6.16,9.66,6.16,16.66ZM320.45,48.42c0-3.53-1.1-6.4-3.3-8.6s-5.32-3.3-9.35-3.3h-13.73v24.8h13.55c4.12,0,7.3-1.17,9.52-3.52,2.22-2.34,3.33-5.47,3.33-9.38Z"/>
|
||||
<path class="cls-1" d="M343.56,25.87h11.91v29.3l30.89.09v-29.39h12v70.08h-12v-30.14l-30.89-.09v30.23h-11.91V25.87Z"/>
|
||||
<path class="cls-1" d="M434.17,47.29c7.25,0,13.16,2.33,17.72,6.98,4.56,4.66,6.84,10.64,6.84,17.95s-2.28,13.25-6.84,17.91c-4.56,4.66-10.47,6.98-17.72,6.98s-13.25-2.33-17.81-6.98c-4.56-4.66-6.84-10.62-6.84-17.91s2.28-13.34,6.84-17.98c4.56-4.64,10.5-6.96,17.81-6.96ZM434.17,86.9c3.87,0,7.02-1.37,9.45-4.1,2.42-2.73,3.63-6.29,3.63-10.66s-1.21-7.91-3.63-10.62c-2.42-2.7-5.57-4.05-9.45-4.05s-7.17,1.35-9.61,4.05c-2.44,2.7-3.66,6.24-3.66,10.62s1.22,7.93,3.66,10.66c2.44,2.73,5.64,4.1,9.61,4.1Z"/>
|
||||
<path class="cls-1" d="M540.67,65.81v30.14h-11.02v-28.41c0-3.28-.84-5.84-2.53-7.69-1.69-1.84-3.98-2.77-6.89-2.77-3.09,0-5.56,1.01-7.41,3.02-1.84,2.02-2.77,4.84-2.77,8.46v27.38h-11.16v-28.41c0-3.28-.82-5.84-2.46-7.69-1.64-1.84-3.91-2.77-6.82-2.77-3.09,0-5.58,1.01-7.45,3.02s-2.81,4.84-2.81,8.46v27.38h-11.34v-47.34h10.55l.38,4.55c2.75-4.03,7.23-6.05,13.45-6.05,3.62,0,6.77.75,9.42,2.25,2.66,1.5,4.67,3.69,6.05,6.56,1.16-2.75,3.07-4.91,5.74-6.47,2.67-1.56,5.85-2.34,9.54-2.34,5.37,0,9.64,1.66,12.8,4.97,3.16,3.31,4.73,7.89,4.73,13.73Z"/>
|
||||
<path class="cls-1" d="M596.64,76.45h-36.28c.38,3.56,1.72,6.28,4.03,8.16,2.31,1.88,5.25,2.81,8.81,2.81,5.78,0,9.83-2.41,12.14-7.22l9.47,3.75c-1.78,4.16-4.59,7.41-8.41,9.75-3.83,2.34-8.23,3.52-13.2,3.52-7,0-12.68-2.29-17.04-6.87-4.36-4.58-6.54-10.59-6.54-18.02s2.2-13.48,6.59-18.14c4.39-4.66,10.13-6.98,17.23-6.98s12.58,2.3,16.83,6.89c4.25,4.59,6.38,10.64,6.38,18.14v4.22ZM560.55,68.48h24.56c-.22-3.84-1.38-6.77-3.49-8.79s-4.95-3.02-8.51-3.02-6.41,1.02-8.62,3.07c-2.22,2.05-3.53,4.96-3.94,8.74Z"/>
|
||||
</g>
|
||||
<path class="cls-1" d="M114.7,51.58L65.3,2.19c-2.92-2.92-7.69-2.92-10.61,0L5.3,51.58c-2.92,2.92-5.3,8.68-5.3,12.8v45c0,4.12,3.38,7.5,7.5,7.5h29.5V42.21c0-1.66,1.34-3,3-3h40c1.66,0,3,1.34,3,3v12c0,1.66-1.34,3-3,3h-25v6h25c1.66,0,3,1.34,3,3v12c0,1.66-1.34,3-3,3h-25v6h25c1.66,0,3,1.34,3,3v12c0,1.66-1.34,3-3,3h-28c-1.66,0-3-1.34-3-3s1.34-3,3-3h25v-6h-25c-1.66,0-3-1.34-3-3v-12c0-1.66,1.34-3,3-3h25v-6h-25c-1.66,0-3-1.34-3-3v-12c0-1.66,1.34-3,3-3h25v-6h-34v71.67h69.5c4.12,0,7.5-3.38,7.5-7.5v-45c0-4.12-2.39-9.89-5.3-12.8Z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.6 KiB |
@@ -1,9 +1,10 @@
|
||||
color:
|
||||
- id: light_blue
|
||||
hex: "3340FF"
|
||||
|
||||
lvgl:
|
||||
log_level: TRACE
|
||||
bg_color: light_blue
|
||||
touchscreens:
|
||||
- touchscreen_id: tft_touch
|
||||
long_press_repeat_time: 200ms
|
||||
long_press_time: 500ms
|
||||
widgets:
|
||||
- label:
|
||||
text: Hello world
|
||||
@@ -17,8 +18,101 @@ lvgl:
|
||||
text_color: 0xFFFFFF
|
||||
align: bottom_mid
|
||||
text_font: space16
|
||||
- obj:
|
||||
align: center
|
||||
arc_opa: COVER
|
||||
arc_color: 0xFF0000
|
||||
arc_rounded: false
|
||||
arc_width: 3
|
||||
anim_time: 1s
|
||||
bg_color: light_blue
|
||||
bg_grad_color: light_blue
|
||||
bg_dither_mode: ordered
|
||||
bg_grad_dir: hor
|
||||
bg_grad_stop: 128
|
||||
bg_image_opa: transp
|
||||
bg_image_recolor: light_blue
|
||||
bg_image_recolor_opa: 50%
|
||||
bg_main_stop: 0
|
||||
bg_opa: 20%
|
||||
border_color: 0x00FF00
|
||||
border_opa: cover
|
||||
border_post: true
|
||||
border_side: [bottom, left]
|
||||
border_width: 4
|
||||
clip_corner: false
|
||||
height: 50%
|
||||
image_recolor: light_blue
|
||||
image_recolor_opa: cover
|
||||
line_width: 10
|
||||
line_dash_width: 10
|
||||
line_dash_gap: 10
|
||||
line_rounded: false
|
||||
line_color: light_blue
|
||||
opa: cover
|
||||
opa_layered: cover
|
||||
outline_color: light_blue
|
||||
outline_opa: cover
|
||||
outline_pad: 10px
|
||||
outline_width: 10px
|
||||
pad_all: 10px
|
||||
pad_bottom: 10px
|
||||
pad_column: 10px
|
||||
pad_left: 10px
|
||||
pad_right: 10px
|
||||
pad_row: 10px
|
||||
pad_top: 10px
|
||||
shadow_color: light_blue
|
||||
shadow_ofs_x: 5
|
||||
shadow_ofs_y: 5
|
||||
shadow_opa: cover
|
||||
shadow_spread: 5
|
||||
shadow_width: 10
|
||||
text_align: auto
|
||||
text_color: light_blue
|
||||
text_decor: [underline, strikethrough]
|
||||
text_font: montserrat_18
|
||||
text_letter_space: 4
|
||||
text_line_space: 4
|
||||
text_opa: cover
|
||||
transform_angle: 180
|
||||
transform_height: 100
|
||||
transform_pivot_x: 50%
|
||||
transform_pivot_y: 50%
|
||||
transform_zoom: 0.5
|
||||
translate_x: 10
|
||||
translate_y: 10
|
||||
max_height: 100
|
||||
max_width: 200
|
||||
min_height: 20%
|
||||
min_width: 20%
|
||||
radius: circle
|
||||
width: 10px
|
||||
x: 100
|
||||
y: 120
|
||||
- button:
|
||||
width: 20%
|
||||
height: 10%
|
||||
pressed:
|
||||
bg_color: light_blue
|
||||
widgets:
|
||||
- label:
|
||||
text: Button
|
||||
|
||||
font:
|
||||
- file: "gfonts://Roboto"
|
||||
id: space16
|
||||
bpp: 4
|
||||
|
||||
image:
|
||||
- id: cat_img
|
||||
resize: 256x48
|
||||
file: $component_dir/logo-text.svg
|
||||
- id: dog_img
|
||||
file: $component_dir/logo-text.svg
|
||||
resize: 256x48
|
||||
type: TRANSPARENT_BINARY
|
||||
|
||||
color:
|
||||
- id: light_blue
|
||||
hex: "3340FF"
|
||||
|
@@ -19,7 +19,9 @@ display:
|
||||
mirror_y: true
|
||||
data_rate: 80MHz
|
||||
cs_pin: GPIO20
|
||||
dc_pin: GPIO15
|
||||
dc_pin:
|
||||
number: GPIO15
|
||||
ignore_strapping_warning: true
|
||||
auto_clear_enabled: false
|
||||
invert_colors: false
|
||||
update_interval: never
|
||||
|
Reference in New Issue
Block a user