Browse Source

修复编辑场景问题

locky 2 years ago
parent
commit
2d62e58a8a
1 changed files with 4 additions and 4 deletions
  1. 4 4
      Controller/SensorGateway/SmartSceneController.py

+ 4 - 4
Controller/SensorGateway/SmartSceneController.py

@@ -658,9 +658,9 @@ class SmartSceneView(View):
                     task_temp['sensor_delay'] = task['delay_time']
 
                 # 子设备返回长地址
-                sub_device_id = task.get('subDeviceId', None)
-                if sub_device_id:
-                    sub_device_qs = GatewaySubDevice.objects.filter(id=sub_device_id).values('ieee_addr').first()
+                task_sub_device_id = task.get('subDeviceId', None)
+                if task_sub_device_id:
+                    sub_device_qs = GatewaySubDevice.objects.filter(id=task_sub_device_id).values('ieee_addr').first()
                     task_temp['sensor_ieee_addr'] = sub_device_qs['ieee_addr']
                 # 网关添加报警类型数据
                 else:
@@ -729,7 +729,7 @@ class SmartSceneView(View):
             return response.json(0, res)
 
         except Exception as e:
-            return response.json(500, repr(e))
+            return response.json(500, 'error_ine:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
 
     @staticmethod
     def delete_smart_scene(request_dict, response):