fix the thing with the sum?
This commit is contained in:
parent
41d8158218
commit
73c0cbc0d2
1 changed files with 3 additions and 3 deletions
|
@ -246,7 +246,9 @@ class Locator:
|
||||||
(peer_id, value) for peer_id, value in scan_data_we_can_use if self.peers[peer_id].space_id == space_id
|
(peer_id, value) for peer_id, value in scan_data_we_can_use if self.peers[peer_id].space_id == space_id
|
||||||
], key=lambda a: -a[1].rssi)
|
], key=lambda a: -a[1].rssi)
|
||||||
|
|
||||||
if len(scan_data_in_the_same_room) == 1:
|
the_sum = sum((value.rssi + 90) for peer_id, value in scan_data_in_the_same_room[:3])
|
||||||
|
|
||||||
|
if len(scan_data_in_the_same_room) == 1 or not the_sum:
|
||||||
point = space.point
|
point = space.point
|
||||||
return CustomLocation(
|
return CustomLocation(
|
||||||
level=router.levels[space.level_id],
|
level=router.levels[space.level_id],
|
||||||
|
@ -256,8 +258,6 @@ class Locator:
|
||||||
icon='my_location'
|
icon='my_location'
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
the_sum = sum((value.rssi+90) for peer_id, value in scan_data_in_the_same_room[:3])
|
|
||||||
|
|
||||||
x = 0
|
x = 0
|
||||||
y = 0
|
y = 0
|
||||||
for peer_id, value in scan_data_in_the_same_room[:3]:
|
for peer_id, value in scan_data_in_the_same_room[:3]:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue