cleanup main and network state handling
This commit is contained in:
@@ -119,7 +119,7 @@ impl TankState {
|
||||
pub fn as_mqtt_info(
|
||||
&self,
|
||||
config: &TankConfig,
|
||||
water_temp: Result<f32, anyhow::Error>,
|
||||
water_temp: &anyhow::Result<f32>,
|
||||
) -> TankInfo {
|
||||
let mut tank_err: Option<TankError> = None;
|
||||
let left_ml = match self.left_ml(config) {
|
||||
@@ -151,7 +151,7 @@ impl TankState {
|
||||
.as_ref()
|
||||
.is_ok_and(|temp| *temp < WATER_FROZEN_THRESH),
|
||||
water_temp: water_temp.as_ref().copied().ok(),
|
||||
temp_sensor_error: water_temp.err().map(|err| err.to_string()),
|
||||
temp_sensor_error: water_temp.as_ref().err().map(|err| err.to_string()),
|
||||
percent,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user