mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
increase valid for time to 60 since I was having some issues. removed deprecated lines.
This commit is contained in:
parent
bcb2451752
commit
e961dd5f95
@ -57,7 +57,6 @@ class ActiontecDeviceScanner(object):
|
|||||||
self.password = config[CONF_PASSWORD]
|
self.password = config[CONF_PASSWORD]
|
||||||
self.lock = threading.Lock()
|
self.lock = threading.Lock()
|
||||||
self.last_results = []
|
self.last_results = []
|
||||||
# Test the router is accessible
|
|
||||||
data = self.get_actiontec_data()
|
data = self.get_actiontec_data()
|
||||||
self.success_init = data is not None
|
self.success_init = data is not None
|
||||||
_LOGGER.info("actiontec scanner initialized")
|
_LOGGER.info("actiontec scanner initialized")
|
||||||
@ -90,21 +89,13 @@ class ActiontecDeviceScanner(object):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
with self.lock:
|
with self.lock:
|
||||||
exclude_targets = set()
|
|
||||||
exclude_target_list = []
|
|
||||||
now = dt_util.now()
|
now = dt_util.now()
|
||||||
actiontec_data = self.get_actiontec_data()
|
actiontec_data = self.get_actiontec_data()
|
||||||
if not actiontec_data:
|
if not actiontec_data:
|
||||||
return False
|
return False
|
||||||
self.last_results = []
|
self.last_results = [Device(data['mac'], name, now)
|
||||||
for client in exclude_target_list:
|
for name, data in actiontec_data.items()
|
||||||
if client in actiontec_data:
|
if data['timevalid'] > -60]
|
||||||
actiontec_data.pop(client)
|
|
||||||
for name, data in actiontec_data.items():
|
|
||||||
if data['timevalid'] > 0:
|
|
||||||
device = Device(data['mac'], name, now)
|
|
||||||
self.last_results.append(device)
|
|
||||||
self.last_results.extend(exclude_targets)
|
|
||||||
_LOGGER.info("actiontec scan successful")
|
_LOGGER.info("actiontec scan successful")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user