mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
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:
commit
035d994705
@ -101,7 +101,12 @@ class LuciDeviceScanner(object):
|
|||||||
result = _req_json_rpc(url, 'net.arptable',
|
result = _req_json_rpc(url, 'net.arptable',
|
||||||
params={'auth': self.token})
|
params={'auth': self.token})
|
||||||
if result:
|
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
|
return True
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user