Add LED brightness pre/next cycle

Closes #129
This commit is contained in:
Luke D. Jones
2021-08-27 20:14:19 +12:00
parent 2431dd9e93
commit e89e7ca10f
5 changed files with 68 additions and 2 deletions

View File

@@ -105,6 +105,20 @@ impl CtrlKbdLedZbus {
}
}
fn next_led_brightness(&self) {
if let Ok(mut ctrl) = self.0.try_lock() {
ctrl.next_brightness()
.unwrap_or_else(|err| warn!("{}", err));
}
}
fn prev_led_brightness(&self) {
if let Ok(mut ctrl) = self.0.try_lock() {
ctrl.prev_brightness()
.unwrap_or_else(|err| warn!("{}", err));
}
}
#[dbus_interface(property)]
fn awake_enabled(&self) -> bool {
if let Ok(ctrl) = self.0.try_lock() {