1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-05 19:33:47 +01:00

[lvgl] Rework events to avoid feedback loops (#7262)

This commit is contained in:
Clyde Stubbs
2024-08-14 12:05:25 +10:00
committed by GitHub
parent a5fdcb31fc
commit a0eff08f39
14 changed files with 108 additions and 29 deletions

View File

@@ -29,7 +29,11 @@ LvglComponent = lvgl_ns.class_("LvglComponent", cg.PollingComponent)
LVGL_COMP_ARG = [(LvglComponent.operator("ptr"), LVGL_COMP)]
lv_event_t_ptr = cg.global_ns.namespace("lv_event_t").operator("ptr")
EVENT_ARG = [(lv_event_t_ptr, "ev")]
CUSTOM_EVENT = literal("lvgl::lv_custom_event")
# Two custom events; API_EVENT is fired when an entity is updated remotely by an API interaction;
# UPDATE_EVENT is fired when an entity is programmatically updated locally.
# VALUE_CHANGED is the event generated by LVGL when an entity's value changes through user interaction.
API_EVENT = literal("lvgl::lv_api_event")
UPDATE_EVENT = literal("lvgl::lv_update_event")
def get_line_marks(value) -> list: