Further improve the daemon controller pattern and reduce cloned code

This commit is contained in:
Luke D. Jones
2022-09-23 20:07:43 +12:00
parent 7ea1f41286
commit 30550aaa91
21 changed files with 382 additions and 416 deletions

View File

@@ -1,7 +1,7 @@
use notify_rust::{Hint, Notification, NotificationHandle};
use rog_aura::AuraEffect;
use rog_dbus::{
zbus_charge::ChargeProxy, zbus_led::LedProxy, zbus_platform::RogBiosProxy,
zbus_led::LedProxy, zbus_platform::RogBiosProxy, zbus_power::PowerProxy,
zbus_profile::ProfileProxy,
};
use rog_profiles::Profile;
@@ -69,7 +69,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
executor
.spawn(async move {
let conn = zbus::Connection::system().await.unwrap();
let proxy = ChargeProxy::new(&conn).await.unwrap();
let proxy = PowerProxy::new(&conn).await.unwrap();
if let Ok(p) = proxy.receive_notify_charge_control_end_threshold().await {
p.for_each(|e| {
if let Ok(out) = e.args() {