mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	[CI] Consolidate some tests (K, L) (#8201)
This commit is contained in:
		| @@ -1,118 +1,9 @@ | ||||
| number: | ||||
|   - platform: template | ||||
|     id: test_number | ||||
|     min_value: 0 | ||||
|     step: 1 | ||||
|     max_value: 10 | ||||
|     optimistic: true | ||||
| substitutions: | ||||
|   d0_pin: GPIO12 | ||||
|   d1_pin: GPIO13 | ||||
|   d2_pin: GPIO14 | ||||
|   d3_pin: GPIO15 | ||||
|   enable_pin: GPIO16 | ||||
|   rs_pin: GPIO5 | ||||
|  | ||||
| select: | ||||
|   - platform: template | ||||
|     id: test_select | ||||
|     options: | ||||
|       - one | ||||
|       - two | ||||
|     optimistic: true | ||||
|  | ||||
| switch: | ||||
|   - platform: template | ||||
|     name: Template Switch | ||||
|     id: my_switch | ||||
|     optimistic: true | ||||
|  | ||||
| display: | ||||
|   - platform: lcd_gpio | ||||
|     id: my_lcd_gpio | ||||
|     dimensions: 18x4 | ||||
|     data_pins: | ||||
|       - number: 12 | ||||
|       - number: 13 | ||||
|       - number: 14 | ||||
|       - number: 15 | ||||
|     enable_pin: 16 | ||||
|     rs_pin: 5 | ||||
|     lambda: |- | ||||
|       it.print("Hello World!"); | ||||
|  | ||||
| lcd_menu: | ||||
|   id: test_lcd_menu | ||||
|   display_id: my_lcd_gpio | ||||
|   mark_back: 0x5e | ||||
|   mark_selected: 0x3e | ||||
|   mark_editing: 0x2a | ||||
|   mark_submenu: 0x7e | ||||
|   active: false | ||||
|   mode: rotary | ||||
|   on_enter: | ||||
|     then: | ||||
|       lambda: 'ESP_LOGI("lcd_menu", "root enter");' | ||||
|   on_leave: | ||||
|     then: | ||||
|       lambda: 'ESP_LOGI("lcd_menu", "root leave");' | ||||
|   items: | ||||
|     - type: back | ||||
|       text: Back | ||||
|     - type: label | ||||
|     - type: menu | ||||
|       text: Submenu 1 | ||||
|       items: | ||||
|         - type: back | ||||
|           text: Back | ||||
|         - type: menu | ||||
|           text: Submenu 21 | ||||
|           items: | ||||
|             - type: back | ||||
|               text: Back | ||||
|             - type: command | ||||
|               text: Show Main | ||||
|               on_value: | ||||
|                 then: | ||||
|                   - display_menu.show_main: test_lcd_menu | ||||
|     - type: select | ||||
|       text: Enum Item | ||||
|       immediate_edit: true | ||||
|       select: test_select | ||||
|       on_enter: | ||||
|         then: | ||||
|           lambda: 'ESP_LOGI("lcd_menu", "select enter: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' | ||||
|       on_leave: | ||||
|         then: | ||||
|           lambda: 'ESP_LOGI("lcd_menu", "select leave: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' | ||||
|       on_value: | ||||
|         then: | ||||
|           lambda: 'ESP_LOGI("lcd_menu", "select value: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' | ||||
|     - type: number | ||||
|       text: Number | ||||
|       number: test_number | ||||
|       on_enter: | ||||
|         then: | ||||
|           lambda: 'ESP_LOGI("lcd_menu", "number enter: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' | ||||
|       on_leave: | ||||
|         then: | ||||
|           lambda: 'ESP_LOGI("lcd_menu", "number leave: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' | ||||
|       on_value: | ||||
|         then: | ||||
|           lambda: 'ESP_LOGI("lcd_menu", "number value: %s, %s", it->get_text().c_str(), it->get_value_text().c_str());' | ||||
|     - type: command | ||||
|       text: Hide | ||||
|       on_value: | ||||
|         then: | ||||
|           - display_menu.hide: test_lcd_menu | ||||
|     - type: switch | ||||
|       text: Switch | ||||
|       switch: my_switch | ||||
|       on_text: Bright | ||||
|       off_text: Dark | ||||
|       immediate_edit: false | ||||
|       on_value: | ||||
|         then: | ||||
|           lambda: 'ESP_LOGI("lcd_menu", "switch value: %s", it->get_value_text().c_str());' | ||||
|     - type: custom | ||||
|       text: !lambda 'return "Custom";' | ||||
|       value_lambda: 'return "Val";' | ||||
|       on_next: | ||||
|         then: | ||||
|           lambda: 'ESP_LOGI("lcd_menu", "custom next: %s", it->get_text().c_str());' | ||||
|       on_prev: | ||||
|         then: | ||||
|           lambda: 'ESP_LOGI("lcd_menu", "custom prev: %s", it->get_text().c_str());' | ||||
| <<: !include common.yaml | ||||
|   | ||||
		Reference in New Issue
	
	Block a user