|
|
@@ -164,6 +164,19 @@ def device_control(request):
|
|
|
response_code = response.status_code
|
|
|
logger.warning(f"控制响应码:{response_code}")
|
|
|
if response_code == 200:
|
|
|
+ ext = payload.get("ext", {})
|
|
|
+ if ext:
|
|
|
+ dattim = ext.get("dattim", "")
|
|
|
+ clt = ext.get("clt", "")
|
|
|
+ if int(device_type_id) == 2:
|
|
|
+ ext = payload.get("ext")
|
|
|
+ if dattim:
|
|
|
+ ext.pop("dattim")
|
|
|
+ ext["dat_f"] = dattim
|
|
|
+ if clt:
|
|
|
+ ext.pop("clt")
|
|
|
+ ext["clt_t"] = clt
|
|
|
+ payload["ext"] = ext
|
|
|
device_config = MongoDeviceConfig.objects.get(d_id=d_id)
|
|
|
device_config.device_config = str(payload)
|
|
|
device_config.save()
|