mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	Add variable substitutions for !include (#3510)
This commit is contained in:
		| @@ -0,0 +1,2 @@ | ||||
| --- | ||||
| ssid: ${name} | ||||
							
								
								
									
										2
									
								
								tests/unit_tests/fixtures/yaml_util/includes/list.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								tests/unit_tests/fixtures/yaml_util/includes/list.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | ||||
| --- | ||||
| - ${var1} | ||||
							
								
								
									
										1
									
								
								tests/unit_tests/fixtures/yaml_util/includes/scalar.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								tests/unit_tests/fixtures/yaml_util/includes/scalar.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| ${var1} | ||||
							
								
								
									
										17
									
								
								tests/unit_tests/fixtures/yaml_util/includetest.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								tests/unit_tests/fixtures/yaml_util/includetest.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | ||||
| --- | ||||
| substitutions: | ||||
|   name: original | ||||
|  | ||||
| wifi: !include | ||||
|   file: includes/included.yaml | ||||
|   vars: | ||||
|     name: my_custom_ssid | ||||
|  | ||||
| esphome: | ||||
|   # should be substituted as 'original', not overwritten by vars in the !include above | ||||
|   name: ${name} | ||||
|   name_add_mac_suffix: true | ||||
|   platform: esp8266 | ||||
|   board: !include { file: includes/scalar.yaml, vars: { var1: nodemcu } } | ||||
|  | ||||
|   libraries: !include { file: includes/list.yaml, vars: { var1: Wire } } | ||||
		Reference in New Issue
	
	Block a user