소스 검색

设备控制更新

yf_yzl 3 년 전
부모
커밋
06797435fd
1개의 변경된 파일과 2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      smartfarming/views/device.py

+ 2 - 1
smartfarming/views/device.py

@@ -231,7 +231,8 @@ class QxzDeviceAddAPIViw(APIView):
                                         if result:
                                         if result:
                                             result_tp = f"{zh_k[0]}{result}{zh_k[1]},"
                                             result_tp = f"{zh_k[0]}{result}{zh_k[1]},"
                                             result_tp_fin += result_tp
                                             result_tp_fin += result_tp
-                uptime_tp = int((datetime.datetime.strptime(uptime, "%Y-%m-%d %H: %M: %S")).timestamp())
+                up = uptime.replace(" ", "")
+                uptime_tp = int((datetime.datetime.strptime(up, "%Y-%m-%d%H:%M:%S")).timestamp())
                 if result_tp_fin:
                 if result_tp_fin:
                     alarm_new = MongoQXZ_Alarm_Log_New()
                     alarm_new = MongoQXZ_Alarm_Log_New()
                     alarm_new.warning_content = result_tp_fin
                     alarm_new.warning_content = result_tp_fin