Bewaesserungsanlage/main.py

23 lines
784 B
Python

import threading
import time
from Webserver import Webserver
from ZoneManager import ZoneManager
from SystemSettings import SystemSettings
from FileIO import FileIO
systemSettings = SystemSettings(dataDir="/Data", multiZoneIrrigation=False, defaultAutoIrrigationDuration=10, defaultManualIrrigationDuration=10, defaultManualOffDuration=10, webDurationOptions=[1, 5, 10, 15, 20, 25, 30, 45, 60])
fileIO = FileIO(systemSettings)
zoneManager = ZoneManager(systemSettings=systemSettings, fileIO=fileIO)
webserver = Webserver(zoneManager=zoneManager, port=80)
def cronJobs():
while True:
time.sleep(1)
zoneManager.cronJobs()
if __name__ == "__main__":
cronjob_Thread = threading.Thread(target=cronJobs)
cronjob_Thread.start()
webserver.startWebserver()