From a59487a438f653063c254a7133dc6c2297877e3c Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 25 Mar 2019 20:25:49 +0300 Subject: [PATCH] Fix TpLink Device Tracker initialize error (#22349) Catch RequestException instead of ConnectionError In some cases TpLinkDeviceScanner throws various successors of RequestException. They should be caught. --- homeassistant/components/tplink/device_tracker.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/tplink/device_tracker.py b/homeassistant/components/tplink/device_tracker.py index 78f16a82d56..33a5d5f32f8 100644 --- a/homeassistant/components/tplink/device_tracker.py +++ b/homeassistant/components/tplink/device_tracker.py @@ -77,8 +77,8 @@ class TplinkDeviceScanner(DeviceScanner): self.last_results = {} self.success_init = self._update_info() - except requests.exceptions.ConnectionError: - _LOGGER.debug("ConnectionError in TplinkDeviceScanner") + except requests.exceptions.RequestException: + _LOGGER.debug("RequestException in %s", __class__.__name__) def scan_devices(self): """Scan for new devices and return a list with found device IDs.""" @@ -123,8 +123,8 @@ class Tplink1DeviceScanner(DeviceScanner): self.success_init = False try: self.success_init = self._update_info() - except requests.exceptions.ConnectionError: - _LOGGER.debug("ConnectionError in Tplink1DeviceScanner") + except requests.exceptions.RequestException: + _LOGGER.debug("RequestException in %s", __class__.__name__) def scan_devices(self): """Scan for new devices and return a list with found device IDs."""