Strategy formatting

This commit is contained in:
2026-07-25 18:20:22 +02:00
parent 009f8b76b3
commit 7290154025
3 changed files with 97 additions and 15 deletions
+19
View File
@@ -125,3 +125,22 @@ impl std::fmt::Display for AlertLevel {
}
}
}
impl std::fmt::Display for Mode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Auto => write!(f, "\x1b[96mAUTO\x1b[0m"),
Self::Manual => write!(f, "\x1b[97mMANUAL\x1b[0m"),
}
}
}
impl std::fmt::Display for ItemState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Running => write!(f, "\x1b[92mRUNNING\x1b[0m"),
Self::Off => write!(f, "\x1b[90mOFF\x1b[0m"),
Self::Error => write!(f, "\x1b[91mERROR\x1b[0m"),
}
}
}