diff --git a/app/network_utils.py b/app/network_utils.py index 26339e5..d1aa1e2 100644 --- a/app/network_utils.py +++ b/app/network_utils.py @@ -94,9 +94,20 @@ def parse_iwlist(iwlist_output, current_sid): except: cells = [] + # Remove Blank SSID's cells = [cell for cell in cells if cell["SSID"] != "!***!"] + # Remove Blank SSID's + cells = sorted(cells, key=lambda k: k["Signal"], reverse=True) - return cells + seen = set() + new_cells = [] + for d in cells: + t = tuple(d["SSID"]) + if t not in seen: + seen.add(t) + new_cells.append(d) + + return new_cells def scan_networks():