|
@@ -189,8 +189,6 @@ class SmartSceneView(View):
|
|
|
tasks = request_dict.get('tasks', None)
|
|
|
is_all_day = request_dict.get('isAllDay', None)
|
|
|
|
|
|
- if not any([device_id, sub_device_id]):
|
|
|
- return response.json(444, {'error param': 'deviceId or subDeviceId'})
|
|
|
if not all([conditions, tasks]):
|
|
|
return response.json(444, {'error param': 'conditions and tasks'})
|
|
|
|
|
@@ -238,7 +236,7 @@ class SmartSceneView(View):
|
|
|
msg['scene_status'] = 1
|
|
|
msg['sensor_type'] = conditions_dict['sensor']['device_type']
|
|
|
msg['sensor_src'] = int(sub_device_qs[0]['src_addr'], 16)
|
|
|
- msg['sensor_status'] = int(conditions_dict['sensor']['eventValues'][0]['value'])
|
|
|
+ msg['sensor_status'] = int(conditions_dict['sensor']['eventValues'][0]['event_type'])
|
|
|
|
|
|
with transaction.atomic():
|
|
|
if is_all_day is None: # 不设置时间
|