Merge branch 'master' into dev

* master:
  Fix warnings from flake8 and pylint
  Check flags in ARP table for NUD_REACHABLE before assuming a device is online. Fixes #18.
This commit is contained in:
Paulus Schoutsen 2015-01-08 20:18:04 -08:00
commit 035d994705

View File

@ -101,7 +101,12 @@ class LuciDeviceScanner(object):
result = _req_json_rpc(url, 'net.arptable',
params={'auth': self.token})
if result:
self.last_results = [x['HW address'] for x in result]
self.last_results = []
for device_entry in result:
# Check if the Flags for each device contain
# NUD_REACHABLE and if so, add it to last_results
if int(device_entry['Flags'], 16) & 0x2:
self.last_results.append(device_entry['HW address'])
return True