mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	Consolidate test files where all tests are identical (#6690)
This commit is contained in:
		
							
								
								
									
										63
									
								
								tests/components/api/common.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								tests/components/api/common.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,63 @@ | ||||
| esphome: | ||||
|   on_boot: | ||||
|     then: | ||||
|       - homeassistant.event: | ||||
|           event: esphome.button_pressed | ||||
|           data: | ||||
|             message: Button was pressed | ||||
|       - homeassistant.service: | ||||
|           service: notify.html5 | ||||
|           data: | ||||
|             message: Button was pressed | ||||
|       - homeassistant.tag_scanned: pulse | ||||
|  | ||||
| wifi: | ||||
|   ssid: MySSID | ||||
|   password: password1 | ||||
|  | ||||
| api: | ||||
|   port: 8000 | ||||
|   password: pwd | ||||
|   reboot_timeout: 0min | ||||
|   encryption: | ||||
|     key: bOFFzzvfpg5DB94DuBGLXD/hMnhpDKgP9UQyBulwWVU= | ||||
|   services: | ||||
|     - service: hello_world | ||||
|       variables: | ||||
|         name: string | ||||
|       then: | ||||
|         - logger.log: | ||||
|             format: Hello World %s! | ||||
|             args: | ||||
|               - name.c_str() | ||||
|     - service: empty_service | ||||
|       then: | ||||
|         - logger.log: Service Called | ||||
|     - service: all_types | ||||
|       variables: | ||||
|         bool_: bool | ||||
|         int_: int | ||||
|         float_: float | ||||
|         string_: string | ||||
|       then: | ||||
|         - logger.log: Something happened | ||||
|     - service: array_types | ||||
|       variables: | ||||
|         bool_arr: bool[] | ||||
|         int_arr: int[] | ||||
|         float_arr: float[] | ||||
|         string_arr: string[] | ||||
|       then: | ||||
|         - logger.log: | ||||
|             # yamllint disable rule:line-length | ||||
|             format: "Bool: %s (%u), Int: %d (%u), Float: %f (%u), String: %s (%u)" | ||||
|             # yamllint enable rule:line-length | ||||
|             args: | ||||
|               - YESNO(bool_arr[0]) | ||||
|               - bool_arr.size() | ||||
|               - int_arr[0] | ||||
|               - int_arr.size() | ||||
|               - float_arr[0] | ||||
|               - float_arr.size() | ||||
|               - string_arr[0].c_str() | ||||
|               - string_arr.size() | ||||
		Reference in New Issue
	
	Block a user