Skip to content

Commit

Permalink
Fix TpLink Device Tracker initialize error (#22349)
Browse files Browse the repository at this point in the history
Catch RequestException instead of ConnectionError
In some cases TpLinkDeviceScanner throws various successors of
RequestException. They should be caught.
  • Loading branch information
a005 authored and awarecan committed Mar 25, 2019
1 parent f1a0ad9 commit a59487a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions homeassistant/components/tplink/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def __init__(self, config):
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."""
Expand Down Expand Up @@ -123,8 +123,8 @@ def __init__(self, config):
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."""
Expand Down

0 comments on commit a59487a

Please sign in to comment.