clydebarrow / esphome

ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
https://esphome.io/
Other
24 stars 11 forks source link

Event triggers #34

Open nagyrobi opened 10 months ago

nagyrobi commented 10 months ago

A thought on events from: https://docs.lvgl.io/8.3/overview/event.html

A universal on_event trigger could be implemented with a parameter type which can be chosen from an enum of LVGL events. A few shorthands could be implemented for most popular events:

~on_press-> LV_EVENT_PRESSED on_release-> LV_EVENT_RELEASED on_click-> LV_EVENT_SHORT_CLICKED on_long_press-> LV_EVENT_LONG_PRESSED~ on_value-> LV_EVENT_VALUE_CHANGED, returning the value in x (slider has been moved to value x, switch/btn toggled) on_gesture-> LV_EVENT_GESTURE, returning the gesture (eg. swipe direction)

nagyrobi commented 10 months ago

Fyi OpenHASP chose these: https://www.openhasp.com/0.7.0/design/objects/#events

nagyrobi commented 10 months ago

We need on_value trigger because btnmatrix control flag CLICK_TRIG offers us this in a configurable way; and that seems the only way to know which button was pressed.

nagyrobi commented 10 months ago

Also something like on_draw_end (perhaps LV_EVENT_DRAW_POST_END). Use case: after displaying a bootlogo on the top_layer, start a delay of a few seconds, and ditch the logo widget...

clydebarrow commented 10 months ago

On gesture and on_draw_end to be done at a later date maybe.