Merge pull request #375 from SEJeff/fix-asuswrt
Fix the asuswrt device tracker for dhcp leases with no hostname
This commit is contained in:
commit
2f8591205f
1 changed files with 10 additions and 2 deletions
|
@ -157,11 +157,19 @@ class AsusWrtDeviceScanner(object):
|
|||
devices = {}
|
||||
for lease in leases_result:
|
||||
match = _LEASES_REGEX.search(lease.decode('utf-8'))
|
||||
|
||||
# For leases where the client doesn't set a hostname, ensure
|
||||
# it is blank and not '*', which breaks the entity_id down
|
||||
# the line
|
||||
host = match.group('host')
|
||||
if host == '*':
|
||||
host = ''
|
||||
|
||||
devices[match.group('ip')] = {
|
||||
'host': host,
|
||||
'status': '',
|
||||
'ip': match.group('ip'),
|
||||
'mac': match.group('mac').upper(),
|
||||
'host': match.group('host'),
|
||||
'status': ''
|
||||
}
|
||||
|
||||
for neighbor in neighbors:
|
||||
|
|
Loading…
Add table
Reference in a new issue