- "Response for lat=%s, lon=%s: %s", lat, lon, resp
+ "Approximated lat=%s, lon=%s, acc=%s for %s",
+ lat,
+ lon,
+ acc,
+ rect,
+ )
+ if proto_needanswer.get(zmsg.proto, False):
+ resp = Resp(
+ imei=zmsg.imei,
+ when=zmsg.when, # not the current time, but the original!
+ packet=msg.Out(latitude=lat, longitude=lon).packed,
+ )
+ log.debug("Sending reponse %s", resp)
+ zpush.send(resp.packed)
+ rept = CoordReport(
+ devtime=rect.devtime,
+ battery_percentage=rect.battery_percentage,
+ accuracy=acc,
+ altitude=None,
+ speed=None,
+ direction=None,
+ latitude=lat,
+ longitude=lon,
+ )
+ log.debug("Sending report %s", rept)
+ zpub.send(
+ Rept(
+ imei=zmsg.imei,
+ payload=rept.json,
+ ).packed