mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	[schema-gen] fix referenced schemas when schema in component platform (#9755)
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							a614a68f1a
						
					
				
				
					commit
					3bb5a9e2f7
				
			| @@ -411,11 +411,16 @@ def add_referenced_recursive(referenced_schemas, config_var, path, eat_schema=Fa | ||||
|  | ||||
|             s1 = get_str_path_schema(k) | ||||
|             p = k.split(".") | ||||
|             if len(p) == 3 and path[0] == f"{p[0]}.{p[1]}": | ||||
|                 # special case for schema inside platforms | ||||
|                 add_referenced_recursive( | ||||
|                     referenced_schemas, s1, [path[0], "schemas", p[2]] | ||||
|                 ) | ||||
|             if len(p) == 3: | ||||
|                 if path[0] == f"{p[0]}.{p[1]}": | ||||
|                     # special case for schema inside platforms | ||||
|                     add_referenced_recursive( | ||||
|                         referenced_schemas, s1, [path[0], "schemas", p[2]] | ||||
|                     ) | ||||
|                 else: | ||||
|                     add_referenced_recursive( | ||||
|                         referenced_schemas, s1, [f"{p[0]}.{p[1]}", "schemas", p[2]] | ||||
|                     ) | ||||
|             else: | ||||
|                 add_referenced_recursive( | ||||
|                     referenced_schemas, s1, [p[0], "schemas", p[1]] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user