diff rust/src/fridge.rs @ 601:8c21df3711e2 rust

rigid_config more on sensors
author Matt Johnston <matt@ucc.asn.au>
date Wed, 15 Feb 2017 23:58:02 +0800
parents a440eafa84a9
children b45b8b4cf0f5
line wrap: on
line diff
--- a/rust/src/fridge.rs	Tue Feb 07 22:57:29 2017 +0800
+++ b/rust/src/fridge.rs	Wed Feb 15 23:58:02 2017 +0800
@@ -10,9 +10,10 @@
 use tokio_core::reactor::{Timeout,Handle};
 use futures::sync::{mpsc};
 
-use config::Config;
 use types::*;
 
+use ::rigid_config;
+
 #[derive(Debug)]
 pub enum Message {
     Sensor {wort: Option<f32>, fridge: Option<f32>},
@@ -21,7 +22,6 @@
 }
 
 pub struct Fridge {
-    config: Config,
     params: Params,
     temp_wort: Option<f32>,
     temp_fridge: Option<f32>,
@@ -51,10 +51,9 @@
 }
 
 impl Fridge {
-    pub fn new(config: &Config, nowait: bool, p: Params, handle: &Handle) -> Fridge {
+    pub fn new(nowait: bool, p: Params, handle: &Handle) -> Fridge {
         let (s, r) = mpsc::channel(1);
         let mut f = Fridge { 
-            config: config.clone(),
             params: p,
             temp_wort: None,
             temp_fridge: None,
@@ -66,7 +65,7 @@
             last_off_time: Instant::now(),
         };
         if nowait {
-            f.last_off_time -= Duration::new(config.FRIDGE_DELAY, 100);
+            f.last_off_time -= Duration::new(rigid_config.FRIDGE_DELAY, 100);
         }
         f.tick();
         f