1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-21 04:32:23 +01:00

External components: optional configurable path for git source (#6677)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Tomek Wasilczyk
2024-05-05 20:19:13 -07:00
committed by GitHub
parent 599dbf27e0
commit f2caaf85c8
2 changed files with 11 additions and 1 deletions

View File

@@ -49,7 +49,16 @@ def _process_git_config(config: dict, refresh) -> str:
password=config.get(CONF_PASSWORD),
)
if (repo_dir / "esphome" / "components").is_dir():
if path := config.get(CONF_PATH):
if (repo_dir / path).is_dir():
components_dir = repo_dir / path
else:
raise cv.Invalid(
"Could not find components folder for source. Please check the source contains a '"
+ path
+ "' folder"
)
elif (repo_dir / "esphome" / "components").is_dir():
components_dir = repo_dir / "esphome" / "components"
elif (repo_dir / "components").is_dir():
components_dir = repo_dir / "components"