mirror of
https://github.com/Findus23/suntracking.git
synced 2024-08-27 19:52:18 +02:00
fix diff
This commit is contained in:
parent
0a6a199d15
commit
8e6db3387d
1 changed files with 5 additions and 3 deletions
8
main.py
8
main.py
|
@ -1,4 +1,5 @@
|
|||
import time
|
||||
from datetime import datetime, date
|
||||
|
||||
import schedule
|
||||
|
||||
|
@ -22,16 +23,17 @@ def create_schedule():
|
|||
print(altitude, standard_derivation)
|
||||
|
||||
sunset_time = guess.get_time(altitude).time()
|
||||
|
||||
print(sunset_time)
|
||||
s = schedule.every().day
|
||||
s.at_time = sunset_time
|
||||
s.do(send_notification, sunset_time)
|
||||
|
||||
prewarn_time = guess.get_time(altitude + standard_derivation * 3).time()
|
||||
s = schedule.every().day
|
||||
print(prewarn_time)
|
||||
s = schedule.every().day
|
||||
s.at_time = prewarn_time
|
||||
s.do(send_notification, sunset_time, future=prewarn_time - sunset_time)
|
||||
diff = datetime.combine(date.today(), sunset_time) - datetime.combine(date.today(), prewarn_time)
|
||||
s.do(send_notification, sunset_time, future=diff)
|
||||
|
||||
|
||||
create_schedule()
|
||||
|
|
Loading…
Reference in a new issue