peng 1 год назад
Родитель
Сommit
f69ab518f0
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      Controller/SensorGateway/SmartSwitchController.py

+ 5 - 1
Controller/SensorGateway/SmartSwitchController.py

@@ -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}