From bedc8247f1e7b8e52c842df199a1c98f10d7cb53 Mon Sep 17 00:00:00 2001 From: Rich Date: Wed, 1 Sep 2021 10:58:31 +0100 Subject: [PATCH] . --- app/network_utils.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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():