fixed Bug with Pipeline

This commit is contained in:
schrom01 2022-08-17 02:41:49 +02:00
parent 7fe2f0cee5
commit 633750d0dc
4 changed files with 7 additions and 3 deletions

View File

@ -8,5 +8,5 @@ class FileIO:
def loadZones(self): def loadZones(self):
zones = [] zones = []
for i in range(12): 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 return zones

View File

@ -41,6 +41,8 @@ class Zone:
self.state = True self.state = True
case 3: case 3:
self.state = False self.state = False
if (not self.planedDuration > 0):
self.setState = 0
def refreshStateManualmode(self): def refreshStateManualmode(self):
@ -62,6 +64,8 @@ class Zone:
self.state = True self.state = True
case 3: case 3:
self.state = False self.state = False
if (not self.planedDuration > 0):
self.setState = 0
def refreshState(self): def refreshState(self):

View File

@ -51,7 +51,7 @@ class ZoneManager:
return False return False
def switchZoneState(self, zone, state, duration, instant=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) zone.switchState(state=state, duration=duration, instant=True)
else: else:
self.addIrrigationJob(IrrigationJob(id=self.random.randint(a=100000000, b=999999999), zone=zone, duration=duration)) self.addIrrigationJob(IrrigationJob(id=self.random.randint(a=100000000, b=999999999), zone=zone, duration=duration))

View File

@ -13,7 +13,7 @@ webserver = Webserver(zoneManager=zoneManager, port=80)
def cronJobs(): def cronJobs():
while True: while True:
time.sleep(1) time.sleep(0.5)
zoneManager.cronJobs() zoneManager.cronJobs()
if __name__ == "__main__": if __name__ == "__main__":