Merge pull request #375 from SEJeff/fix-asuswrt

Fix the asuswrt device tracker for dhcp leases with no hostname
This commit is contained in:
Paulus Schoutsen 2015-09-14 20:23:44 -07:00
commit 2f8591205f

View file

@ -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: