fix config on submit not updated, fix startup initial always in ap mode
This commit is contained in:
@@ -117,4 +117,10 @@ impl<'a> BoardInteraction<'a> for Initial<'a> {
|
||||
fn test(&mut self) -> Result<()> {
|
||||
bail!("Please configure board revision")
|
||||
}
|
||||
|
||||
fn set_config(&mut self, config: PlantControllerConfig) -> anyhow::Result<()> {
|
||||
self.config = config;
|
||||
self.esp.save_config(&self.config)?;
|
||||
anyhow::Ok(())
|
||||
}
|
||||
}
|
||||
|
@@ -137,6 +137,7 @@ pub trait BoardInteraction<'a> {
|
||||
fn set_rtc_time(&mut self, time: &DateTime<Utc>) -> Result<()>;
|
||||
fn test_pump(&mut self, plant: usize) -> Result<()>;
|
||||
fn test(&mut self) -> Result<()>;
|
||||
fn set_config(&mut self, config: PlantControllerConfig) -> Result<()>;
|
||||
}
|
||||
|
||||
pub struct FreePeripherals {
|
||||
|
@@ -629,4 +629,10 @@ impl<'a> BoardInteraction<'a> for V3<'a> {
|
||||
self.esp.delay.delay_ms(10);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn set_config(&mut self, config: PlantControllerConfig) -> anyhow::Result<()> {
|
||||
self.config = config;
|
||||
self.esp.save_config(&self.config)?;
|
||||
anyhow::Ok(())
|
||||
}
|
||||
}
|
||||
|
@@ -543,4 +543,10 @@ impl<'a> BoardInteraction<'a> for V4<'a> {
|
||||
self.esp.delay.delay_ms(10);
|
||||
anyhow::Ok(())
|
||||
}
|
||||
|
||||
fn set_config(&mut self, config: PlantControllerConfig) -> anyhow::Result<()> {
|
||||
self.config = config;
|
||||
self.esp.save_config(&self.config)?;
|
||||
anyhow::Ok(())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user