8 Commits

Author SHA1 Message Date
961f5748c6 Merge branch 'refactor/mqtt-data-serialization' into legacy/v3-support 2026-05-17 12:47:09 +02:00
a66843a455 move all mqtt publishing functions to mqtt module 2026-05-10 21:00:55 +02:00
379808e659 refctor: TankInfo structure (consistent layout)
- fix: use tagged enum serialization for TankError
- fix: rename TankInfo fields for consistent naming (volume_ml, pct, water_temp_c)
- renamed some fields for better clarity on contained value
2026-05-10 21:00:53 +02:00
e2b2734301 refactor: PlantInfo structure (consistent layout)
- fix: use tagged enum serialization for MoistureSensorError and PumpError
- fix: flatten PlantInfo sensors to SensorTelemetry with top-level moisture_pct
2026-05-10 21:00:52 +02:00
43a0c3c274 refactor: BatteryInfo structure (consistent layout)
- use tagged enum serialization for BatteryError
- flatten BatteryInfo telemetry with consistent field names and typed error
2026-05-10 21:00:50 +02:00
2b83d99820 fix: serialize firmware/state as JSON instead of Debug format 2026-05-10 21:00:47 +02:00
4cc70f96de Merge branch 'fix/stay-alive-webserver-spawn' into legacy/v3-support 2026-05-10 20:59:50 +02:00
c90174be27 fix actually spawn async task for webserver when entering stay_alive mode 2026-05-10 20:49:43 +02:00
2 changed files with 5 additions and 4 deletions

View File

@@ -415,10 +415,10 @@ async fn safe_main(spawner: Spawner) -> FatResult<()> {
.get_esp()
.store_last_pump_time(plant_id, cur);
board.board_hal.get_esp().last_pump_time(plant_id);
pump_info(plant_id, true, pump_ineffective, 0, 0, 0, false).await;
mqtt::pump_info(plant_id, true, pump_ineffective, 0, 0, 0, false).await;
let result = do_secure_pump(&mut board, plant_id, plant_config, dry_run).await?;
board.board_hal.pump(plant_id, false).await?;
pump_info(
mqtt::pump_info(
plant_id,
false,
pump_ineffective,
@@ -561,7 +561,8 @@ async fn safe_main(spawner: Spawner) -> FatResult<()> {
if stay_alive {
let reboot_now = Arc::new(AtomicBool::new(false));
let _webserver = http_server(reboot_now.clone(), stack.take().unwrap());
spawner.spawn(http_server(reboot_now.clone(), stack.take().unwrap())?);
wait_infinity(board, WaitType::MqttConfig, reboot_now.clone(), UTC).await;
} else {
//TODO wait for all mqtt publishes?

View File

@@ -300,7 +300,7 @@ impl PlantState {
false
},
cooldown: self.pump_in_timeout(plant_conf, current_time),
out_of_work_hour: in_time_range(
out_of_work_hour: !in_time_range(
current_time,
plant_conf.pump_hour_start,
plant_conf.pump_hour_end,