Strategy formatting
This commit is contained in:
@@ -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"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user