mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Handle config errors better
This commit is contained in:
@@ -119,7 +119,7 @@ impl crate::Controller for CtrlKbdBacklight {
|
||||
}
|
||||
|
||||
// Reload brightness
|
||||
let bright = config.kbd_boot_brightness;
|
||||
let bright = config.kbd_led_brightness;
|
||||
let bytes = aura_brightness_bytes(bright);
|
||||
self.write_bytes(&bytes).await?;
|
||||
info!("Reloaded last used brightness");
|
||||
@@ -165,7 +165,7 @@ impl CtrlKbdBacklight {
|
||||
if let Some(num) = char::from(buf[0]).to_digit(10) {
|
||||
if config.power_profile != num as u8 {
|
||||
config.read();
|
||||
config.kbd_boot_brightness = num as u8;
|
||||
config.kbd_led_brightness = num as u8;
|
||||
config.write();
|
||||
}
|
||||
return Ok(());
|
||||
@@ -225,7 +225,7 @@ impl CtrlKbdBacklight {
|
||||
let bytes: [u8; LED_MSG_LEN] = (&mode).into();
|
||||
self.write_bytes(&bytes).await?;
|
||||
config.read();
|
||||
config.kbd_boot_brightness = n;
|
||||
config.kbd_led_brightness = n;
|
||||
config.write();
|
||||
info!("LED brightness set to {:#?}", n);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user