mirror of
https://github.com/esphome/esphome.git
synced 2024-11-26 00:48:19 +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:
parent
599dbf27e0
commit
f2caaf85c8
2 changed files with 11 additions and 1 deletions
|
@ -49,7 +49,16 @@ def _process_git_config(config: dict, refresh) -> str:
|
||||||
password=config.get(CONF_PASSWORD),
|
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"
|
components_dir = repo_dir / "esphome" / "components"
|
||||||
elif (repo_dir / "components").is_dir():
|
elif (repo_dir / "components").is_dir():
|
||||||
components_dir = repo_dir / "components"
|
components_dir = repo_dir / "components"
|
||||||
|
|
|
@ -2124,6 +2124,7 @@ GIT_SCHEMA = Schema(
|
||||||
Optional(CONF_REF): git_ref,
|
Optional(CONF_REF): git_ref,
|
||||||
Optional(CONF_USERNAME): string,
|
Optional(CONF_USERNAME): string,
|
||||||
Optional(CONF_PASSWORD): string,
|
Optional(CONF_PASSWORD): string,
|
||||||
|
Optional(CONF_PATH): string,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
LOCAL_SCHEMA = Schema(
|
LOCAL_SCHEMA = Schema(
|
||||||
|
|
Loading…
Reference in a new issue