Skip to content

Commit

Permalink
identify boards by prefix instead of exact board name
Browse files Browse the repository at this point in the history
  • Loading branch information
Yarn committed Aug 11, 2021
1 parent c2a725f commit d3334c8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions rog_fan_curve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,18 @@ impl Board {
Self::from_name(name.trim())
}

/// Identifies the board using prefixes that have been reported as working
pub fn from_name(name: &str) -> Option<Self> {
for prefix in &["GA401I", "GA401Q"] {
if name.starts_with(prefix) {
return Some(Board::Ga401)
}
}
None
}

/// Identifies the board using exact names that have been reported as working
pub fn from_name_strict(name: &str) -> Option<Self> {
match name {
"GA401IV" => Some(Board::Ga401),
"GA401IU" => Some(Board::Ga401),
Expand Down

0 comments on commit d3334c8

Please sign in to comment.