mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
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.
This commit is contained in:
parent
f1a0ad9e4a
commit
a59487a438
@ -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."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user