tesla-charge-controller/src/config.rs

24 lines
457 B
Rust
Raw Normal View History

use std::time::Duration;
2023-12-25 21:22:08 +11:00
use serde::{Deserialize, Serialize};
2023-12-28 12:41:05 +11:00
use crate::Coords;
2023-12-25 21:22:08 +11:00
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct Config {
2023-12-28 12:41:05 +11:00
pub watch_interval: Duration,
pub coords: Coords,
}
2023-12-25 21:22:08 +11:00
impl Default for Config {
fn default() -> Self {
Self {
watch_interval: Duration::from_secs(60),
2023-12-28 12:41:05 +11:00
coords: Coords {
latitude: 0.,
longitude: 0.,
},
}
}
}