mirror of
https://github.com/esphome/esphome.git
synced 2025-10-06 03:43:49 +01:00
[lvgl] Add lvgl.widget.focus action and related triggers. (#7315)
This commit is contained in:
@@ -28,7 +28,7 @@ LVGL_COMP = "lv_component" # used as a lambda argument in lvgl_comp()
|
||||
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")]
|
||||
EVENT_ARG = [(lv_event_t_ptr, "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.
|
||||
@@ -291,6 +291,10 @@ class LvExpr(MockLv):
|
||||
pass
|
||||
|
||||
|
||||
def static_cast(type, value):
|
||||
return literal(f"static_cast<{type}>({value})")
|
||||
|
||||
|
||||
# Top level mock for generic lv_ calls to be recorded
|
||||
lv = MockLv("lv_")
|
||||
# Just generate an expression
|
||||
|
Reference in New Issue
Block a user