|
@@ -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):
|