diff --git a/esphomeyaml/config_validation.py b/esphomeyaml/config_validation.py index 68e96c5b44..e847747911 100644 --- a/esphomeyaml/config_validation.py +++ b/esphomeyaml/config_validation.py @@ -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): diff --git a/tests/test1.yaml b/tests/test1.yaml index ba5bd1f791..0ad6e07621 100644 --- a/tests/test1.yaml +++ b/tests/test1.yaml @@ -1022,7 +1022,7 @@ time: servers: - 0.pool.ntp.org - 1.pool.ntp.org - - 2.pool.ntp.org + - 192.168.178.1 on_time: cron: '/30 0-30,30/5 * ? JAN-DEC MON,SAT-SUN,TUE-FRI' then: