- # TODO get data from the config
- resp = Resp(imei=zmsg.imei, packet=msg.response())
+ kwargs = {}
+ if isinstance(msg, STATUS):
+ kwargs = {
+ "upload_interval": termconf.get(
+ "statusintervalminutes", 25
+ )
+ }
+ elif isinstance(msg, SETUP):
+ for key in (
+ "uploadintervalseconds",
+ "binaryswitch",
+ "alarms",
+ "dndtimeswitch",
+ "dndtimes",
+ "gpstimeswitch",
+ "gpstimestart",
+ "gpstimestop",
+ "phonenumbers",
+ ):
+ if key in termconfig:
+ kwargs[key] = termconfig[key]
+ resp = Resp(imei=zmsg.imei, packet=msg.response(**kwargs))