Allow simple hostname for sntp servers (#2300)

This commit is contained in:
Jesse Hills 2021-09-14 22:40:45 +12:00 committed by GitHub
parent dd3f2f6c7e
commit d437cc915c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,7 +16,7 @@ CONFIG_SCHEMA = time_.TIME_SCHEMA.extend(
{
cv.GenerateID(): cv.declare_id(SNTPComponent),
cv.Optional(CONF_SERVERS, default=DEFAULT_SERVERS): cv.All(
cv.ensure_list(cv.domain), cv.Length(min=1, max=3)
cv.ensure_list(cv.Any(cv.domain, cv.hostname)), cv.Length(min=1, max=3)
),
}
).extend(cv.COMPONENT_SCHEMA)