Browse Source

修复创建时间早于当前时间的场景,time_stamp保存错误问题

locky 1 year ago
parent
commit
25594ad79c
1 changed files with 2 additions and 0 deletions
  1. 2 0
      Controller/SensorGateway/SmartSceneController.py

+ 2 - 0
Controller/SensorGateway/SmartSceneController.py

@@ -1152,6 +1152,8 @@ class SmartSceneView(View):
                 time_string = CommonService.get_date_from_timestamp(now_time, tz)
                 time_string = CommonService.get_date_from_timestamp(now_time, tz)
                 time_string += ' {:02d}:{:02d}:00'.format(hour, minute)
                 time_string += ' {:02d}:{:02d}:00'.format(hour, minute)
                 time_stamp = CommonService.convert_to_timestamp(tz, time_string)
                 time_stamp = CommonService.convert_to_timestamp(tz, time_string)
+                if time_stamp < now_time:
+                    time_stamp += 24 * 60 * 60
                 time_dict = {
                 time_dict = {
                     'time_stamp': time_stamp
                     'time_stamp': time_stamp
                 }
                 }