use serde::{Deserialize, Serialize};
pub const CRITICAL_RELAY_BATTERY_LEVEL: u8 = 15;
#[derive(Debug, Clone)]
pub struct RelayConfig {
pub min_battery_for_relay: u8,
pub allow_relay: bool,
pub relay_priority: RelayPriority,
}
impl Default for RelayConfig {
fn default() -> Self {
Self {
min_battery_for_relay: 30,
allow_relay: true,
relay_priority: RelayPriority::Auto,
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum RelayPriority {
Never,
Auto,
Always,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum RelayRole {
Regular,
Relay,
}