mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-15 02:36:45 -04:00
Clean up zbus::fdo into fdo where possible
This commit is contained in:
parent
fd500229d6
commit
58223d988b
4 changed files with 59 additions and 60 deletions
|
@ -10,7 +10,7 @@ use anyhow::Result;
|
|||
use tracing::error;
|
||||
use zbus::proxy::Builder;
|
||||
use zbus::zvariant::Fd;
|
||||
use zbus::{interface, Connection, Proxy, SignalContext};
|
||||
use zbus::{fdo, interface, Connection, Proxy, SignalContext};
|
||||
|
||||
use crate::cec::{HdmiCecControl, HdmiCecState};
|
||||
use crate::error::{to_zbus_error, to_zbus_fdo_error, zbus_to_zbus_fdo};
|
||||
|
@ -79,7 +79,7 @@ impl SteamOSManagerUser {
|
|||
}
|
||||
|
||||
#[zbus(property(emits_changed_signal = "false"))]
|
||||
async fn hdmi_cec_state(&self) -> zbus::fdo::Result<u32> {
|
||||
async fn hdmi_cec_state(&self) -> fdo::Result<u32> {
|
||||
match self.hdmi_cec.get_enabled_state().await {
|
||||
Ok(state) => Ok(state as u32),
|
||||
Err(e) => Err(to_zbus_fdo_error(e)),
|
||||
|
@ -90,7 +90,7 @@ impl SteamOSManagerUser {
|
|||
async fn set_hdmi_cec_state(&self, state: u32) -> zbus::Result<()> {
|
||||
let state = match HdmiCecState::try_from(state) {
|
||||
Ok(state) => state,
|
||||
Err(err) => return Err(zbus::fdo::Error::InvalidArgs(err.to_string()).into()),
|
||||
Err(err) => return Err(fdo::Error::InvalidArgs(err.to_string()).into()),
|
||||
};
|
||||
self.hdmi_cec
|
||||
.set_enabled_state(state)
|
||||
|
@ -99,12 +99,12 @@ impl SteamOSManagerUser {
|
|||
.map_err(to_zbus_error)
|
||||
}
|
||||
|
||||
async fn prepare_factory_reset(&self) -> zbus::fdo::Result<u32> {
|
||||
async fn prepare_factory_reset(&self) -> fdo::Result<u32> {
|
||||
method!(self, "PrepareFactoryReset")
|
||||
}
|
||||
|
||||
#[zbus(property(emits_changed_signal = "false"))]
|
||||
async fn wifi_power_management_state(&self) -> zbus::fdo::Result<u32> {
|
||||
async fn wifi_power_management_state(&self) -> fdo::Result<u32> {
|
||||
getter!(self, "WifiPowerManagementState")
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ impl SteamOSManagerUser {
|
|||
}
|
||||
|
||||
#[zbus(property(emits_changed_signal = "false"))]
|
||||
async fn fan_control_state(&self) -> zbus::fdo::Result<u32> {
|
||||
async fn fan_control_state(&self) -> fdo::Result<u32> {
|
||||
getter!(self, "FanControlState")
|
||||
}
|
||||
|
||||
|
@ -124,16 +124,16 @@ impl SteamOSManagerUser {
|
|||
}
|
||||
|
||||
#[zbus(property(emits_changed_signal = "const"))]
|
||||
async fn hardware_currently_supported(&self) -> zbus::fdo::Result<u32> {
|
||||
async fn hardware_currently_supported(&self) -> fdo::Result<u32> {
|
||||
getter!(self, "HardwareCurrentlySupported")
|
||||
}
|
||||
|
||||
#[zbus(property(emits_changed_signal = "false"))]
|
||||
async fn als_calibration_gain(&self) -> zbus::fdo::Result<f64> {
|
||||
async fn als_calibration_gain(&self) -> fdo::Result<f64> {
|
||||
getter!(self, "AlsCalibrationGain")
|
||||
}
|
||||
|
||||
async fn get_als_integration_time_file_descriptor(&self) -> zbus::fdo::Result<Fd> {
|
||||
async fn get_als_integration_time_file_descriptor(&self) -> fdo::Result<Fd> {
|
||||
let m = self
|
||||
.proxy
|
||||
.call_method::<&str, ()>("GetAlsIntegrationTimeFileDescriptor", &())
|
||||
|
@ -145,15 +145,15 @@ impl SteamOSManagerUser {
|
|||
}
|
||||
}
|
||||
|
||||
async fn update_bios(&self) -> zbus::fdo::Result<zbus::zvariant::OwnedObjectPath> {
|
||||
async fn update_bios(&self) -> fdo::Result<zbus::zvariant::OwnedObjectPath> {
|
||||
method!(self, "UpdateBios")
|
||||
}
|
||||
|
||||
async fn update_dock(&self) -> zbus::fdo::Result<zbus::zvariant::OwnedObjectPath> {
|
||||
async fn update_dock(&self) -> fdo::Result<zbus::zvariant::OwnedObjectPath> {
|
||||
method!(self, "UpdateDock")
|
||||
}
|
||||
|
||||
async fn trim_devices(&self) -> zbus::fdo::Result<zbus::zvariant::OwnedObjectPath> {
|
||||
async fn trim_devices(&self) -> fdo::Result<zbus::zvariant::OwnedObjectPath> {
|
||||
method!(self, "TrimDevices")
|
||||
}
|
||||
|
||||
|
@ -162,12 +162,12 @@ impl SteamOSManagerUser {
|
|||
device: &str,
|
||||
label: &str,
|
||||
validate: bool,
|
||||
) -> zbus::fdo::Result<zbus::zvariant::OwnedObjectPath> {
|
||||
) -> fdo::Result<zbus::zvariant::OwnedObjectPath> {
|
||||
method!(self, "FormatDevice", device, label, validate)
|
||||
}
|
||||
|
||||
#[zbus(property(emits_changed_signal = "false"))]
|
||||
async fn gpu_performance_level(&self) -> zbus::fdo::Result<u32> {
|
||||
async fn gpu_performance_level(&self) -> fdo::Result<u32> {
|
||||
getter!(self, "GpuPerformanceLevel")
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,7 @@ impl SteamOSManagerUser {
|
|||
}
|
||||
|
||||
#[zbus(property(emits_changed_signal = "false"))]
|
||||
async fn manual_gpu_clock(&self) -> zbus::fdo::Result<u32> {
|
||||
async fn manual_gpu_clock(&self) -> fdo::Result<u32> {
|
||||
getter!(self, "ManualGpuClock")
|
||||
}
|
||||
|
||||
|
@ -187,17 +187,17 @@ impl SteamOSManagerUser {
|
|||
}
|
||||
|
||||
#[zbus(property(emits_changed_signal = "const"))]
|
||||
async fn manual_gpu_clock_min(&self) -> zbus::fdo::Result<u32> {
|
||||
async fn manual_gpu_clock_min(&self) -> fdo::Result<u32> {
|
||||
getter!(self, "ManualGpuClockMin")
|
||||
}
|
||||
|
||||
#[zbus(property(emits_changed_signal = "const"))]
|
||||
async fn manual_gpu_clock_max(&self) -> zbus::fdo::Result<u32> {
|
||||
async fn manual_gpu_clock_max(&self) -> fdo::Result<u32> {
|
||||
getter!(self, "ManualGpuClockMax")
|
||||
}
|
||||
|
||||
#[zbus(property(emits_changed_signal = "false"))]
|
||||
async fn tdp_limit(&self) -> zbus::fdo::Result<u32> {
|
||||
async fn tdp_limit(&self) -> fdo::Result<u32> {
|
||||
getter!(self, "TdpLimit")
|
||||
}
|
||||
|
||||
|
@ -207,17 +207,17 @@ impl SteamOSManagerUser {
|
|||
}
|
||||
|
||||
#[zbus(property(emits_changed_signal = "const"))]
|
||||
async fn tdp_limit_min(&self) -> zbus::fdo::Result<u32> {
|
||||
async fn tdp_limit_min(&self) -> fdo::Result<u32> {
|
||||
getter!(self, "TdpLimitMin")
|
||||
}
|
||||
|
||||
#[zbus(property(emits_changed_signal = "const"))]
|
||||
async fn tdp_limit_max(&self) -> zbus::fdo::Result<u32> {
|
||||
async fn tdp_limit_max(&self) -> fdo::Result<u32> {
|
||||
getter!(self, "TdpLimitMax")
|
||||
}
|
||||
|
||||
#[zbus(property)]
|
||||
async fn wifi_debug_mode_state(&self) -> zbus::fdo::Result<u32> {
|
||||
async fn wifi_debug_mode_state(&self) -> fdo::Result<u32> {
|
||||
getter!(self, "WifiDebugModeState")
|
||||
}
|
||||
|
||||
|
@ -226,7 +226,7 @@ impl SteamOSManagerUser {
|
|||
mode: u32,
|
||||
buffer_size: u32,
|
||||
#[zbus(signal_context)] ctx: SignalContext<'_>,
|
||||
) -> zbus::fdo::Result<()> {
|
||||
) -> fdo::Result<()> {
|
||||
method!(self, "SetWifiDebugMode", mode, buffer_size)?;
|
||||
self.wifi_debug_mode_state_changed(&ctx)
|
||||
.await
|
||||
|
@ -235,7 +235,7 @@ impl SteamOSManagerUser {
|
|||
}
|
||||
|
||||
#[zbus(property(emits_changed_signal = "false"))]
|
||||
async fn wifi_backend(&self) -> zbus::fdo::Result<u32> {
|
||||
async fn wifi_backend(&self) -> fdo::Result<u32> {
|
||||
getter!(self, "WifiBackend")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue