Add GA503Q led modes

This commit is contained in:
Luke D. Jones
2021-05-30 10:19:25 +12:00
parent 62a18d4e57
commit b9c4ff9ca7
12 changed files with 41 additions and 31 deletions

View File

@@ -1,26 +1,4 @@
//! # DBus interface proxy for: `org.asuslinux.Daemon`
//!
//! This code was generated by `zbus-xmlgen` `1.0.0` from DBus introspection data.
//! Source: `Interface '/org/asuslinux/Anime' from service 'org.asuslinux.Daemon' on system bus`.
//!
//! You may prefer to adapt it, instead of using it verbatim.
//!
//! More information can be found in the
//! [Writing a client proxy](https://zeenix.pages.freedesktop.org/zbus/client.html)
//! section of the zbus documentation.
//!
//! This DBus object implements
//! [standard DBus interfaces](https://dbus.freedesktop.org/doc/dbus-specification.html),
//! (`org.freedesktop.DBus.*`) for which the following zbus proxies can be used:
//!
//! * [`zbus::fdo::IntrospectableProxy`]
//! * [`zbus::fdo::PeerProxy`]
//! * [`zbus::fdo::PropertiesProxy`]
//!
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
use std::sync::mpsc::Sender;
use rog_anime::{AnimeDataBuffer, AnimePowerStates};
use zbus::{dbus_proxy, Connection, Result};
@@ -29,21 +7,27 @@ use zbus::{dbus_proxy, Connection, Result};
default_path = "/org/asuslinux/Anime"
)]
trait Daemon {
/// SetBootOnOff method
/// Set whether the AniMe will show boot, suspend, or off animations
fn set_boot_on_off(&self, status: bool) -> zbus::Result<()>;
/// SetOnOff method
/// Set the global AniMe brightness
fn set_brightness(&self, bright: f32) -> zbus::Result<()>;
/// Set whether the AniMe is displaying images/data
fn set_on_off(&self, status: bool) -> zbus::Result<()>;
/// WriteDirect method
/// Writes a data stream of length. Will force system thread to exit until it is restarted
fn write(&self, input: &[u8]) -> zbus::Result<()>;
/// Get status of if the AniMe LEDs are on
#[dbus_proxy(property)]
fn awake_enabled(&self) -> zbus::Result<bool>;
/// Get the status of if factory system-status animations are enabled
#[dbus_proxy(property)]
fn boot_enabled(&self) -> zbus::Result<bool>;
/// Notify listeners of the status of AniMe LED power and factory system-status animations
#[dbus_proxy(signal)]
fn notify_power_states(&self, data: AnimePowerStates) -> zbus::Result<()>;
}
@@ -56,30 +40,36 @@ impl<'a> AnimeProxy<'a> {
Ok(AnimeProxy(DaemonProxy::new(&conn)?))
}
#[inline]
pub fn proxy(&self) -> &DaemonProxy<'a> {
&self.0
}
/// Set whether the AniMe will show boot, suspend, or off animations
#[inline]
pub fn toggle_boot_on(&self, on: bool) -> Result<()> {
pub fn set_system_animations(&self, on: bool) -> Result<()> {
self.0.set_boot_on_off(on)
}
/// Set whether the AniMe is displaying images/data
#[inline]
pub fn toggle_on(&self, on: bool) -> Result<()> {
pub fn set_led_power(&self, on: bool) -> Result<()> {
self.0.set_on_off(on)
}
/// Writes a data stream of length. Will force system thread to exit until it is restarted
#[inline]
pub fn write(&self, input: AnimeDataBuffer) -> Result<()> {
self.0.write(input.get())
}
/// Get status of if the AniMe LEDs are on
#[inline]
pub fn awake_enabled(&self) -> Result<bool> {
self.0.awake_enabled()
}
/// Get the status of if factory system-status animations are enabled
#[inline]
pub fn boot_enabled(&self) -> Result<bool> {
self.0.boot_enabled()

View File

@@ -47,6 +47,7 @@ impl<'a> ChargeProxy<'a> {
Ok(ChargeProxy(DaemonProxy::new(&conn)?))
}
#[inline]
pub fn proxy(&self) -> &DaemonProxy<'a> {
&self.0
}

View File

@@ -55,6 +55,7 @@ impl<'a> GfxProxy<'a> {
Ok(GfxProxy(DaemonProxy::new(&conn)?))
}
#[inline]
pub fn proxy(&self) -> &DaemonProxy<'a> {
&self.0
}

View File

@@ -84,6 +84,7 @@ impl<'a> LedProxy<'a> {
Ok(LedProxy(DaemonProxy::new(&conn)?))
}
#[inline]
pub fn proxy(&self) -> &DaemonProxy<'a> {
&self.0
}

View File

@@ -63,6 +63,7 @@ impl<'a> ProfileProxy<'a> {
Ok(ProfileProxy(DaemonProxy::new(&conn)?))
}
#[inline]
pub fn proxy(&self) -> &DaemonProxy<'a> {
&self.0
}

View File

@@ -57,6 +57,7 @@ impl<'a> RogBiosProxy<'a> {
Ok(RogBiosProxy(DaemonProxy::new(&conn)?))
}
#[inline]
pub fn proxy(&self) -> &DaemonProxy<'a> {
&self.0
}

View File

@@ -39,6 +39,7 @@ impl<'a> SupportProxy<'a> {
Ok(SupportProxy(DaemonProxy::new(&conn)?))
}
#[inline]
pub fn proxy(&self) -> &DaemonProxy<'a> {
&self.0
}