Skip to content

Commit 35e788f

Browse files
committed
log warn if controller couldn't change affect current brightness
1 parent 5271f69 commit 35e788f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/brightness/controller.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,12 @@ impl Controller {
113113
} else {
114114
let new_value = current.saturating_add_signed(target.step);
115115
match self.brightness.set(new_value).await {
116-
Ok(new_value) => self.current = Some(new_value),
116+
Ok(set_value) => {
117+
if set_value == current {
118+
log::warn!("Unable to change brightness from {current} to {new_value}, please report if you know how to reproduce this");
119+
}
120+
self.current = Some(set_value);
121+
}
117122
Err(err) => log::error!(
118123
"Unable to set brightness to value '{}': {:?}",
119124
new_value,

0 commit comments

Comments
 (0)