|
@@ -233,6 +233,8 @@ class SmartSwitchView(View):
|
|
if not all([time_point]):
|
|
if not all([time_point]):
|
|
return response.json(444, {'param': 'timePoint'})
|
|
return response.json(444, {'param': 'timePoint'})
|
|
time_point = int(time_point)
|
|
time_point = int(time_point)
|
|
|
|
+ if time_point > 86400:
|
|
|
|
+ return response.json(444, {'param': 'timePoint'})
|
|
scheduler_data = {
|
|
scheduler_data = {
|
|
'device_id': device_id,
|
|
'device_id': device_id,
|
|
'time_type_radio': time_type_radio,
|
|
'time_type_radio': time_type_radio,
|
|
@@ -300,9 +302,9 @@ class SmartSwitchView(View):
|
|
else:
|
|
else:
|
|
return response.json(444, {'param': 'actionsType'})
|
|
return response.json(444, {'param': 'actionsType'})
|
|
|
|
|
|
- time_str_hour = int(time_point / 60 // 60)
|
|
|
|
- time_str_minute = int(time_point / 60 % 60)
|
|
|
|
- celery_obj.creat_crontab_task(tz, task_id, MQTT_TASK, time_str_minute, time_str_hour, repeat,
|
|
|
|
|
|
+ time_point_hour = int(time_point / 60 // 60)
|
|
|
|
+ time_point_minute = int(time_point / 60 % 60)
|
|
|
|
+ celery_obj.creat_crontab_task(tz, task_id, MQTT_TASK, time_point_minute, time_point_hour, repeat,
|
|
args=[serial_number, topic_name, msg, task_id, 1, device_id,
|
|
args=[serial_number, topic_name, msg, task_id, 1, device_id,
|
|
json.dumps(scheduler_data)])
|
|
json.dumps(scheduler_data)])
|
|
else: # 时间段任务
|
|
else: # 时间段任务
|