clippy fixed

This commit is contained in:
2026-05-30 20:59:38 +02:00
parent a2abc99275
commit 95281d617f
4 changed files with 5 additions and 13 deletions

View File

@@ -112,19 +112,14 @@ pub struct PlantControllerConfig {
pub timezone: Option<String>,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Default)]
pub enum SensorCombineMode {
Min,
Max,
#[default]
Avg,
}
impl Default for SensorCombineMode {
fn default() -> Self {
SensorCombineMode::Avg
}
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[serde(default)]
pub struct PlantConfig {

View File

@@ -1,5 +1,4 @@
use crate::fat_error::{FatError, FatResult};
use crate::hal::Box;
use alloc::string::String;
use async_trait::async_trait;
use embassy_embedded_hal::shared_bus::blocking::i2c::I2cDevice;

View File

@@ -226,7 +226,7 @@ impl Esp<'_> {
ssid: ap.ssid.as_str().to_string(),
bssid: format_bssid(&ap.bssid),
rssi: ap.signal_strength as i32,
channel: ap.channel as u8,
channel: ap.channel,
auth_method: format!("{:?}", ap.auth_method),
})
.collect();

View File

@@ -287,7 +287,7 @@ impl PlantState {
/// - Tuple of errors from sensor A and B
/// - Sensor warning indicating if warning LED should be lit (MissingSecondSensor)
pub fn plant_moisture_with_warning(&self, plant_conf: &PlantConfig) -> Option<f32> {
let moisture = match (
match (
self.sensor_a.moisture_percent(),
self.sensor_b.moisture_percent(),
) {
@@ -299,9 +299,7 @@ impl PlantState {
(Some(moisture), _) => Some(moisture),
(_, Some(moisture)) => Some(moisture),
_ => None,
};
moisture
}
}
pub fn needs_to_be_watered(