Allow simple hostname for sntp servers (#2300)

This commit is contained in:
Jesse Hills 2021-09-14 22:40:45 +12:00
parent a328fff5a7
commit a32ad33b4e
No known key found for this signature in database
GPG Key ID: BEAAE804EFD8E83A

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)