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

@@ -4,8 +4,8 @@
use notify_rust::{Hint, Notification, NotificationHandle};
use rog_aura::AuraEffect;
use rog_dbus::{
zbus_anime::AnimeProxy, zbus_charge::ChargeProxy, zbus_led::LedProxy,
zbus_platform::RogBiosProxy, zbus_profile::ProfileProxy,
zbus_anime::AnimeProxy, zbus_led::LedProxy, zbus_platform::RogBiosProxy,
zbus_power::PowerProxy, zbus_profile::ProfileProxy,
};
use rog_profiles::Profile;
use smol::{future, Executor};
@@ -102,7 +102,7 @@ pub fn start_notifications(
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() {