hey wifilocator, use max() not min() to get the best signal pls…

This commit is contained in:
Laura Klünder 2018-12-24 17:36:21 +01:00
parent e5ebddec09
commit c4a7b2b084

View file

@ -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)