fix config on submit not updated, fix startup initial always in ap mode

This commit is contained in:
2025-06-19 20:06:43 +02:00
parent 69077239a5
commit 3a2e59874e
6 changed files with 21 additions and 4 deletions

View File

@@ -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(())
}
}

View File

@@ -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 {

View File

@@ -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(())
}
}

View File

@@ -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(())
}
}