document more types in main.rs

This commit is contained in:
ju6ge 2025-02-27 22:05:59 +01:00
parent 4e642a4421
commit 34fb92ef21
Signed by: judge
GPG Key ID: 6512C30DD8E017B5

View File

@ -127,6 +127,7 @@ struct PlantState {
}
#[derive(Serialize, Deserialize, Debug, PartialEq)]
/// humidity sensor error
enum SensorError {
Unknown,
ShortCircuit { hz: f32, max: f32 },
@ -134,13 +135,23 @@ enum SensorError {
}
#[derive(Debug, PartialEq, Default)]
/// State data for water tank
///
/// TODO unify with TankStateMQTT
struct TankState {
/// is there enough water in the tank
enough_water: bool,
/// warning that water needs to be refilled soon
warn_level: bool,
/// estimation how many ml are still in tank
left_ml: u32,
/// if there is was an issue with the water level sensor
/// TODO merge with left_ml as Result<u32, error_type>
sensor_error: bool,
/// raw water sensor value
raw: u16,
}
#[derive(Serialize)]
struct TankStateMQTT {
enough_water: bool,