Fix creation of new nmap tracker entities (#55297)

This commit is contained in:
J. Nick Koston 2021-08-26 17:02:49 -05:00 committed by GitHub
parent dfc2556669
commit ef10773202
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -361,13 +361,6 @@ class NmapDeviceScanner:
continue continue
formatted_mac = format_mac(mac) formatted_mac = format_mac(mac)
new = formatted_mac not in devices.tracked
if (
new
and formatted_mac not in devices.tracked
and formatted_mac not in self._known_mac_addresses
):
continue
if ( if (
devices.config_entry_owner.setdefault(formatted_mac, entry_id) devices.config_entry_owner.setdefault(formatted_mac, entry_id)
@ -382,6 +375,7 @@ class NmapDeviceScanner:
formatted_mac, hostname, name, ipv4, vendor, reason, now, 0 formatted_mac, hostname, name, ipv4, vendor, reason, now, 0
) )
new = formatted_mac not in devices.tracked
devices.tracked[formatted_mac] = device devices.tracked[formatted_mac] = device
devices.ipv4_last_mac[ipv4] = formatted_mac devices.ipv4_last_mac[ipv4] = formatted_mac
self._last_results.append(device) self._last_results.append(device)