mirror of
https://github.com/esphome/esphome.git
synced 2025-07-28 14:16:40 +00:00
Packages: optional base path for remote git packages (#9279)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
parent
34db02661c
commit
b2b6f41ef3
@ -63,6 +63,7 @@ BASE_SCHEMA = cv.All(
|
||||
cv.Schema(
|
||||
{
|
||||
cv.Required(CONF_URL): cv.url,
|
||||
cv.Optional(CONF_PATH): cv.string,
|
||||
cv.Optional(CONF_USERNAME): cv.string,
|
||||
cv.Optional(CONF_PASSWORD): cv.string,
|
||||
cv.Exclusive(CONF_FILE, CONF_FILES): validate_yaml_filename,
|
||||
@ -116,6 +117,9 @@ def _process_base_package(config: dict) -> dict:
|
||||
)
|
||||
files = []
|
||||
|
||||
if base_path := config.get(CONF_PATH):
|
||||
repo_dir = repo_dir / base_path
|
||||
|
||||
for file in config[CONF_FILES]:
|
||||
if isinstance(file, str):
|
||||
files.append({CONF_PATH: file, CONF_VARS: {}})
|
||||
|
@ -5,7 +5,8 @@ packages:
|
||||
- !include package.yaml
|
||||
- github://esphome/esphome/tests/components/template/common.yaml@dev
|
||||
- url: https://github.com/esphome/esphome
|
||||
file: tests/components/absolute_humidity/common.yaml
|
||||
path: tests/components/absolute_humidity
|
||||
file: common.yaml
|
||||
ref: dev
|
||||
refresh: 1d
|
||||
|
||||
|
@ -7,7 +7,8 @@ packages:
|
||||
shorthand: github://esphome/esphome/tests/components/template/common.yaml@dev
|
||||
github:
|
||||
url: https://github.com/esphome/esphome
|
||||
file: tests/components/absolute_humidity/common.yaml
|
||||
path: tests/components/absolute_humidity
|
||||
file: common.yaml
|
||||
ref: dev
|
||||
refresh: 1d
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user