mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	fixes
This commit is contained in:
		| @@ -9,6 +9,9 @@ from esphome.const import ( | |||||||
| ) | ) | ||||||
| from esphome.core import CORE | from esphome.core import CORE | ||||||
|  |  | ||||||
|  | # Pre-build lookup map from (platform, framework) tuples to PlatformFramework enum | ||||||
|  | _PLATFORM_FRAMEWORK_LOOKUP = {pf.value: pf for pf in PlatformFramework} | ||||||
|  |  | ||||||
|  |  | ||||||
| class Extend: | class Extend: | ||||||
|     def __init__(self, value): |     def __init__(self, value): | ||||||
| @@ -126,8 +129,6 @@ def filter_source_files_from_platform( | |||||||
|     Returns: |     Returns: | ||||||
|         Function that returns list of files to exclude for current platform |         Function that returns list of files to exclude for current platform | ||||||
|     """ |     """ | ||||||
|     # Pre-build lookup map from (platform, framework) tuples to PlatformFramework enum |  | ||||||
|     _PLATFORM_FRAMEWORK_LOOKUP = {pf.value: pf for pf in PlatformFramework} |  | ||||||
|  |  | ||||||
|     def filter_source_files() -> list[str]: |     def filter_source_files() -> list[str]: | ||||||
|         # Get current platform/framework |         # Get current platform/framework | ||||||
|   | |||||||
| @@ -107,7 +107,11 @@ class ComponentManifest: | |||||||
|  |  | ||||||
|     @property |     @property | ||||||
|     def resources(self) -> list[FileResource]: |     def resources(self) -> list[FileResource]: | ||||||
|         """Return a list of all file resources defined in the package of this component.""" |         """Return a list of all file resources defined in the package of this component. | ||||||
|  |  | ||||||
|  |         This will return all cpp source files that are located in the same folder as the | ||||||
|  |         loaded .py file (does not look through subdirectories) | ||||||
|  |         """ | ||||||
|         ret: list[FileResource] = [] |         ret: list[FileResource] = [] | ||||||
|  |  | ||||||
|         # Get filter function for source files |         # Get filter function for source files | ||||||
| @@ -127,6 +131,7 @@ class ComponentManifest: | |||||||
|             if Path(resource).suffix not in SOURCE_FILE_EXTENSIONS: |             if Path(resource).suffix not in SOURCE_FILE_EXTENSIONS: | ||||||
|                 continue |                 continue | ||||||
|             if not importlib.resources.files(self.package).joinpath(resource).is_file(): |             if not importlib.resources.files(self.package).joinpath(resource).is_file(): | ||||||
|  |                 # Not a resource = this is a directory (yeah this is confusing) | ||||||
|                 continue |                 continue | ||||||
|  |  | ||||||
|             # Skip excluded files |             # Skip excluded files | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user