From 0aa96f3b9c091d88996ccae0a197abb049376cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Tue, 26 Dec 2017 02:19:41 +0100 Subject: [PATCH] add option to filter ssids --- src/c3nav/routing/locator.py | 2 ++ src/c3nav/settings.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/c3nav/routing/locator.py b/src/c3nav/routing/locator.py index 64b5ff2d..af4a6f8f 100644 --- a/src/c3nav/routing/locator.py +++ b/src/c3nav/routing/locator.py @@ -145,6 +145,8 @@ class LocatorPoint(namedtuple('LocatorPoint', ('x', 'y', 'values'))): def convert_scan(cls, scan, stations: LocatorStations, create=False): values = {} for scan_value in scan: + if settings.WIFI_SSIDS and scan_value['ssid'] not in settings.WIFI_SSIDS: + continue station_id = stations.get(bssid=scan_value['bssid'], ssid=scan_value['ssid'], frequency=scan_value['frequency'], create=create) if station_id is not None: diff --git a/src/c3nav/settings.py b/src/c3nav/settings.py index 1f390a45..083bc03c 100644 --- a/src/c3nav/settings.py +++ b/src/c3nav/settings.py @@ -333,6 +333,8 @@ HEADER_BACKGROUND_COLOR = config.get('c3nav', 'header_background_color', fallbac HEADER_TEXT_COLOR = config.get('c3nav', 'header_text_color', fallback='') HEADER_TEXT_HOVER_COLOR = config.get('c3nav', 'header_text_hover_color', fallback='') +WIFI_SSIDS = [n for n in config.get('c3nav', 'wifi_ssids', fallback='').split(',') if n] + LIBSASS_CUSTOM_FUNCTIONS = { 'primary_color': lambda: PRIMARY_COLOR,