mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Check flags in ARP table for NUD_REACHABLE before assuming a device is online. Fixes #18.
This commit is contained in:
parent
b63784a4e6
commit
fc33273464
@ -101,7 +101,10 @@ 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 x in result:
|
||||
# Check if the Flags for each device contain NUD_REACHABLE and if so, add it to last_results
|
||||
if int(x['Flags'], 16) & 0x2: self.last_results.append(x['HW address'])
|
||||
|
||||
return True
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user