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

@ -212,15 +212,6 @@
-->
<interface name="com.steampowered.SteamOSManager1.Manager2">
<!--
HardwareCurrentlySupported:
Reports whether the current hardware is supported or not.
Valid states: 0 = Unknown, 1 = Unsupported Prototype, 2 = Supported
-->
<property name="HardwareCurrentlySupported" type="u" access="read"/>
<!--
ReloadConfig:

View file

@ -39,9 +39,6 @@ enum Commands {
/// Get luminance sensor calibration gain
GetAlsCalibrationGain,
/// Get if the hardware is currently supported
GetHardwareCurrentlySupported,
/// Set the fan control state
SetFanControlState {
/// Valid options are `bios`, `os`
@ -248,11 +245,6 @@ async fn main() -> Result<()> {
let gains = gain.into_iter().map(|g| g.to_string()).join(", ");
println!("ALS calibration gain: {gains}");
}
Commands::GetHardwareCurrentlySupported => {
let proxy = Manager2Proxy::new(&conn).await?;
let supported = proxy.hardware_currently_supported().await?;
println!("Hardware currently supported: {supported}");
}
Commands::SetFanControlState { state } => {
let proxy = FanControl1Proxy::new(&conn).await?;
proxy.set_fan_control_state(*state as u32).await?;

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 {

View file

@ -19,9 +19,7 @@ use crate::cec::{HdmiCecControl, HdmiCecState};
use crate::daemon::user::Command;
use crate::daemon::DaemonCommand;
use crate::error::{to_zbus_error, to_zbus_fdo_error, zbus_to_zbus_fdo};
use crate::hardware::{
check_support, is_deck, variant, HardwareCurrentlySupported, HardwareVariant,
};
use crate::hardware::{is_deck, variant, HardwareVariant};
use crate::job::JobManagerCommand;
use crate::platform::platform_config;
use crate::power::{
@ -428,14 +426,6 @@ impl HdmiCec1 {
#[interface(name = "com.steampowered.SteamOSManager1.Manager2")]
impl Manager2 {
#[zbus(property(emits_changed_signal = "const"))]
async fn hardware_currently_supported(&self) -> u32 {
match check_support().await {
Ok(res) => res as u32,
Err(_) => HardwareCurrentlySupported::Unknown as u32,
}
}
async fn reload_config(&self) -> fdo::Result<()> {
self.channel
.send(DaemonCommand::ReadConfig)