diff --git a/rust/src/tank.rs b/rust/src/tank.rs index f0a1de8..152fc29 100644 --- a/rust/src/tank.rs +++ b/rust/src/tank.rs @@ -86,7 +86,10 @@ impl TankState { pub fn warn_level(&self, config: &TankConfig) -> Result { match self { TankState::TankSensorDisabled => Err(TankError::SensorDisabled), - TankState::TankSensorError(err) => Err(err.clone()), + TankState::TankSensorError(err) => match err { + TankError::SensorValueError { value, min, max } => Ok(value < min), + _ => Err(err.clone()), + }, TankState::TankSensorPresent(raw_value_mv) => { let tank_fill_percent = raw_voltage_to_tank_fill_percent(*raw_value_mv, config)?; if tank_fill_percent < config.tank_warn_percent.into() {