Skip to content

Commit

Permalink
Fixed non standard handling of longitude with astrotime
Browse files Browse the repository at this point in the history
  • Loading branch information
d4l3k committed Nov 17, 2015
1 parent 863eae6 commit a0601c8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sct/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ func monitorTime() {
log.Printf("Monitoring daylight settings...")
var lastState *bool
for {
rise := astrotime.NextSunrise(time.Now(), geo.Lat, geo.Lon)
set := astrotime.NextSunset(time.Now(), geo.Lat, geo.Lon)
rise := astrotime.NextSunrise(time.Now(), geo.Lat, -geo.Lon)
set := astrotime.NextSunset(time.Now(), geo.Lat, -geo.Lon)
log.Printf("Rise %s set %s", rise, set)
state := rise.Before(set)
if lastState != nil && state == *lastState {
time.Sleep(1 * time.Minute)
continue
}
lastState = &state
Expand Down

0 comments on commit a0601c8

Please sign in to comment.