diff --git a/homeassistant/components/xiaomi_aqara.py b/homeassistant/components/xiaomi_aqara.py index f331ace06bd..53d3d3e7ad3 100644 --- a/homeassistant/components/xiaomi_aqara.py +++ b/homeassistant/components/xiaomi_aqara.py @@ -9,7 +9,7 @@ from homeassistant.const import (ATTR_BATTERY_LEVEL, EVENT_HOMEASSISTANT_STOP, CONF_MAC) REQUIREMENTS = ['https://github.com/Danielhiversen/PyXiaomiGateway/archive/' - '0.3.2.zip#PyXiaomiGateway==0.3.2'] + '0.4.0.zip#PyXiaomiGateway==0.4.0'] ATTR_GW_MAC = 'gw_mac' ATTR_RINGTONE_ID = 'ringtone_id' @@ -39,6 +39,17 @@ def _validate_conf(config): raise vol.Invalid('Invalid key %s.' ' Key must be 16 characters', key) res_gw_conf['key'] = key + + host = gw_conf.get('host') + if host is not None: + res_gw_conf['host'] = host + res_gw_conf['port'] = gw_conf.get('port', 9898) + + _LOGGER.warning( + 'Static address (%s:%s) of the gateway provided. ' + 'Discovery of this host will be skipped.', + res_gw_conf['host'], res_gw_conf['port']) + res_config.append(res_gw_conf) return res_config @@ -89,7 +100,7 @@ def setup(hass, config): _LOGGER.error("No gateway discovered") return False hass.data[PY_XIAOMI_GATEWAY].listen() - _LOGGER.debug("Listening for broadcast") + _LOGGER.debug("Gateways discovered. Listening for broadcasts") for component in ['binary_sensor', 'sensor', 'switch', 'light', 'cover']: discovery.load_platform(hass, component, DOMAIN, {}, config) diff --git a/requirements_all.txt b/requirements_all.txt index 634bf94f280..32c941a9384 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -302,7 +302,7 @@ holidays==0.8.1 http://github.com/tgaugry/suds-passworddigest-py3/archive/86fc50e39b4d2b8997481967d6a7fe1c57118999.zip#suds-passworddigest-py3==0.1.2a # homeassistant.components.xiaomi_aqara -https://github.com/Danielhiversen/PyXiaomiGateway/archive/0.3.2.zip#PyXiaomiGateway==0.3.2 +https://github.com/Danielhiversen/PyXiaomiGateway/archive/0.4.0.zip#PyXiaomiGateway==0.4.0 # homeassistant.components.sensor.dht # https://github.com/adafruit/Adafruit_Python_DHT/archive/da8cddf7fb629c1ef4f046ca44f42523c9cf2d11.zip#Adafruit_DHT==1.3.2