scheduler issue with sunset,sunrise,dark etc
It runs fine the first time,but when it goes to reschedule the event for the next one it ends up scheduling it for the same time due to the calculation returning the current time for the next event trigger. Need to figure out how to get it to bump to the next day when looking for an event based schedule.
Comments (11)
-
-
reporter it does work the way it is. its just when it goes to reschedule it for the next day that it doesnt work. if that makes sense. It looks like your code change would only effect the noon setting.
-
Okay, like I said I'm still working out how ephem and the scheduler work. If I find the problem I'll let you know.
-
reporter i think we need to take this line
ephem.Date(datetime.utcnow()) #set the date before doing any calculations
and adjust it with an optional variable to represent adding 1 day for the reschedule
-
reporter maybe something like if addDay==True: ephem.Date(datetime.utcnow()+ datetime.timedelta(days=1))
-
reporter I did some updating and I am testing it now. I will let it run through tomorrow and see if it fires correctly.It might only need a few hours added it to it, just to get it ahead of its current value to recalculate correctly.
-
I see what you are saying. It was adding the task with out rearguard for the task being the next day.
For testing why not set back the date on your RPI then add the task, then reset the date to now.
-
reporter hey Tom, i sent you a google hangout message.
-
I got the email, but it shows nothing when I click the link
let me try sending you one and see what happens
-
reporter you can use the hangout app on an android or go to gmail.com or hangouts.google.com, just need to sign in with your google+ account.
-
Found it.
- Log in to comment
I think I know why, I'm still trying to figure out ephem but it looks like you did not set the variable sunrise in scheduler_class.py
I made a note in the pylint refactor I am doing