after pump fast restart cycle
This commit is contained in:
parent
bfee21796a
commit
5be6197f8c
@ -361,7 +361,7 @@ fn safe_main() -> anyhow::Result<()> {
|
||||
let _webserver = httpd(reboot_now.clone());
|
||||
wait_infinity(WaitType::StayAlive, reboot_now.clone());
|
||||
}
|
||||
|
||||
let mut did_pump = false;
|
||||
match plant_to_pump {
|
||||
Some(plant) => {
|
||||
let mut state = plantstate[plant];
|
||||
@ -385,7 +385,7 @@ fn safe_main() -> anyhow::Result<()> {
|
||||
"Trying to pump for {}s with pump {} now",
|
||||
plant_config.pump_time_s, plant
|
||||
);
|
||||
|
||||
did_pump = true;
|
||||
board.any_pump(true)?;
|
||||
board.store_last_pump_time(plant, cur);
|
||||
board.pump(plant, true)?;
|
||||
@ -512,6 +512,16 @@ fn safe_main() -> anyhow::Result<()> {
|
||||
}
|
||||
12 * 60
|
||||
} else if is_day {
|
||||
if did_pump {
|
||||
if online_mode == OnlineMode::Online {
|
||||
let _ = board.mqtt_publish(
|
||||
&config,
|
||||
"/deepsleep",
|
||||
"Entering after pump restart deep sleep".as_bytes(),
|
||||
);
|
||||
}
|
||||
0
|
||||
} else {
|
||||
if online_mode == OnlineMode::Online {
|
||||
let _ = board.mqtt_publish(
|
||||
&config,
|
||||
@ -520,6 +530,7 @@ fn safe_main() -> anyhow::Result<()> {
|
||||
);
|
||||
}
|
||||
20
|
||||
}
|
||||
} else {
|
||||
if online_mode == OnlineMode::Online {
|
||||
let _ = board.mqtt_publish(
|
||||
|
Loading…
Reference in New Issue
Block a user