|
@@ -494,9 +494,13 @@ class SmartSwitchView(View):
|
|
|
timer_exist = redis_obj.get_all_hash_data(key)
|
|
|
if timer_exist:
|
|
|
if int(timer_id) != int(timer_exist[b'timerId']):
|
|
|
- return response.json(174)
|
|
|
+ return response.json(173)
|
|
|
else:
|
|
|
redis_dict['timerId'] = int(timer_exist[b'timerId']) + 1
|
|
|
+ else:
|
|
|
+ timer_exist = redis_obj.get_all_hash_data(key)
|
|
|
+ if timer_exist:
|
|
|
+ return response.json(174)
|
|
|
redis_obj.set_hash_data(key, redis_dict)
|
|
|
redis_obj.set_expire(key, countdown_time)
|
|
|
msg = {'device_switch': actions, 'task_id': task_id}
|