diff --git a/homeassistant/components/device_tracker/tplink.py b/homeassistant/components/device_tracker/tplink.py index 346f381db34..9bf85e39faf 100644 --- a/homeassistant/components/device_tracker/tplink.py +++ b/homeassistant/components/device_tracker/tplink.py @@ -69,11 +69,16 @@ class TplinkDeviceScanner(DeviceScanner): password = config[CONF_PASSWORD] username = config[CONF_USERNAME] - self.tplink_client = TpLinkClient( - password, host=host, username=username) + self.success_init = False + try: + self.tplink_client = TpLinkClient( + password, host=host, username=username) - self.last_results = {} - self.success_init = self._update_info() + self.last_results = {} + + self.success_init = self._update_info() + except requests.exceptions.ConnectionError: + _LOGGER.debug("ConnectionError in TplinkDeviceScanner") def scan_devices(self): """Scan for new devices and return a list with found device IDs.""" @@ -115,7 +120,11 @@ class Tplink1DeviceScanner(DeviceScanner): self.password = password self.last_results = {} - self.success_init = self._update_info() + self.success_init = False + try: + self.success_init = self._update_info() + except requests.exceptions.ConnectionError: + _LOGGER.debug("ConnectionError in Tplink1DeviceScanner") def scan_devices(self): """Scan for new devices and return a list with found device IDs."""