|
@@ -250,14 +250,15 @@ class SmartSceneView(View):
|
|
else:
|
|
else:
|
|
return response.json(444, {'error param': 'invalid isAllDay'})
|
|
return response.json(444, {'error param': 'invalid isAllDay'})
|
|
|
|
|
|
- sub_device_id = conditions_dict['sensor']['subDeviceId']
|
|
|
|
- sub_device_qs = GatewaySubDevice.objects.filter(id=sub_device_id).values('src_addr').first()
|
|
|
|
- msg = {
|
|
|
|
- 'smart_scene_id': smart_scene_qs.id,
|
|
|
|
- 'sensor_type': conditions_dict['sensor']['device_type'],
|
|
|
|
- 'sensor_src': int(sub_device_qs['src_addr'], 16),
|
|
|
|
- 'sensor_status': conditions_dict['sensor']['eventValues'][0]['value'],
|
|
|
|
- }
|
|
|
|
|
|
+ msg = {}
|
|
|
|
+ if conditions_dict['type'] == '2':
|
|
|
|
+ sub_device_id = conditions_dict['sensor']['subDeviceId']
|
|
|
|
+ sub_device_qs = GatewaySubDevice.objects.filter(id=sub_device_id).values('src_addr').first()
|
|
|
|
+ msg['smart_scene_id'] = smart_scene_qs.id
|
|
|
|
+ msg['sensor_type'] = conditions_dict['sensor']['device_type']
|
|
|
|
+ msg['sensor_src'] = int(sub_device_qs['src_addr'], 16)
|
|
|
|
+ msg['sensor_status'] = conditions_dict['sensor']['eventValues'][0]['value']
|
|
|
|
+
|
|
task_list = []
|
|
task_list = []
|
|
for task in tasks_list:
|
|
for task in tasks_list:
|
|
task_temp = {
|
|
task_temp = {
|