浏览代码

on_time and off_time are not required params now

highing666 2 年之前
父节点
当前提交
54ac1d44df
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/controllers/equipment/vrf/basic.py

+ 2 - 2
app/controllers/equipment/vrf/basic.py

@@ -51,12 +51,12 @@ class VRFController(EquipmentController):
             ago = now.shift(seconds=-150).format("HHmmSS")
             later = now.shift(seconds=150).format("HHmmSS")
 
-            if ago <= self.on_time <= later:
+            if self.on_time and ago <= self.on_time <= later:
                 if not self.device.running_status:
                     switch_set = "on"
                 else:
                     switch_set = "hold"
-            elif ago <= self.off_time <= later:
+            elif self.off_time and ago <= self.off_time <= later:
                 if self.device.running_status:
                     switch_set = "off"
                 else: