浏览代码

设备控制更新

yf_yzl 2 年之前
父节点
当前提交
ec48b31951
共有 1 个文件被更改,包括 3 次插入17 次删除
  1. 3 17
      smartfarming/api/views/forecast/worm_lamp.py

+ 3 - 17
smartfarming/api/views/forecast/worm_lamp.py

@@ -298,23 +298,6 @@ def device_polyline_data(request):
     """
     虫情测报灯/性诱测报/孢子仪/杀虫灯
     数据详情-折线图接口
-    参数:
-    device_type_id          必传(string)                  设备类型  3虫情测报灯 7孢子仪 4智能性诱 2杀虫灯  9糖醋测报灯  10测报灯rtu
-    d_id                    必传                            设备id
-    start_time              非必传(string 时间戳)           开始时间    (用于时间搜索)
-    end_time                非必传(string 时间戳)           结束时间    (用于时间搜索)
-
-    返回值:
-    "data": {
-        "device_id": "28586565004320786510437",  设备id
-        "ath": [
-            {
-                "addtime": 1590230470,          时间
-                "temperature": 34.1,            温度
-                "humidity": 27.6,               湿度
-                "others": 33,                   设备类型是3为加热仓温度 当设备类型为7为保温仓温度 为4的时候是cpu温度 为2时是电击次数
-                "set_temp": 50,                 设备类型是7时为孢子仪保温仓设定温度,其他类型时该值为空
-            }......
     """
     post_info = request.POST
     device_type_id = post_info.get("device_type_id")
@@ -394,6 +377,9 @@ def device_polyline_data(request):
             except:
                 new_tem = ""
                 new_hum = ""
+            if device_type_id == "4":
+                new_tem = d_t["at"]
+                new_hum = d_t["ah"]
             others = ''
             set_temp = ''
             if device_type_id == '3':