hardware: Detect ROG Ally and ROG Ally X

This commit is contained in:
Vicki Pfau 2025-03-10 21:26:59 -07:00
parent 9dc61ee252
commit 3e1ab5a2c0

View file

@ -38,6 +38,8 @@ pub(crate) enum DeviceType {
SteamDeck,
LegionGo,
LegionGoS,
RogAlly,
RogAllyX,
}
#[derive(Display, EnumString, PartialEq, Debug, Copy, Clone, TryFromPrimitive)]
@ -79,6 +81,8 @@ pub(crate) async fn device_variant() -> Result<(DeviceType, String)> {
let board_name = fs::read_to_string(path(BOARD_NAME_PATH)).await?;
let board_name = board_name.trim_end();
Ok(match (sys_vendor.trim_end(), product_name, board_name) {
("ASUSTeK COMPUTER INC.", _, "RC71L") => (DeviceType::RogAlly, board_name.to_string()),
("ASUSTeK COMPUTER INC.", _, "RC72LA") => (DeviceType::RogAllyX, board_name.to_string()),
("LENOVO", "83E1", _) => (DeviceType::LegionGo, product_name.to_string()),
("LENOVO", "83L3" | "83N6" | "83Q2" | "83Q3", _) => {
(DeviceType::LegionGoS, product_name.to_string())