浏览代码

创建场景子设备短地址改长地址

locky 2 年之前
父节点
当前提交
edc170dc73
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      Controller/SensorGateway/SmartSceneController.py

+ 3 - 3
Controller/SensorGateway/SmartSceneController.py

@@ -267,13 +267,13 @@ class SmartSceneView(View):
 
                 smart_scene_dict['sub_device_id'] = sub_device_id
                 sub_device_qs = GatewaySubDevice.objects.filter(id=sub_device_id).values('device__serial_number',
-                                                                                         'src_addr')
+                                                                                         'ieee_addr')
                 if not sub_device_qs.exists():
                     return response.json(173)
                 serial_number = sub_device_qs[0]['device__serial_number']
 
                 msg['sensor_type'] = int(conditions_dict['sensor']['device_type'])
-                msg['sensor_src'] = int(sub_device_qs[0]['src_addr'], 16)
+                msg['sensor_ieee_addr'] = sub_device_qs[0]['ieee_addr']
                 msg['sensor_status'] = int(conditions_dict['sensor']['eventValues'][0]['event_type'])
 
             with transaction.atomic():
@@ -348,7 +348,7 @@ class SmartSceneView(View):
 
             return response.json(0)
         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 scene_list(request_dict, user_id, response):