From 574ffea67aa0d5af84c094226c83d2aa4d4dc30b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Sat, 28 Dec 2024 22:51:38 +0100 Subject: [PATCH] =?UTF-8?q?=3D=20=E2=86=92=20+=3D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/c3nav/routing/locator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/c3nav/routing/locator.py b/src/c3nav/routing/locator.py index e006f40e..2c07d727 100644 --- a/src/c3nav/routing/locator.py +++ b/src/c3nav/routing/locator.py @@ -256,13 +256,13 @@ class Locator: icon='my_location' ) else: - the_sum = sum((a[1].rssi+90) for a in scan_data_in_the_same_room[:3]) + the_sum = sum((value.rssi+90) for peer_id, value in scan_data_in_the_same_room[:3]) x = 0 y = 0 for peer_id, value in 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 + 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( level=router.levels[router.spaces[space.pk].level_id], x=x/100,