profiles: error if fan curve parse is less than 8

Closes #225
This commit is contained in:
Luke D. Jones
2022-08-20 22:05:22 +12:00
parent 3fe5896596
commit 92009ef96c
2 changed files with 12 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ pub enum ProfileError {
/// (pwm/temp, prev, next)
ParseFanCurvePrevHigher(&'static str, u8, u8),
ParseFanCurvePercentOver100(u8),
NotEnoughPoints,
// Zbus(zbus::Error),
}
@@ -24,6 +25,7 @@ impl fmt::Display for ProfileError {
ProfileError::Read(path, error) => write!(f, "Read {}: {}", path, error),
ProfileError::Write(path, error) => write!(f, "Write {}: {}", path, error),
ProfileError::NotSupported => write!(f, "Not supported"),
ProfileError::NotEnoughPoints => write!(f, "Less than 8 curve points supplied"),
ProfileError::NotFound(deets) => write!(f, "Not found: {}", deets),
ProfileError::Io(detail) => write!(f, "std::io error: {}", detail),
ProfileError::ParseProfileName => write!(f, "Invalid profile name"),