manager: Remove HardwareCurrentlySupported

This value only makes sense for Steam, and since Steam can query it directly,
this removes it from the DBus interface.
This commit is contained in:
Vicki Pfau 2025-02-05 18:11:31 -08:00
parent cb112711b3
commit dedbfd4207
4 changed files with 1 additions and 77 deletions

View file

@ -7,7 +7,6 @@
use anyhow::{bail, ensure, Error, Result};
use num_enum::TryFromPrimitive;
use std::fmt;
use std::str::FromStr;
use strum::{Display, EnumString};
use tokio::fs;
@ -29,14 +28,6 @@ pub(crate) enum HardwareVariant {
Galileo,
}
#[derive(PartialEq, Debug, Copy, Clone, TryFromPrimitive)]
#[repr(u32)]
pub(crate) enum HardwareCurrentlySupported {
Unknown = 0,
UnsupportedPrototype = 1,
Supported = 2,
}
#[derive(Display, EnumString, PartialEq, Debug, Copy, Clone, TryFromPrimitive)]
#[strum(ascii_case_insensitive)]
#[repr(u32)]
@ -58,16 +49,6 @@ impl FromStr for HardwareVariant {
}
}
impl fmt::Display for HardwareCurrentlySupported {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
HardwareCurrentlySupported::Unknown => write!(f, "Unknown"),
HardwareCurrentlySupported::UnsupportedPrototype => write!(f, "Unsupported Prototype"),
HardwareCurrentlySupported::Supported => write!(f, "Supported"),
}
}
}
#[derive(Display, EnumString, PartialEq, Debug, Copy, Clone, TryFromPrimitive)]
#[strum(ascii_case_insensitive)]
#[repr(u32)]
@ -94,17 +75,6 @@ pub(crate) async fn is_deck() -> Result<bool> {
}
}
pub(crate) async fn check_support() -> Result<HardwareCurrentlySupported> {
// Run jupiter-check-support note this script does exit 1 for "Support: No" case
// so no need to parse output, etc.
let res = script_exit_code("/usr/bin/jupiter-check-support", &[] as &[String; 0]).await?;
Ok(match res {
0 => HardwareCurrentlySupported::Supported,
_ => HardwareCurrentlySupported::UnsupportedPrototype,
})
}
pub(crate) struct FanControl {
connection: Connection,
}
@ -232,25 +202,6 @@ pub mod test {
assert_eq!(variant().await.unwrap(), HardwareVariant::Unknown);
}
#[test]
fn hardware_currently_supported_roundtrip() {
enum_roundtrip!(HardwareCurrentlySupported {
0: u32 = Unknown,
1: u32 = UnsupportedPrototype,
2: u32 = Supported,
});
assert!(HardwareCurrentlySupported::try_from(3).is_err());
assert_eq!(HardwareCurrentlySupported::Unknown.to_string(), "Unknown");
assert_eq!(
HardwareCurrentlySupported::UnsupportedPrototype.to_string(),
"Unsupported Prototype"
);
assert_eq!(
HardwareCurrentlySupported::Supported.to_string(),
"Supported"
);
}
#[test]
fn fan_control_state_roundtrip() {
enum_roundtrip!(FanControlState {