aboutsummaryrefslogtreecommitdiff
path: root/src/bin/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/main.rs')
-rw-r--r--src/bin/main.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/bin/main.rs b/src/bin/main.rs
index 0de2709..fc96325 100644
--- a/src/bin/main.rs
+++ b/src/bin/main.rs
@@ -36,8 +36,14 @@ fn main() {
loop {
let utc: DateTime<Utc> = Utc::now();
match calc_sunrise_and_set(utc, latitude, longitude) {
- Ok(ss) => sctd::set_temp(sctd::get_temp(utc, &ss, latitude, longitude) as u32),
- Err(e) => println!("Error calculating sunrise and sunset: {:?}", e),
+ Ok(ss) => {
+ let temp = sctd::get_temp(utc, &ss, latitude, longitude) as u32;
+ println!("setting temprature to: {}", temp);
+ sctd::set_temp(temp);
+ }
+ Err(e) => {
+ println!("Error calculating sunrise and sunset: {:?}", e);
+ }
}
thread::sleep(Duration::from_secs(300));
}