Closed nagyrobi closed 8 months ago
disp_bg_color:
is working, disp_bg_image
is not currently.
Now working.
color:
- id: color_pink
hex: ff00ff
lvgl:
...
disp_bg_color: color_pink #nor 0xff00ff
results in:
Compiling .pioenvs/esp32-test-lvgl-host/src/main.o
config/_02_host_lvgl_5_demos.yaml: In lambda function:
config/_02_host_lvgl_5_demos.yaml:2327:37: error: could not convert ‘color_pink’ from ‘esphome::Color’ to ‘lv_color_t’ {aka ‘lv_color16_t’}
*** [.pioenvs/esp32-test-lvgl-host/src/main.o] Error 1
Also, I get a warning
WARNING The image "config/inc/background1.png" you requested is very big. Please consider using the resize parameter.
for a 534x534px image.
https://github.com/clydebarrow/esphome/blob/c7c0d97a5ecbaa235636ba9e527f8c9ff7b4c4b0/esphome/components/image/__init__.py#L319
Imho this kind of warning is outdated these days, there are (and will be more and more) displays with resolutions in this range, people would likely want to use wallpapers on. Possible mitigations:
if (CONF_RESIZE not in config or LVGL not in config) and (width > 500 or height > 500):
to make an exception for LVGLconfig/_02_host_lvgl_5_demos.yaml:2327:37: error: could not convert ‘color_pink’ from ‘esphome::Color’ to ‘lv_color_t’ {aka ‘lv_color16_t’} *** [.pioenvs/esp32-test-lvgl-host/src/main.o] Error 1
Fixed.
Imho this kind of warning is outdated these days, there are (and will be more and more) displays with resolutions in this range, people would likely want to use wallpapers on. Possible mitigations:
Make a PR to remove this check, I would suggest.
OK, I'll make one after LVGL will be merged (so that there will be a reason to do so).
Options to set display (not widget) backdround image/color/opacity:
https://docs.lvgl.io/8/overview/display.html#background