fix: migrate LVGL 8 API calls to LVGL 9#87
Open
pfefferle wants to merge 1 commit into
Open
Conversation
ESPHome 2026.4.0 upgraded to LVGL 9, which broke the Tab5 scripts: - lv_canvas_set_px gained a required lv_opa_t opacity argument - lv_event_get_target now returns void *; use lv_event_get_target_obj for a typed lv_obj_t * (safer for non-object dispatchers) - lv_obj_clear_flag / lv_obj_clear_state were renamed to lv_obj_remove_flag / lv_obj_remove_state
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ESPHome 2026.4.0 upgraded the bundled LVGL from 8.x to 9.x, which is a breaking API change. The Tab5 scripts currently fail to compile against the new LVGL version with errors like:
This PR migrates the affected calls to the LVGL 9 API:
lv_canvas_set_px— added the now-requiredlv_opa_topacity argument (LV_OPA_COVERfor the existing fully-opaque behavior).lv_event_get_target— switched tolv_event_get_target_obj, the LVGL-9-native typed helper. The old name now returnsvoid *because the target isn't always anlv_obj_tanymore.lv_obj_clear_flag/lv_obj_clear_state— renamed tolv_obj_remove_flag/lv_obj_remove_state. The old names still work via compat wrappers but were renamed in LVGL 9 and may be dropped in future ESPHome releases.Files touched:
common/tab5-scripts.yamlcommon/tab5-ha-hmi.yamlNo behavioral change — pure API migration.
Test plan
m5stack-tab5example against ESPHome 2026.4.0+ and confirm it compiles.lv_event_get_target_objandlv_canvas_set_px) still tracks touch input and updates the selected color.unavailable(exercises thelv_obj_remove_flag/lv_obj_remove_statepaths).