|
@@ -327,11 +327,21 @@ class SmartSceneView(View):
|
|
|
if 'delay_time' in task and task['delay_time'] != 0:
|
|
|
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_temp['sensor_ieee_addr'] = sub_device_qs['ieee_addr']
|
|
|
+ # 网关添加报警类型数据
|
|
|
+ else:
|
|
|
+ task_temp['voice_type'] = task.get('voice_type')
|
|
|
+ task_temp['voice_id'] = task.get('voice_id')
|
|
|
+ task_temp['count'] = task.get('count')
|
|
|
+ task_temp['delay_time'] = task.get('delay_time')
|
|
|
+ task_temp['duration'] = task.get('duration')
|
|
|
+ task_temp['value_type'] = task.get('value_type')
|
|
|
task_list.append(task_temp)
|
|
|
+
|
|
|
msg['task'] = task_list
|
|
|
|
|
|
smart_scene_qs.device_data = json.dumps(msg)
|
|
@@ -647,11 +657,21 @@ class SmartSceneView(View):
|
|
|
if 'delay_time' in task and task['delay_time'] != 0:
|
|
|
task_temp['sensor_delay'] = task['delay_time']
|
|
|
|
|
|
- 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()
|
|
|
+ # 子设备返回长地址
|
|
|
+ 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_temp['sensor_ieee_addr'] = sub_device_qs['ieee_addr']
|
|
|
+ # 网关添加报警类型数据
|
|
|
+ else:
|
|
|
+ task_temp['voice_type'] = task.get('voice_type')
|
|
|
+ task_temp['voice_id'] = task.get('voice_id')
|
|
|
+ task_temp['count'] = task.get('count')
|
|
|
+ task_temp['delay_time'] = task.get('delay_time')
|
|
|
+ task_temp['duration'] = task.get('duration')
|
|
|
+ task_temp['value_type'] = task.get('value_type')
|
|
|
task_list.append(task_temp)
|
|
|
+
|
|
|
msg['task'] = task_list
|
|
|
|
|
|
with transaction.atomic():
|