Explorar o código

查询智能场景日志tasks返回结构体

peng %!s(int64=3) %!d(string=hai) anos
pai
achega
64c97ccfef
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Controller/SensorGateway/SmartSceneController.py

+ 1 - 1
Controller/SensorGateway/SmartSceneController.py

@@ -737,7 +737,7 @@ class SmartSceneView(View):
                     qs = GatewaySubDevice.objects.filter(id=sub_device_id).values('device_type')
                     item['device_type'] = qs[0]['device_type']
                 item['scene_name'] = smart_scene_qs[0]['scene_name']
-                item['tasks'] = smart_scene_qs[0]['tasks']
+                item['tasks'] = eval(smart_scene_qs[0]['tasks'])
             return response.json(0, list(scene_log_qs))
         except Exception as e:
             print(repr(e))