fix: rename TankInfo fields for consistent naming (volume_ml, pct, water_temp_c)

This commit is contained in:
2026-05-05 23:57:55 +02:00
parent 12dc2a55ba
commit 9eb948458c

View File

@@ -142,15 +142,15 @@ impl TankState {
TankInfo { TankInfo {
enough_water, enough_water,
warn_level, warn_level,
left_ml, volume_ml: left_ml,
sensor_error: tank_err, sensor_error: tank_err,
raw, raw,
water_frozen: water_temp water_frozen: water_temp
.as_ref() .as_ref()
.is_ok_and(|temp| *temp < WATER_FROZEN_THRESH), .is_ok_and(|temp| *temp < WATER_FROZEN_THRESH),
water_temp: water_temp.as_ref().copied().ok(), water_temp_c: water_temp.as_ref().copied().ok(),
temp_sensor_error: water_temp.as_ref().err().map(|err| err.to_string()), temp_sensor_error: water_temp.as_ref().err().map(|err| err.to_string()),
percent, pct: percent,
} }
} }
} }
@@ -180,16 +180,16 @@ pub struct TankInfo {
/// warning that water needs to be refilled soon /// warning that water needs to be refilled soon
pub(crate) warn_level: bool, pub(crate) warn_level: bool,
/// estimation how many ml are still in the tank /// estimation how many ml are still in the tank
pub(crate) left_ml: Option<f32>, pub(crate) volume_ml: Option<f32>,
/// if there is an issue with the water level sensor /// if there is an issue with the water level sensor
pub(crate) sensor_error: Option<TankError>, pub(crate) sensor_error: Option<TankError>,
/// raw water sensor value /// raw water sensor value
pub(crate) raw: Option<f32>, pub(crate) raw: Option<f32>,
/// percent value /// percent value
pub(crate) percent: Option<f32>, pub(crate) pct: Option<f32>,
/// water in the tank might be frozen /// water in the tank might be frozen
pub(crate) water_frozen: bool, pub(crate) water_frozen: bool,
/// water temperature /// water temperature
pub(crate) water_temp: Option<f32>, pub(crate) water_temp_c: Option<f32>,
pub(crate) temp_sensor_error: Option<String>, pub(crate) temp_sensor_error: Option<String>,
} }