diff rust/src/sensor.rs @ 635:4424a8b30f9c rust

config crate wants everything to be lower case
author Matt Johnston <matt@ucc.asn.au>
date Sun, 22 Sep 2019 22:06:46 +0800
parents a5721c02d3ee
children a9f353f488d0
line wrap: on
line diff
--- a/rust/src/sensor.rs	Sun Sep 22 20:35:40 2019 +0800
+++ b/rust/src/sensor.rs	Sun Sep 22 22:06:46 2019 +0800
@@ -37,7 +37,7 @@
 
     fn pre_start(&mut self, ctx: &Context<Self::Msg>) {
         self.chan = Some(channel("readings", &ctx.system).unwrap());
-        let dur = Duration::new(self.config.SENSOR_SLEEP,0);
+        let dur = Duration::new(self.config.sensor_sleep,0);
         ctx.schedule(Duration::from_millis(0), dur, ctx.myself(), None, SendReading);
     }
 }
@@ -71,7 +71,7 @@
             // multiline
             static ref THERM_RE: regex::Regex = regex::Regex::new("(?m).* YES\n.*t=(.*)\n").unwrap();
         }
-        let mut path = PathBuf::from(&self.config.SENSOR_BASE_DIR);
+        let mut path = PathBuf::from(&self.config.sensor_base_dir);
         path.push(n);
         path.push("w1_slave");
         let mut s = String::new();
@@ -88,7 +88,7 @@
 
     fn sensor_names(&self) -> Result<Vec<String>, TemplogError> {
         // TODO: needs to handle multiple busses.
-        let mut path = PathBuf::from(&self.config.SENSOR_BASE_DIR);
+        let mut path = PathBuf::from(&self.config.sensor_base_dir);
         path.push("w1_master_slaves");
 
         let f = BufReader::new(File::open(path)?);
@@ -109,7 +109,7 @@
 
     fn pre_start(&mut self, ctx: &Context<Self::Msg>) {
         self.chan = Some(channel("readings", &ctx.system).unwrap());
-        let dur = Duration::new(self.config.SENSOR_SLEEP,0);
+        let dur = Duration::new(self.config.sensor_sleep,0);
         ctx.schedule(Duration::from_millis(0), dur, ctx.myself(), None, SendReading);
     }
 }