Forwarded error from ProfileProxy::profile_names instead of 'expecting' there. Handled error up in main by logging. Reorganized code in ctrl_fan_cpu to keep consistent code structure

This commit is contained in:
Tony
2021-03-17 01:50:16 +00:00
committed by Luke Jones
parent c29afaf751
commit ad150903af
4 changed files with 34 additions and 0 deletions

View File

@@ -41,6 +41,9 @@ trait Daemon {
/// Profiles method
fn profiles(&self) -> zbus::Result<String>;
/// ProfileNames method
fn profile_names(&self) -> zbus::Result<String>;
/// SetProfile method
fn set_profile(&self, profile: &str) -> zbus::Result<()>;
@@ -82,6 +85,11 @@ impl<'a> ProfileProxy<'a> {
self.0.set_profile(&serde_json::to_string(cmd).unwrap())
}
#[inline]
pub fn profile_names(&self) -> Result<String> {
self.0.profile_names()
}
#[inline]
pub fn connect_notify_profile(
&self,