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 WasilczykandJesse Hills authored and GitHub committed 2024-05-06 15:19:13 +12:00
1 parent 599dbf27e0
commit f2caaf85c8
2 files changed
+11 -1

No files matched your search

@@ -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"
+1
View File
@@ -2124,6 +2124,7 @@ GIT_SCHEMA = Schema(
Optional(CONF_REF): git_ref,
Optional(CONF_USERNAME): string,
Optional(CONF_PASSWORD): string,
Optional(CONF_PATH): string,
}
)
LOCAL_SCHEMA = Schema(