Merge pull request #19 from Piratonym/device_tracker-arpflags

device_tracker/openwrt: Check flags in ARP table for NUD_REACHABLE.
This commit is contained in:
Paulus Schoutsen 2015-01-06 19:49:38 -08:00
commit 300cfcc424

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