Fluke/dbus refactor

This commit is contained in:
Luke Jones
2023-12-03 20:44:01 +00:00
parent f6e4cc0626
commit 0a69c23288
143 changed files with 5421 additions and 10343 deletions

View File

@@ -1,13 +1,8 @@
pub static DBUS_NAME: &str = "org.asuslinux.Daemon";
pub static DBUS_PATH: &str = "/org/asuslinux/Daemon";
pub static DBUS_IFACE: &str = "org.asuslinux.Daemon";
pub use asusd::{DBUS_IFACE, DBUS_NAME, DBUS_PATH};
pub mod zbus_anime;
pub mod zbus_led;
pub mod zbus_aura;
pub mod zbus_fan_curves;
pub mod zbus_platform;
pub mod zbus_power;
pub mod zbus_profile;
pub mod zbus_supported;
// use rog_anime::AnimePowerStates;
// use rog_aura::{AuraEffect, LedPowerStates};
@@ -19,11 +14,9 @@ pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub struct DbusProxiesBlocking<'a> {
anime: zbus_anime::AnimeProxyBlocking<'a>,
charge: zbus_power::PowerProxyBlocking<'a>,
led: zbus_led::LedProxyBlocking<'a>,
profile: zbus_profile::ProfileProxyBlocking<'a>,
rog_bios: zbus_platform::RogBiosProxyBlocking<'a>,
supported: zbus_supported::SupportedProxyBlocking<'a>,
led: zbus_aura::AuraProxyBlocking<'a>,
profile: zbus_fan_curves::FanCurvesProxyBlocking<'a>,
rog_bios: zbus_platform::PlatformProxyBlocking<'a>,
}
impl<'a> DbusProxiesBlocking<'a> {
@@ -34,11 +27,9 @@ impl<'a> DbusProxiesBlocking<'a> {
Ok((
DbusProxiesBlocking {
anime: zbus_anime::AnimeProxyBlocking::new(&conn)?,
led: zbus_led::LedProxyBlocking::new(&conn)?,
charge: zbus_power::PowerProxyBlocking::new(&conn)?,
profile: zbus_profile::ProfileProxyBlocking::new(&conn)?,
rog_bios: zbus_platform::RogBiosProxyBlocking::new(&conn)?,
supported: zbus_supported::SupportedProxyBlocking::new(&conn)?,
led: zbus_aura::AuraProxyBlocking::new(&conn)?,
profile: zbus_fan_curves::FanCurvesProxyBlocking::new(&conn)?,
rog_bios: zbus_platform::PlatformProxyBlocking::new(&conn)?,
},
conn,
))
@@ -48,25 +39,17 @@ impl<'a> DbusProxiesBlocking<'a> {
&self.anime
}
pub fn charge(&self) -> &zbus_power::PowerProxyBlocking<'a> {
&self.charge
}
pub fn led(&self) -> &zbus_led::LedProxyBlocking<'a> {
pub fn aura(&self) -> &zbus_aura::AuraProxyBlocking<'a> {
&self.led
}
pub fn profile(&self) -> &zbus_profile::ProfileProxyBlocking<'a> {
pub fn fan_curves(&self) -> &zbus_fan_curves::FanCurvesProxyBlocking<'a> {
&self.profile
}
pub fn rog_bios(&self) -> &zbus_platform::RogBiosProxyBlocking<'a> {
pub fn platform(&self) -> &zbus_platform::PlatformProxyBlocking<'a> {
&self.rog_bios
}
pub fn supported(&self) -> &zbus_supported::SupportedProxyBlocking<'a> {
&self.supported
}
}
/// This is the main way to communicate with the DBUS interface
@@ -88,11 +71,9 @@ impl<'a> RogDbusClientBlocking<'a> {
pub struct DbusProxies<'a> {
anime: zbus_anime::AnimeProxy<'a>,
charge: zbus_power::PowerProxy<'a>,
led: zbus_led::LedProxy<'a>,
profile: zbus_profile::ProfileProxy<'a>,
rog_bios: zbus_platform::RogBiosProxy<'a>,
supported: zbus_supported::SupportedProxy<'a>,
led: zbus_aura::AuraProxy<'a>,
profile: zbus_fan_curves::FanCurvesProxy<'a>,
rog_bios: zbus_platform::PlatformProxy<'a>,
}
impl<'a> DbusProxies<'a> {
@@ -103,11 +84,9 @@ impl<'a> DbusProxies<'a> {
Ok((
DbusProxies {
anime: zbus_anime::AnimeProxy::new(&conn).await?,
led: zbus_led::LedProxy::new(&conn).await?,
charge: zbus_power::PowerProxy::new(&conn).await?,
profile: zbus_profile::ProfileProxy::new(&conn).await?,
rog_bios: zbus_platform::RogBiosProxy::new(&conn).await?,
supported: zbus_supported::SupportedProxy::new(&conn).await?,
led: zbus_aura::AuraProxy::new(&conn).await?,
profile: zbus_fan_curves::FanCurvesProxy::new(&conn).await?,
rog_bios: zbus_platform::PlatformProxy::new(&conn).await?,
},
conn,
))
@@ -117,25 +96,17 @@ impl<'a> DbusProxies<'a> {
&self.anime
}
pub fn charge(&self) -> &zbus_power::PowerProxy<'a> {
&self.charge
}
pub fn led(&self) -> &zbus_led::LedProxy<'a> {
pub fn led(&self) -> &zbus_aura::AuraProxy<'a> {
&self.led
}
pub fn profile(&self) -> &zbus_profile::ProfileProxy<'a> {
pub fn profile(&self) -> &zbus_fan_curves::FanCurvesProxy<'a> {
&self.profile
}
pub fn rog_bios(&self) -> &zbus_platform::RogBiosProxy<'a> {
pub fn rog_bios(&self) -> &zbus_platform::PlatformProxy<'a> {
&self.rog_bios
}
pub fn supported(&self) -> &zbus_supported::SupportedProxy<'a> {
&self.supported
}
}
/// This is the main way to communicate with the DBUS interface