mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
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 comments
This commit is contained in:
parent
a708a81fa8
commit
975befd136
@ -69,11 +69,16 @@ class TplinkDeviceScanner(DeviceScanner):
|
|||||||
password = config[CONF_PASSWORD]
|
password = config[CONF_PASSWORD]
|
||||||
username = config[CONF_USERNAME]
|
username = config[CONF_USERNAME]
|
||||||
|
|
||||||
self.tplink_client = TpLinkClient(
|
self.success_init = False
|
||||||
password, host=host, username=username)
|
try:
|
||||||
|
self.tplink_client = TpLinkClient(
|
||||||
|
password, host=host, username=username)
|
||||||
|
|
||||||
self.last_results = {}
|
self.last_results = {}
|
||||||
self.success_init = self._update_info()
|
|
||||||
|
self.success_init = self._update_info()
|
||||||
|
except requests.exceptions.ConnectionError:
|
||||||
|
_LOGGER.debug("ConnectionError in TplinkDeviceScanner")
|
||||||
|
|
||||||
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."""
|
||||||
@ -115,7 +120,11 @@ class Tplink1DeviceScanner(DeviceScanner):
|
|||||||
self.password = password
|
self.password = password
|
||||||
|
|
||||||
self.last_results = {}
|
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):
|
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