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.last_results = {}
|
||||||
|
|
||||||
self.success_init = self._update_info()
|
self.success_init = self._update_info()
|
||||||
except requests.exceptions.ConnectionError:
|
except requests.exceptions.RequestException:
|
||||||
_LOGGER.debug("ConnectionError in TplinkDeviceScanner")
|
_LOGGER.debug("RequestException in %s", __class__.__name__)
|
||||||
|
|
||||||
def scan_devices(self):
|
def scan_devices(self):
|
||||||
"""Scan for new devices and return a list with found device IDs."""
|
"""Scan for new devices and return a list with found device IDs."""
|
||||||
@ -123,8 +123,8 @@ class Tplink1DeviceScanner(DeviceScanner):
|
|||||||
self.success_init = False
|
self.success_init = False
|
||||||
try:
|
try:
|
||||||
self.success_init = self._update_info()
|
self.success_init = self._update_info()
|
||||||
except requests.exceptions.ConnectionError:
|
except requests.exceptions.RequestException:
|
||||||
_LOGGER.debug("ConnectionError in Tplink1DeviceScanner")
|
_LOGGER.debug("RequestException in %s", __class__.__name__)
|
||||||
|
|
||||||
def scan_devices(self):
|
def scan_devices(self):
|
||||||
"""Scan for new devices and return a list with found device IDs."""
|
"""Scan for new devices and return a list with found device IDs."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user