wip: reload current settings in rogcc for LEDs

This commit is contained in:
Denis Benato
2026-01-24 17:26:42 +01:00
parent 5d4b164b3b
commit 9cd14d108c
4 changed files with 21 additions and 26 deletions

View File

@@ -33,7 +33,6 @@ pub struct AuraConfig {
}
impl StdConfig for AuraConfig {
/// Detect the keyboard type and load from default DB if data available
fn new() -> Self {
panic!("This should not be used");
}

View File

@@ -182,7 +182,6 @@ impl AuraZbus {
self.0.set_brightness(config.brightness.into()).await?;
config.set_builtin(effect);
config.write();
Ok(())
}
@@ -208,9 +207,10 @@ impl AuraZbus {
let mut config = self.0.config.lock().await;
for opt in options.states {
let zone = opt.zone;
for config in config.enabled.states.iter_mut() {
if config.zone == zone {
*config = opt;
for state in config.enabled.states.iter_mut() {
if state.zone == zone {
*state = opt;
break;
}
}
}

View File

@@ -196,6 +196,7 @@ impl DeviceHandle {
Some(Arc::new(Mutex::new(k)))
});
// Load saved mode, colours, brightness, power from disk; apply on reload
let mut config = AuraConfig::load_and_update_config(prod_id);
config.led_type = aura_type;
let aura = Aura {