Commit Graph

11 Commits (b43cd9f34313535c5d2732e8428b740dbab74e69)

Author SHA1 Message Date
Kenny Levinsen 5c497febb7 Do not use -1 for sun calc error 2020-10-19 00:37:02 +02:00
Kenny Levinsen fdcdb04023 Remove clamp from color_math.h 2020-10-18 00:45:36 +02:00
Kenny Levinsen e14e8efcf3 Gracefully handle midnight sun/polar night
The sun trajectory calculation previously emitted garbage if midnight
sun or polar night phenomena was in effect. To fix this, the calculation
is overhauled to report if the computation failed, and if so, which
specific phenomena was the cause.

Timing recalulation uses this information to change out of the normal
state that uses the four sun position timings, into a static state where
wlsunset simply waits a day at a time for a normal sun trajectory
pattern to be restored. In this state, a fixedc high/low temperature is
set as appropriate for the phenomena.

A transition phase replicating the previous day's sunrise is used to
smooth out entry into a midnight sun, which would otherwise cause a
jarring instant-daylight setting.
2020-10-18 00:36:52 +02:00
Kenny Levinsen 7bd167e9d3 Split state from config, cleanup 2020-10-14 17:57:34 +02:00
Kenny Levinsen 7c22eade9a Change twilight interval to -3 to 6 2020-10-04 19:51:25 +02:00
Kenny Levinsen 83d90d2bea Calculate dawn and dusk times 2020-10-04 15:30:45 +02:00
Kenny Levinsen 88a6d1dd17 Fix stricter build errors 2020-09-13 21:38:56 +02:00
Kenny Levinsen 208fc141fb These trailing whitespaces were not invited 2020-09-13 21:33:52 +02:00
Kenny Levinsen 98148d6610 Remove year_radian 2020-09-13 21:22:17 +02:00
Kenny Levinsen a89ae834be Use sun trajectory 2020-09-13 21:12:44 +02:00
Kenny Levinsen 4f8559405f Move math out of main 2020-09-13 03:22:18 +02:00