Changeset - 6ad70cd126b7
[Not reviewed]
default
0 1 0
matthewreed - 9 years ago 2016-08-07 19:50:12

Set starting output state for timers when starting up
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
hydrobot.py
Show inline comments
 
@@ -176,11 +176,14 @@ class Scheduler:
 
                    #evalute the current state of the cron trigger and set output on if needed
 
                    if on_job.next_run_time > off_job.next_run_time:
 
                        self.canbus.set_output(module, output, 1)
 
                    else:
 
                        self.canbus.set_output(module, output, 0)
 
                    
 
                if trigger == 'interval':
 
                    self.apscheduler.add_job(self.interval_off, trigger, [module, output, section + "_off", section + "_on", on_duration], id = section + "_off", weeks = off_duration[0], days = off_duration[1], hours = off_duration[2], minutes = off_duration[3], seconds = off_duration[4])
 
                    timer = self.apscheduler.add_job(self.interval_on, trigger, [module, output, section + "_off", section + "_on", off_duration], id = section + "_on", weeks = on_duration[0], days = on_duration[1], hours = on_duration[2], minutes = on_duration[3], seconds = on_duration[4])
 
                    timer.pause()
 
                    self.interval_off(module, output, section + "_off", section + "_on", on_duration)
 
                    
 
            if "pid" in section:
 
                items = config.items(section)
0 comments (0 inline, 0 general)