1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-10 07:12:21 +01:00

ESP8266 connect fixes (#605)

* ESP8266 Connection Fixes

* Update client.py

* Update mqtt_client.cpp

* Update mqtt_client.cpp

* Fix ping

* Async dump config

* Update base image to 1.7.0

* Update helpers.py

* Updates

* Update Dockerfile.lint
This commit is contained in:
Otto Winter
2019-06-03 15:21:36 +02:00
committed by GitHub
parent fe24745815
commit c53483a3b2
13 changed files with 66 additions and 64 deletions

View File

@@ -127,15 +127,20 @@ def resolve_ip_address(host):
from esphome.core import EsphomeError
import socket
try:
ip = socket.gethostbyname(host)
except socket.error as err:
if host.endswith('.local'):
ip = _resolve_with_zeroconf(host)
else:
raise EsphomeError("Error resolving IP address: {}".format(err))
errs = []
return ip
if host.endswith('.local'):
try:
return _resolve_with_zeroconf(host)
except EsphomeError as err:
errs.append(str(err))
try:
return socket.gethostbyname(host)
except socket.error as err:
errs.append(str(err))
raise EsphomeError("Error resolving IP address: {}"
"".format(', '.join(errs)))
def get_bool_env(var, default=False):