malob / DarkMode.spoon

Hammerspoon Spoon to enable, disable, and toggle DarkMode either manually, or on a schedule (by default enabled on sunset and disabled as sunrise).
3 stars 0 forks source link

Dark mode toggle doesn’t occur on scheduled time #6

Closed andreiborisov closed 5 years ago

andreiborisov commented 5 years ago

Dark mode doesn’t toggle on scheduled time Sent with GitHawk

malob commented 5 years ago

Silly mistake ended up being the issue. Fixed in commit 43e919b. Main issue was use of currentTime rather than os.time() in the predicate function of the timer.

malob commented 5 years ago

While adding caching for the location value to deal with situations when hs.location.get() can't get a location I realized the logic in nextToggleTime() wasn't right. It's fixed now, and there should be no remaining issues with the schedule logic.