mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	[lvgl] Add lvgl.widget.focus action and related triggers. (#7315)
This commit is contained in:
		| @@ -54,6 +54,17 @@ lvgl: | ||||
|       long_press_time: 500ms | ||||
|   pages: | ||||
|     - id: page1 | ||||
|       on_load: | ||||
|         - logger.log: page loaded | ||||
|         - lvgl.widget.focus: | ||||
|             action: restore | ||||
|       on_unload: | ||||
|         - logger.log: page unloaded | ||||
|         - lvgl.widget.focus: mark | ||||
|       on_all_events: | ||||
|         logger.log: | ||||
|           format: "Event %s" | ||||
|           args: ['lv_event_code_name_for(event->code).c_str()'] | ||||
|       skip: true | ||||
|       layout: | ||||
|         type: flex | ||||
| @@ -70,6 +81,10 @@ lvgl: | ||||
|             repeat_count: 10 | ||||
|             duration: 1s | ||||
|             auto_start: true | ||||
|             on_all_events: | ||||
|               logger.log: | ||||
|                 format: "Event %s" | ||||
|                 args: ['lv_event_code_name_for(event->code).c_str()'] | ||||
|         - label: | ||||
|             id: hello_label | ||||
|             text: Hello world | ||||
| @@ -229,6 +244,16 @@ lvgl: | ||||
|               - label: | ||||
|                   text: Button | ||||
|             on_click: | ||||
|               - lvgl.widget.focus: spin_up | ||||
|               - lvgl.widget.focus: next | ||||
|               - lvgl.widget.focus: previous | ||||
|               - lvgl.widget.focus: | ||||
|                   action: previous | ||||
|                   freeze: true | ||||
|               - lvgl.widget.focus: | ||||
|                   id: spin_up | ||||
|                   freeze: true | ||||
|                   editing: true | ||||
|               - lvgl.label.update: | ||||
|                   id: hello_label | ||||
|                   bg_color: 0x123456 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user