fix locate_by_beacon_position some more
This commit is contained in:
parent
7cc0973800
commit
17166eaa89
2 changed files with 2 additions and 5 deletions
|
@ -1,11 +1,9 @@
|
|||
import hashlib
|
||||
from typing import Literal, Optional
|
||||
from uuid import UUID
|
||||
|
||||
import requests
|
||||
from django.conf import settings
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.utils.text import slugify
|
||||
from pydantic import BaseModel, Field, PositiveInt
|
||||
from shapely import Point
|
||||
from shapely.geometry import shape
|
||||
|
@ -13,7 +11,6 @@ from shapely.geometry import shape
|
|||
from c3nav.api.utils import NonEmptyStr
|
||||
from c3nav.mapdata.models import Area, LocationGroup, LocationSlug, MapUpdate, Space
|
||||
from c3nav.mapdata.models.geometry.space import POI
|
||||
from c3nav.mapdata.models.locations import LocationRedirect
|
||||
from c3nav.mapdata.models.report import Report
|
||||
from c3nav.mapdata.utils.cache.changes import changed_geometries
|
||||
|
||||
|
|
|
@ -249,7 +249,7 @@ class Locator:
|
|||
if len(scan_data_in_the_same_room) == 1:
|
||||
point = router.spaces[space.pk].point
|
||||
return CustomLocation(
|
||||
level=router.spaces[space.pk].level_id,
|
||||
level=router.levels[router.spaces[space.pk].level_id],
|
||||
x=point.x,
|
||||
y=point.y,
|
||||
permissions=permissions,
|
||||
|
@ -264,7 +264,7 @@ class Locator:
|
|||
x = self.peers[peer_id].xyz[0] * value.rssi / the_sum
|
||||
y = self.peers[peer_id].xyz[1] * value.rssi / the_sum
|
||||
return CustomLocation(
|
||||
level=router.spaces[space.pk].level_id,
|
||||
level=router.levels[router.spaces[space.pk].level_id],
|
||||
x=x,
|
||||
y=y,
|
||||
permissions=permissions,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue