mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
More updating to zbus 4.0.1
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
use rog_anime::usb::Brightness;
|
||||
use rog_anime::{Animations, AnimeDataBuffer, DeviceState as AnimeDeviceState};
|
||||
use zbus::dbus_proxy;
|
||||
use zbus::proxy;
|
||||
|
||||
#[dbus_proxy(
|
||||
#[proxy(
|
||||
interface = "org.asuslinux.Daemon",
|
||||
default_service = "org.asuslinux.Daemon",
|
||||
default_path = "/org/asuslinux/Anime"
|
||||
@@ -18,48 +18,48 @@ trait Anime {
|
||||
fn write(&self, input: AnimeDataBuffer) -> zbus::Result<()>;
|
||||
|
||||
/// NotifyDeviceState signal
|
||||
#[dbus_proxy(signal)]
|
||||
#[zbus(signal)]
|
||||
fn notify_device_state(&self, data: AnimeDeviceState) -> zbus::Result<()>;
|
||||
|
||||
/// Brightness property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn brightness(&self) -> zbus::Result<Brightness>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_brightness(&self, value: Brightness) -> zbus::Result<()>;
|
||||
|
||||
/// BuiltinAnimations property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn builtin_animations(&self) -> zbus::Result<Animations>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_builtin_animations(&self, value: Animations) -> zbus::Result<()>;
|
||||
|
||||
/// BuiltinsEnabled property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn builtins_enabled(&self) -> zbus::Result<bool>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_builtins_enabled(&self, value: bool) -> zbus::Result<()>;
|
||||
|
||||
/// EnableDisplay property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn enable_display(&self) -> zbus::Result<bool>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_enable_display(&self, value: bool) -> zbus::Result<()>;
|
||||
|
||||
/// OffWhenLidClosed property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn off_when_lid_closed(&self) -> zbus::Result<bool>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_off_when_lid_closed(&self, value: bool) -> zbus::Result<()>;
|
||||
|
||||
/// OffWhenSuspended property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn off_when_suspended(&self) -> zbus::Result<bool>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_off_when_suspended(&self, value: bool) -> zbus::Result<()>;
|
||||
|
||||
/// OffWhenUnplugged property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn off_when_unplugged(&self) -> zbus::Result<bool>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_off_when_unplugged(&self, value: bool) -> zbus::Result<()>;
|
||||
}
|
||||
|
||||
@@ -27,11 +27,11 @@ use rog_aura::aura_detection::PowerZones;
|
||||
use rog_aura::usb::{AuraDevice, AuraPowerDev};
|
||||
use rog_aura::{AuraEffect, AuraModeNum, AuraZone, LedBrightness};
|
||||
use zbus::blocking::Connection;
|
||||
use zbus::{dbus_proxy, Result};
|
||||
use zbus::{proxy, Result};
|
||||
|
||||
const BLOCKING_TIME: u64 = 33; // 100ms = 10 FPS, max 50ms = 20 FPS, 40ms = 25 FPS
|
||||
|
||||
#[dbus_proxy(
|
||||
#[proxy(
|
||||
interface = "org.asuslinux.Daemon",
|
||||
default_service = "org.asuslinux.Daemon",
|
||||
default_path = "/org/asuslinux/Aura"
|
||||
@@ -44,47 +44,47 @@ trait Aura {
|
||||
fn direct_addressing_raw(&self, data: UsbPackets) -> zbus::Result<()>;
|
||||
|
||||
/// Brightness property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn brightness(&self) -> zbus::Result<LedBrightness>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_brightness(&self, value: LedBrightness) -> zbus::Result<()>;
|
||||
|
||||
/// DeviceType property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn device_type(&self) -> zbus::Result<AuraDevice>;
|
||||
|
||||
/// LedMode property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn led_mode(&self) -> zbus::Result<AuraModeNum>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_led_mode(&self, value: AuraModeNum) -> zbus::Result<()>;
|
||||
|
||||
/// LedModeData property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn led_mode_data(&self) -> zbus::Result<AuraEffect>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_led_mode_data(&self, value: AuraEffect) -> zbus::Result<()>;
|
||||
|
||||
/// LedPower property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn led_power(&self) -> zbus::Result<AuraPowerDev>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_led_power(&self, value: (AuraPowerDev, bool)) -> zbus::Result<()>;
|
||||
|
||||
/// SupportedBrightness property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn supported_brightness(&self) -> zbus::Result<Vec<LedBrightness>>;
|
||||
|
||||
/// SupportedBasicModes property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn supported_basic_modes(&self) -> zbus::Result<Vec<AuraModeNum>>;
|
||||
|
||||
/// SupportedBasicZones property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn supported_basic_zones(&self) -> zbus::Result<Vec<AuraZone>>;
|
||||
|
||||
/// SupportedPowerZones property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn supported_power_zones(&self) -> zbus::Result<Vec<PowerZones>>;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
use rog_platform::platform::ThrottlePolicy;
|
||||
use rog_profiles::fan_curve_set::CurveData;
|
||||
use rog_profiles::FanCurvePU;
|
||||
use zbus::dbus_proxy;
|
||||
use zbus::proxy;
|
||||
|
||||
#[dbus_proxy(
|
||||
#[proxy(
|
||||
interface = "org.asuslinux.Daemon",
|
||||
default_service = "org.asuslinux.Daemon",
|
||||
default_path = "/org/asuslinux/FanCurves"
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
|
||||
|
||||
use rog_platform::platform::{GpuMode, Properties, ThrottlePolicy};
|
||||
use zbus::dbus_proxy;
|
||||
use zbus::proxy;
|
||||
|
||||
#[dbus_proxy(
|
||||
#[proxy(
|
||||
interface = "org.asuslinux.Daemon",
|
||||
default_service = "org.asuslinux.Daemon",
|
||||
default_path = "/org/asuslinux/Platform"
|
||||
@@ -39,88 +39,88 @@ trait Platform {
|
||||
fn supported_properties(&self) -> zbus::Result<Vec<Properties>>;
|
||||
|
||||
/// ChargeControlEndThreshold property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn charge_control_end_threshold(&self) -> zbus::Result<u8>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_charge_control_end_threshold(&self, value: u8) -> zbus::Result<()>;
|
||||
|
||||
/// DgpuDisable property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn dgpu_disable(&self) -> zbus::Result<bool>;
|
||||
|
||||
/// EgpuEnable property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn egpu_enable(&self) -> zbus::Result<bool>;
|
||||
|
||||
/// GpuMuxMode property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn gpu_mux_mode(&self) -> zbus::Result<u8>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_gpu_mux_mode(&self, value: GpuMode) -> zbus::Result<()>;
|
||||
|
||||
/// MiniLedMode property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn mini_led_mode(&self) -> zbus::Result<bool>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_mini_led_mode(&self, value: bool) -> zbus::Result<()>;
|
||||
|
||||
/// NvDynamicBoost property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn nv_dynamic_boost(&self) -> zbus::Result<u8>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_nv_dynamic_boost(&self, value: u8) -> zbus::Result<()>;
|
||||
|
||||
/// NvTempTarget property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn nv_temp_target(&self) -> zbus::Result<u8>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_nv_temp_target(&self, value: u8) -> zbus::Result<()>;
|
||||
|
||||
/// PanelOd property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn panel_od(&self) -> zbus::Result<bool>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_panel_od(&self, value: bool) -> zbus::Result<()>;
|
||||
|
||||
/// PostAnimationSound property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn post_animation_sound(&self) -> zbus::Result<bool>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_post_animation_sound(&self, value: bool) -> zbus::Result<()>;
|
||||
|
||||
/// PptApuSppt property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn ppt_apu_sppt(&self) -> zbus::Result<u8>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_ppt_apu_sppt(&self, value: u8) -> zbus::Result<()>;
|
||||
|
||||
/// PptFppt property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn ppt_fppt(&self) -> zbus::Result<u8>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_ppt_fppt(&self, value: u8) -> zbus::Result<()>;
|
||||
|
||||
/// PptPl1Spl property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn ppt_pl1_spl(&self) -> zbus::Result<u8>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_ppt_pl1_spl(&self, value: u8) -> zbus::Result<()>;
|
||||
|
||||
/// PptPl2Sppt property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn ppt_pl2_sppt(&self) -> zbus::Result<u8>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_ppt_pl2_sppt(&self, value: u8) -> zbus::Result<()>;
|
||||
|
||||
/// PptPlatformSppt property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn ppt_platform_sppt(&self) -> zbus::Result<u8>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_ppt_platform_sppt(&self, value: u8) -> zbus::Result<()>;
|
||||
|
||||
/// ThrottlePolicy property
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn throttle_thermal_policy(&self) -> zbus::Result<ThrottlePolicy>;
|
||||
#[dbus_proxy(property)]
|
||||
#[zbus(property)]
|
||||
fn set_throttle_thermal_policy(&self, value: ThrottlePolicy) -> zbus::Result<()>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user