clydebarrow / esphome

ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
https://esphome.io/
Other
23 stars 12 forks source link

Background image #58

Closed nagyrobi closed 8 months ago

nagyrobi commented 8 months ago

Options to set display (not widget) backdround image/color/opacity:

https://docs.lvgl.io/8/overview/display.html#background

clydebarrow commented 8 months ago

disp_bg_color: is working, disp_bg_image is not currently.

clydebarrow commented 8 months ago

Now working.

nagyrobi commented 5 months ago
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
nagyrobi commented 5 months ago

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:

clydebarrow commented 5 months ago

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

Fixed.

clydebarrow commented 5 months ago

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.

nagyrobi commented 5 months ago

OK, I'll make one after LVGL will be merged (so that there will be a reason to do so).