8000 [lvgl] Fix image property processing by clydebarrow · Pull Request #8691 · esphome/esphome · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[lvgl] Fix image property processing #8691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2025
Merged

Conversation

clydebarrow
Copy link
Contributor

What does this implement/fix?

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code quality improvements to existing code or addition of tests
  • Other

Related issue or feature (if applicable):

Pull request in esphome-docs with documentation (if applicable):

  • esphome/esphome-docs#

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040
  • BK72xx
  • RTL87xx
  • host

Example entry for config.yaml:

# Example config.yaml

              - lvgl.image.update:
                  id: lv_image
                  zoom: !lambda return 512;
                  angle: !lambda return 100;
                  pivot_x: !lambda return 20;
                  pivot_y: !lambda return 20;
                  offset_x: !lambda return 20;
                  offset_y: !lambda return 20;
                  antialias: !lambda return true;

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

@Copilot Copilot AI review requested due to automatic review settings May 4, 2025 22:55
@clydebarrow clydebarrow added this to the 2025.4.2 milestone May 4, 2025
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the image property processing for lvgl components by updating the image update configuration in tests and ensuring that the widget properties are processed asynchronously with consistent naming.

  • Updated lvgl.image.update configuration in test files
  • Renamed the angle validator to lv_angle and updated its usage in widget code
  • Ensured asynchronous processing for pivot, angle, zoom, and antialias properties in image widgets

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/components/lvgl/lvgl-package.yaml Added new test configurations for lvgl.image.update and tileview properties
esphome/components/lvgl/widgets/img.py Updated import and processing for angle, pivot, zoom, offset, and antialias properties to improve consistency
Comments suppressed due to low confidence (2)

esphome/components/lvgl/widgets/img.py:13

  • [nitpick] The updated import renaming 'angle' to 'lv_angle' improves clarity; please confirm that all related references and validations are updated consistently across the codebase.
from ..lv_validation import lv_angle, lv_bool, lv_image, size, zoom

esphome/components/lvgl/widgets/img.py:73

  • Using asynchronous processing for the angle property with 'lv_angle.process' ensures consistency with other property handlers; ensure that the validator returns the expected type for downstream usage.
lv.img_set_angle(w.obj, await lv_angle.process(cf_angle))

@codecov-commenter
Copy link
codecov-commenter commented May 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.62%. Comparing base (4d8b5ed) to head (c2f73ed).
Report is 2464 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #8691      +/-   ##
==========================================
+ Coverage   53.70%   56.62%   +2.91%     
==========================================
  Files          50       50              
  Lines        9408     9922     +514     
  Branches     1654     1340     -314     
==========================================
+ Hits         5053     5618     +565     
+ Misses       4056     3955     -101     
- Partials      299      349      +50     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@clydebarrow
Copy link
Contributor Author

To use the changes from this PR as an external component, add the following to your ESPHome configuration YAML file:

external_components:
  - source: github://pr#8691
    components: [lvgl]
    refresh: 1h

(Added by the PR bot)

@jesserockz jesserockz merged commit c7523ac into esphome:dev May 5, 2025
30 checks passed
@jesserockz jesserockz mentioned this pull request May 11, 2025
sa-crespo pushed a commit to sa-crespo/esphome that referenced this pull request May 26, 2025
sa-crespo pushed a commit to sa-crespo/esphome that referenced this pull request May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0