mirror of
https://github.com/esphome/esphome.git
synced 2024-11-12 18:27:46 +01:00
CV: tidy up Schema wrapper (#6105)
This commit is contained in:
parent
0cd232cdf5
commit
b606e976e1
1 changed files with 15 additions and 11 deletions
|
@ -2004,15 +2004,19 @@ def suppress_invalid():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
GIT_SCHEMA = {
|
GIT_SCHEMA = Schema(
|
||||||
Required(CONF_URL): url,
|
{
|
||||||
Optional(CONF_REF): git_ref,
|
Required(CONF_URL): url,
|
||||||
Optional(CONF_USERNAME): string,
|
Optional(CONF_REF): git_ref,
|
||||||
Optional(CONF_PASSWORD): string,
|
Optional(CONF_USERNAME): string,
|
||||||
}
|
Optional(CONF_PASSWORD): string,
|
||||||
LOCAL_SCHEMA = {
|
}
|
||||||
Required(CONF_PATH): directory,
|
)
|
||||||
}
|
LOCAL_SCHEMA = Schema(
|
||||||
|
{
|
||||||
|
Required(CONF_PATH): directory,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def validate_source_shorthand(value):
|
def validate_source_shorthand(value):
|
||||||
|
@ -2053,8 +2057,8 @@ SOURCE_SCHEMA = Any(
|
||||||
validate_source_shorthand,
|
validate_source_shorthand,
|
||||||
typed_schema(
|
typed_schema(
|
||||||
{
|
{
|
||||||
TYPE_GIT: Schema(GIT_SCHEMA),
|
TYPE_GIT: GIT_SCHEMA,
|
||||||
TYPE_LOCAL: Schema(LOCAL_SCHEMA),
|
TYPE_LOCAL: LOCAL_SCHEMA,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue