Explorar o código

on_time and off_time are not required params now

highing666 %!s(int64=2) %!d(string=hai) anos
pai
achega
54ac1d44df
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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: