mnc: int,
gsm_cells: List[Tuple[int, int, int]],
wifi_aps: List[Tuple[str, int]],
- ) -> Tuple[float, float]:
+ ) -> Tuple[float, float, float]:
...
datetime.fromtimestamp(zmsg.when).astimezone(tz=timezone.utc),
msg,
)
- rect: Report = msg.rectified()
+ pmod, rect = msg.rectified()
log.debug("rectified: %s", rect)
if isinstance(rect, (CoordReport, StatusReport)):
- zpub.send(Rept(imei=zmsg.imei, payload=rect.json).packed)
+ zpub.send(
+ Rept(imei=zmsg.imei, pmod=pmod, payload=rect.json).packed
+ )
elif isinstance(rect, HintReport):
try:
- lat, lon = qry.lookup(
+ lat, lon, acc = qry.lookup(
rect.mcc,
rect.mnc,
rect.gsm_cells,
list((mac, strng) for _, mac, strng in rect.wifi_aps),
)
log.debug(
- "Approximated lat=%s, lon=%s for %s", lat, lon, rect
+ "Approximated lat=%s, lon=%s, acc=%s for %s",
+ lat,
+ lon,
+ acc,
+ rect,
)
if proto_needanswer.get(zmsg.proto, False):
resp = Resp(
rept = CoordReport(
devtime=rect.devtime,
battery_percentage=rect.battery_percentage,
- accuracy=None,
+ accuracy=acc,
altitude=None,
speed=None,
direction=None,