mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	[lvgl] Add on_change event (#7939)
				
					
				
			This commit is contained in:
		| @@ -168,6 +168,7 @@ LV_EVENT_MAP = { | |||||||
|     "READY": "READY", |     "READY": "READY", | ||||||
|     "CANCEL": "CANCEL", |     "CANCEL": "CANCEL", | ||||||
|     "ALL_EVENTS": "ALL", |     "ALL_EVENTS": "ALL", | ||||||
|  |     "CHANGE": "VALUE_CHANGED", | ||||||
| } | } | ||||||
|  |  | ||||||
| LV_EVENT_TRIGGERS = tuple(f"on_{x.lower()}" for x in LV_EVENT_MAP) | LV_EVENT_TRIGGERS = tuple(f"on_{x.lower()}" for x in LV_EVENT_MAP) | ||||||
|   | |||||||
| @@ -165,6 +165,11 @@ lvgl: | |||||||
|               - Nov |               - Nov | ||||||
|               - Dec |               - Dec | ||||||
|             selected_index: 1 |             selected_index: 1 | ||||||
|  |             on_change: | ||||||
|  |               then: | ||||||
|  |                 - logger.log: | ||||||
|  |                     format: "Roller changed = %d: %s" | ||||||
|  |                     args: [x, text.c_str()] | ||||||
|             on_value: |             on_value: | ||||||
|               then: |               then: | ||||||
|                 - logger.log: |                 - logger.log: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user