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
+4
View File
@@ -365,6 +365,7 @@ fn handle_profile(
) -> Result<(), Box<dyn std::error::Error>> {
if !cmd.next
&& !cmd.create
&& !cmd.list
&& cmd.curve.is_none()
&& cmd.max_percentage.is_none()
&& cmd.min_percentage.is_none()
@@ -393,6 +394,9 @@ fn handle_profile(
}
if cmd.next {
dbus.proxies().profile().next_fan()?;
} else if cmd.list {
let profile_names = dbus.proxies().profile().profile_names()?;
println!("Available profiles are {}", profile_names);
} else {
dbus.proxies()
.profile()