mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
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
@ -157,11 +157,19 @@ class AsusWrtDeviceScanner(object):
|
|||||||
devices = {}
|
devices = {}
|
||||||
for lease in leases_result:
|
for lease in leases_result:
|
||||||
match = _LEASES_REGEX.search(lease.decode('utf-8'))
|
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')] = {
|
devices[match.group('ip')] = {
|
||||||
|
'host': host,
|
||||||
|
'status': '',
|
||||||
'ip': match.group('ip'),
|
'ip': match.group('ip'),
|
||||||
'mac': match.group('mac').upper(),
|
'mac': match.group('mac').upper(),
|
||||||
'host': match.group('host'),
|
|
||||||
'status': ''
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for neighbor in neighbors:
|
for neighbor in neighbors:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user