diff options
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -6,7 +6,7 @@ extern crate spa; mod platform; use chrono::prelude::*; -use spa::{calc_solar_position, SunriseAndSet}; +use spa::{solar_position, StdFloatOps, SunriseAndSet}; #[cfg(target_os = "linux")] use platform::linux as os; @@ -48,7 +48,10 @@ fn get_transition_progress_from_elevation(elevation: f64) -> f64 { pub fn get_temp(utc: DateTime<Utc>, ss: &SunriseAndSet, lat: f64, lon: f64) -> f64 { match *ss { SunriseAndSet::Daylight(_, _) => { - let elevation = 90f64 - calc_solar_position(utc, lat, lon).unwrap().zenith_angle; + let elevation = 90f64 + - solar_position::<StdFloatOps>(utc, lat, lon) + .unwrap() + .zenith_angle; debug!("elevation: {elevation}"); let progress = get_transition_progress_from_elevation(elevation); LOW_TEMP + (progress * (HIGH_TEMP - LOW_TEMP)) |
