From c4a7b2b084487c3311a5c076548b4e3430e951a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Mon, 24 Dec 2018 17:36:21 +0100 Subject: [PATCH] =?UTF-8?q?hey=20wifilocator,=20use=20max()=20not=20min()?= =?UTF-8?q?=20to=20get=20the=20best=20signal=20pls=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/c3nav/routing/locator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/c3nav/routing/locator.py b/src/c3nav/routing/locator.py index 01b3ec04..decc1c89 100644 --- a/src/c3nav/routing/locator.py +++ b/src/c3nav/routing/locator.py @@ -77,8 +77,8 @@ class Locator: for pk, space in self.spaces.items() if pk not in restrictions.spaces) - # get relevant spaces - best_station_id = min(scan_values.items(), key=operator.itemgetter(1))[0] + # get relevant spaces (they should contain the best station at least once) + best_station_id = max(scan_values.items(), key=operator.itemgetter(1))[0] spaces = tuple((pk, space, station_ids) for pk, space, station_ids in spaces if station_ids and best_station_id in station_ids)