zsub = zctx.socket(zmq.SUB)
zsub.connect(conf.get("collector", "publishurl"))
for protoname in (
- "SUPERVISION",
"STATUS",
- "RESET",
- "WHITELIST_TOTAL",
- "PROHIBIT_LBS",
"SETUP",
"POSITION_UPLOAD_INTERVAL",
):
datetime.fromtimestamp(zmsg.when).astimezone(tz=timezone.utc),
msg,
)
+ if msg.RESPOND is not Respond.EXT:
+ log.error(
+ "%s does not expect externally provided response", msg
+ )
kwargs = {}
if isinstance(msg, STATUS):
kwargs = {
- "upload_interval": termconf.get(
+ "upload_interval": termconfig.get(
"statusintervalminutes", 25
)
}
):
if key in termconfig:
kwargs[key] = termconfig[key]
- resp = Resp(imei=zmsg.imei, packet=msg.response(**kwargs))
+ resp = Resp(imei=zmsg.imei, packet=msg.Out(**kwargs).packed)
log.debug("Response: %s", resp)
zpush.send(resp.packed)