소스 검색

设备控制更新

yf_yzl 2 년 전
부모
커밋
989928d10f
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      smartfarming/api/views/forecast/worm_lamp.py

+ 1 - 1
smartfarming/api/views/forecast/worm_lamp.py

@@ -1962,7 +1962,7 @@ def xycb_pest_chart(request):
     total_pest_num = 0
     total_pest_num = 0
     for item in queryset:
     for item in queryset:
         try:
         try:
-            device_data = json.loads(item.device_data)
+            device_data = json.loads((str(item.device_data)).replace("'", '"'))
             infr_ct = device_data['infr_ct']
             infr_ct = device_data['infr_ct']
             addtime = item.addtime
             addtime = item.addtime
             pest_data.append({
             pest_data.append({