Forráskód Böngészése

修复创建周期任务问题

locky 1 éve
szülő
commit
5353bf65e7
1 módosított fájl, 2 hozzáadás és 2 törlés
  1. 2 2
      Controller/SensorGateway/SmartSceneController.py

+ 2 - 2
Controller/SensorGateway/SmartSceneController.py

@@ -1367,7 +1367,7 @@ class SmartSceneView(View):
     def int_to_weeks(repeat, is_next_day=False):
         """
         十进制转星期周期
-        @param repeat: 星期周期的十进制数,如127 -> 1,2,3,4,5,6,7
+        @param repeat: 星期周期二进制的十进制数,低到高位表示周一到周日,如64 -> 100 0000 -> 周日
         @param is_next_day: 是否隔天
         @return: weeks
         """
@@ -1378,7 +1378,7 @@ class SmartSceneView(View):
         next_day = 1 if is_next_day else 0
         for i, bit in enumerate(bin_str):
             if bit == '1':
-                week = i + next_day
+                week = i + 1 + next_day
                 weeks += str(week) + ','
         # 删除最后一个逗号并返回结果
         return weeks[:-1]