refactor: unify moisture handling, update config structure, and add peer dependencies
This commit is contained in:
@@ -115,8 +115,8 @@ pub struct PlantControllerConfig {
|
||||
#[serde(default)]
|
||||
pub struct PlantConfig {
|
||||
pub mode: PlantWateringMode,
|
||||
pub target_moisture: f32,
|
||||
pub min_moisture: f32,
|
||||
pub target_moisture: u8,
|
||||
pub min_moisture: u8,
|
||||
pub pump_time_s: u16,
|
||||
pub pump_limit_ml: u16,
|
||||
pub pump_cooldown_min: u16,
|
||||
@@ -125,8 +125,8 @@ pub struct PlantConfig {
|
||||
pub sensor_a: bool,
|
||||
pub sensor_b: bool,
|
||||
pub max_consecutive_pump_count: u8,
|
||||
pub moisture_sensor_min_frequency: Option<f32>, // Optional min frequency
|
||||
pub moisture_sensor_max_frequency: Option<f32>, // Optional max frequency
|
||||
pub moisture_sensor_min_frequency: Option<u16>, // Optional min frequency
|
||||
pub moisture_sensor_max_frequency: Option<u16>, // Optional max frequency
|
||||
pub min_pump_current_ma: u16,
|
||||
pub max_pump_current_ma: u16,
|
||||
pub ignore_current_error: bool,
|
||||
@@ -136,8 +136,8 @@ impl Default for PlantConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
mode: PlantWateringMode::Off,
|
||||
target_moisture: 40.,
|
||||
min_moisture: 30.,
|
||||
target_moisture: 40,
|
||||
min_moisture: 30,
|
||||
pump_time_s: 30,
|
||||
pump_limit_ml: 5000,
|
||||
pump_cooldown_min: 60,
|
||||
|
||||
Reference in New Issue
Block a user