Skip to content

Commit

Permalink
Update pialert.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pucherot committed Jan 13, 2021
1 parent a473845 commit cc50d0f
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions back/pialert.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# Pi.Alert v2.52 / 2021-01-11
# Pi.Alert v2.53 / 2021-01-13
# Puche 2020
# GNU GPLv3

Expand Down Expand Up @@ -450,8 +450,28 @@ def execute_arpscan (pRetries):
devices_list = [device.groupdict()
for device in re.finditer (re_pattern, arpscan_output)]

# Bugfix #5 - Delete duplicated MAC's with different IP's
# TEST - Force duplicated device
# devices_list.append(devices_list[0])
# Delete duplicate MAC
unique_mac = []
unique_devices = []

for device in devices_list :
if device['mac'] not in unique_mac:
unique_mac.append(device['mac'])
unique_devices.append(device)

# DEBUG
# print (devices_list)
# print (unique_mac)
# print (unique_devices)
# print (len(devices_list))
# print (len(unique_mac))
# print (len(unique_devices))

# return list
return devices_list
return unique_devices

#-------------------------------------------------------------------------------
def copy_pihole_network ():
Expand Down

0 comments on commit cc50d0f

Please sign in to comment.