fix rtc storage

This commit is contained in:
2024-02-15 23:00:05 +01:00
parent 060a1cc32d
commit 680d1c3aaf
12 changed files with 8891 additions and 7909 deletions

View File

@@ -1,4 +1,4 @@
use std::fmt;
use std::{fmt, str::FromStr};
use serde::{Deserialize, Serialize};
@@ -14,8 +14,8 @@ pub struct Config {
pub tank_sensor_enabled: bool,
pub tank_useable_ml: u32,
pub tank_warn_percent: u8,
pub tank_empty_percent: u16,
pub tank_full_percent: u16,
pub tank_empty_percent: u8,
pub tank_full_percent: u8,
pub night_lamp_hour_start: u8,
pub night_lamp_hour_end: u8,
@@ -27,8 +27,8 @@ pub struct Config {
impl Default for Config {
fn default() -> Self {
Self {
base_topic: "plant/one".into(),
mqtt_url: "mqtt://192.168.1.1:1883".into(),
base_topic: heapless::String::from_str("plant/one").unwrap(),
mqtt_url: heapless::String::from_str("mqtt://192.168.1.1:1883").unwrap(),
tank_allow_pumping_if_sensor_error: true,
tank_sensor_enabled: true,
tank_warn_percent: 50,
@@ -38,8 +38,8 @@ impl Default for Config {
plants: [Plant::default(); PLANT_COUNT],
max_consecutive_pump_count: 15,
tank_useable_ml: 5000,
tank_empty_percent: 0_u16,
tank_full_percent: 100_u16,
tank_empty_percent: 0_u8,
tank_full_percent: 100_u8,
}
}
}