|
@@ -263,7 +263,6 @@ class SmartSceneView(View):
|
|
value = event_values['value'].replace(replace_str, '')
|
|
value = event_values['value'].replace(replace_str, '')
|
|
msg['sensor_data'] = float(value)
|
|
msg['sensor_data'] = float(value)
|
|
|
|
|
|
-
|
|
|
|
smart_scene_dict['sub_device_id'] = sub_device_id
|
|
smart_scene_dict['sub_device_id'] = sub_device_id
|
|
sub_device_qs = GatewaySubDevice.objects.filter(id=sub_device_id).values('device__serial_number',
|
|
sub_device_qs = GatewaySubDevice.objects.filter(id=sub_device_id).values('device__serial_number',
|
|
'src_addr')
|
|
'src_addr')
|
|
@@ -567,8 +566,9 @@ class SmartSceneView(View):
|
|
# 智能按钮不能创建触发条件相同的场景
|
|
# 智能按钮不能创建触发条件相同的场景
|
|
if device_type == '216':
|
|
if device_type == '216':
|
|
event_type = conditions_dict['sensor']['eventValues'][0]['event_type']
|
|
event_type = conditions_dict['sensor']['eventValues'][0]['event_type']
|
|
- smart_scene_temp_qs = smart_scene_qs.filter(sub_device_id=sub_device_id,
|
|
|
|
- conditions__contains=event_type)
|
|
|
|
|
|
+ smart_scene_temp_qs = SmartScene.objects.filter(Q(sub_device_id=sub_device_id),
|
|
|
|
+ ~Q(id=smart_scene_id),
|
|
|
|
+ conditions__contains=event_type)
|
|
if smart_scene_temp_qs.exists():
|
|
if smart_scene_temp_qs.exists():
|
|
return response.json(180)
|
|
return response.json(180)
|
|
|
|
|