Merge branch 'feature/dbus-profile-name' into 'next'

 Add ActiveProfileName() dbus method returning name of current profile

See merge request asus-linux/asus-nb-ctrl!5
This commit is contained in:
Luke Jones
2020-09-26 08:50:03 +00:00

View File

@@ -45,6 +45,16 @@ impl DbusFanAndCpu {
}
}
fn active_profile_name(&mut self) -> String {
if let Ok(ctrl) = self.inner.try_lock() {
if let Ok(mut cfg) = ctrl.config.try_lock() {
cfg.read();
return cfg.active_profile.clone();
}
}
"Failed".to_string()
}
fn profile(&mut self) -> String {
if let Ok(ctrl) = self.inner.try_lock() {
if let Ok(mut cfg) = ctrl.config.try_lock() {