mirror of
https://github.com/esphome/esphome.git
synced 2026-10-02 09:20:22 +00:00
Allow IPv4 addresses for SNTP servers (#340)
Fixes https://github.com/OttoWinter/esphomelib/issues/395
This commit is contained in:
@@ -458,9 +458,12 @@ def hostname(value):
|
||||
|
||||
def domain(value):
|
||||
value = string(value)
|
||||
if re.match(vol.DOMAIN_REGEX, value) is None:
|
||||
if re.match(vol.DOMAIN_REGEX, value) is not None:
|
||||
return value
|
||||
try:
|
||||
return str(ipv4(value))
|
||||
except vol.Invalid:
|
||||
raise vol.Invalid("Invalid domain: {}".format(value))
|
||||
return value
|
||||
|
||||
|
||||
def domain_name(value):
|
||||
|
||||
Reference in New Issue
Block a user