TpLink Device Tracker Error (#15918)
* Fix 'Error setting up platform tplink' error when a scanner fails even if another scanner would succeed * Try to fix tox errors * Adjust code based on PR commentspull/16082/head
parent
a708a81fa8
commit
975befd136
|
@ -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."""
|
||||
|
|
Loading…
Reference in New Issue