mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-01-22 17:33:19 +01:00
Animatrix: simulators, add features
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use std::convert::TryFrom;
|
||||
use std::str::FromStr;
|
||||
use std::thread::sleep;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
@@ -53,6 +54,19 @@ pub enum AnimeType {
|
||||
Unknown,
|
||||
}
|
||||
|
||||
impl FromStr for AnimeType {
|
||||
type Err = AnimeError;
|
||||
|
||||
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
|
||||
Ok(match s {
|
||||
"ga401" | "GA401" => Self::GA401,
|
||||
"ga402" | "GA402" => Self::GA402,
|
||||
"gu604" | "GU604" => Self::GU604,
|
||||
_ => Self::Unknown,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl AnimeType {
|
||||
/// The width of diagonal images
|
||||
pub fn width(&self) -> usize {
|
||||
|
||||
@@ -156,7 +156,7 @@ pub fn get_anime_type() -> Result<AnimeType, AnimeError> {
|
||||
return Ok(AnimeType::GU604);
|
||||
}
|
||||
log::warn!("AniMe Matrix device found but not yet supported, will default to a GA402 layout");
|
||||
Ok(AnimeType::GA402)
|
||||
Ok(AnimeType::Unknown)
|
||||
}
|
||||
|
||||
/// Get the two device initialization packets. These are required for device
|
||||
|
||||
Reference in New Issue
Block a user