esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 35 forks source link

LVGL Image Scale invalid #6199

Closed plplaaa2 closed 1 month ago

plplaaa2 commented 1 month ago

The problem

Scale is not available among the configuration variations in the LVGL image widget.

https://esphome.io/components/lvgl/widgets#image

image Images are the basic widgets used to display images.

Configuration variables:

angle (Optional, 0-360): Rotation of the image. Defaults to 0.0. Needs pivot_x and pivot_y to be specified.

antialias (Optional): The quality of the angle or scale transformation. When anti-aliasing is enabled, the transformations are higher quality but slower. Defaults to false.

mode (Optional): Either REAL or VIRTUAL. With VIRTUAL, when the image is scaled or rotated, the real coordinates of the image object are not changed. The larger content simply overflows the object’s boundaries. It also means the layouts are not affected the by the transformations. With REAL, if the width/height of the object is set to SIZE_CONTENT, the object’s size will be set to the scaled and rotated size. If an explicit size is set, the overflowing content will be cropped. Defaults to VIRTUAL.

offset_x (Optional): Add a horrizontal offset to the image position.

offset_y (Optional): Add a vertical offset to the image position.

pivot_x (Optional): Horizontal position of the pivot point of rotation, in pixels, relative to the top left corner of the image.

pivot_y (Optional): Vertical position of the pivot point of rotation, in pixels, relative to the top left corner of the image.

scale (Optional, 0.1-10): Zoom of the image.

src (Required, image): The ID of an existing image configuration.

Some style options from Style properties for the background rectangle that uses the typical background style properties and the image itself using the image style properties.

Which version of ESPHome has the issue?

2024.8.0

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2024.8.2

What platform are you using?

ESP32

Board

ESP32 S3

Component causing the issue

LVGL

Example YAML snippet

image:
  - file: "img/clear-night.svg"
    id: clear_night
    type: RGB565
    use_transparency: true
lvgl:
 ~ skip
  pages: 
    - id: home_page
      widgets: 
        - obj: 
            x: 0
            y: 35
            align: TOP_LEFT
            styles: weather_top
            width: 800
            height: 445
            widgets: 
              button: 
                align: CENTER
                width: 100%
                height: 100%
                bg_color: 0
                bg_opa: TRANSP
                border_opa: TRANSP
                radius: 0
                pad_all: 0
                widgets: 
                  - image: 
                      align: TOP_RIGHT
                      width: 250
                      height: 250

                      [scale] is an invalid option for [image]. Did you mean [scrollable], [scrolled], [disabled]?
                      scale: 5
                      src: clear_night```

Anything in the logs that might be useful for us?

No response

Additional information

The image is rgb565.

clydebarrow commented 1 month ago

It's a documentation error - the option is zoom not scale.