mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Enforce valid image brightness in daemon and asusctl
This commit is contained in:
committed by
Luke Jones
parent
ef04549c8e
commit
c0e36295b7
@@ -16,6 +16,7 @@ pub enum AnimeError {
|
||||
Udev(String, std::io::Error),
|
||||
NoDevice,
|
||||
UnsupportedDevice,
|
||||
InvalidBrightness(f32),
|
||||
}
|
||||
|
||||
impl fmt::Display for AnimeError {
|
||||
@@ -36,6 +37,11 @@ impl fmt::Display for AnimeError {
|
||||
AnimeError::Udev(deets, error) => write!(f, "udev {}: {}", deets, error),
|
||||
AnimeError::NoDevice => write!(f, "No AniMe Matrix device found"),
|
||||
AnimeError::UnsupportedDevice => write!(f, "Unsupported AniMe Matrix device found"),
|
||||
AnimeError::InvalidBrightness(bright) => write!(
|
||||
f,
|
||||
"Image brightness must be between 0.0 and 1.0 (inclusive), was {}",
|
||||
bright
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user