From 8e79a937ce7d730f3482f083e6e7ef4dc925a63b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Sun, 29 Dec 2024 01:07:59 +0100 Subject: [PATCH] use deduplicized data --- 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 c9fbd1f3..878a92cb 100644 --- a/src/c3nav/routing/locator.py +++ b/src/c3nav/routing/locator.py @@ -254,7 +254,7 @@ class Locator: continue deduplicized_scan_data_in_the_same_room.append((peer_id, value)) - the_sum = sum((value.rssi + 90) for peer_id, value in scan_data_in_the_same_room[:3]) + the_sum = sum((value.rssi + 90) for peer_id, value in deduplicized_scan_data_in_the_same_room[:3]) level = router.levels[space.level_id] if level.on_top_of_id: @@ -271,7 +271,7 @@ class Locator: else: x = 0 y = 0 - for peer_id, value in scan_data_in_the_same_room[:3]: + for peer_id, value in deduplicized_scan_data_in_the_same_room[:3]: x += float(self.peers[peer_id].xyz[0]) * (value.rssi+90) / the_sum y += float(self.peers[peer_id].xyz[1]) * (value.rssi+90) / the_sum return CustomLocation(