interpret beacon strength correctly for positioning
This commit is contained in:
parent
6dafb009fc
commit
163e893a43
1 changed files with 2 additions and 2 deletions
|
@ -236,13 +236,13 @@ class Locator:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# get visible spaces
|
# get visible spaces
|
||||||
best_ap_id = min(scan_data_we_can_use, key=lambda item: item[1].rssi)[0]
|
best_ap_id = max(scan_data_we_can_use, key=lambda item: item[1].rssi)[0]
|
||||||
space_id = self.peers[best_ap_id].space_id
|
space_id = self.peers[best_ap_id].space_id
|
||||||
space = self.spaces[space_id]
|
space = self.spaces[space_id]
|
||||||
|
|
||||||
scan_data_in_the_same_room = sorted([
|
scan_data_in_the_same_room = sorted([
|
||||||
(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)
|
||||||
|
|
||||||
router = Router.load()
|
router = Router.load()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue