1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-20 04:02:21 +01:00
This commit is contained in:
J. Nick Koston
2025-07-06 13:42:18 -05:00
parent 023fa4d220
commit 96f0fda477
2 changed files with 9 additions and 3 deletions

View File

@@ -107,7 +107,11 @@ class ComponentManifest:
@property
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] = []
# Get filter function for source files
@@ -127,6 +131,7 @@ class ComponentManifest:
if Path(resource).suffix not in SOURCE_FILE_EXTENSIONS:
continue
if not importlib.resources.files(self.package).joinpath(resource).is_file():
# Not a resource = this is a directory (yeah this is confusing)
continue
# Skip excluded files