mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 00:07:10 +00:00
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:
commit
300cfcc424
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user