diff --git a/FileIO/__init__.py b/FileIO/__init__.py index b717e6b..9d205c0 100644 --- a/FileIO/__init__.py +++ b/FileIO/__init__.py @@ -8,5 +8,5 @@ class FileIO: def loadZones(self): zones = [] for i in range(12): - zones.append(Zone(number=i+1, name="Zone " + str(i+1), actualHumidity=50, desiredHumidity=30, autoMode=True, state=False, setState=0, endTimeSetState=0, planedDuration=0)) + zones.append(Zone(number=i+1, name="Zone " + str(i+1), actualHumidity=50, desiredHumidity=70, autoMode=True, state=False, setState=0, endTimeSetState=0, planedDuration=0)) return zones diff --git a/Zone.py b/Zone.py index abba3a8..b86da92 100644 --- a/Zone.py +++ b/Zone.py @@ -41,6 +41,8 @@ class Zone: self.state = True case 3: self.state = False + if (not self.planedDuration > 0): + self.setState = 0 def refreshStateManualmode(self): @@ -62,6 +64,8 @@ class Zone: self.state = True case 3: self.state = False + if (not self.planedDuration > 0): + self.setState = 0 def refreshState(self): diff --git a/ZoneManager.py b/ZoneManager.py index ba64103..84a0b0a 100644 --- a/ZoneManager.py +++ b/ZoneManager.py @@ -51,7 +51,7 @@ class ZoneManager: return False def switchZoneState(self, zone, state, duration, instant=False): - if(instant or self.systemSettings.multiZoneIrrigation or state==False or (not self.isAnyZoneBusy())): + if(instant or self.systemSettings.multiZoneIrrigation or state==False ): #or (not self.isAnyZoneBusy()) zone.switchState(state=state, duration=duration, instant=True) else: self.addIrrigationJob(IrrigationJob(id=self.random.randint(a=100000000, b=999999999), zone=zone, duration=duration)) diff --git a/main.py b/main.py index 3358fea..419c506 100644 --- a/main.py +++ b/main.py @@ -13,7 +13,7 @@ webserver = Webserver(zoneManager=zoneManager, port=80) def cronJobs(): while True: - time.sleep(1) + time.sleep(0.5) zoneManager.cronJobs() if __name__ == "__main__":