AprilNEA/OpenLogi · error · anyhow::Error

backlight write not applied: requested enabled=

Error message

backlight write not applied: requested enabled={enable}, device reports enabled={}

What it means

Diagnostic failure in `openlogi` backlight set: the HID++ SetBacklightEnabled write succeeded at the transport level (no error was raised), but the read-back state shows the device's enabled flag does not match what was requested. This is a device-side fault — the firmware accepted (or silently dropped) the write without applying it — so the round-trip verification fails and the CLI bails instead of reporting success.

Solutions

  1. Re-run the command; some firmware applies the enable bit lazily or needs a moment before read-back reflects it
  2. Power-cycle or re-pair the device and retry the write
  3. Check whether the device is in a mode that overrides software writes (e.g. TemporaryManual mode set via the keyboard's backlight keys, as noted earlier in the command output)
  4. Try `openlogi diag` round-trips on other writable features to determine whether the whole write path or only the backlight feature is affected
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/openlogi-cli/src/cmd/backlight.rs:79 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of AprilNEA/OpenLogi@e846e6f4b4 (2026-09-13). Data as JSON: /api/errors/5163ee311a911bc8. Report an issue: GitHub.

Appendix: source

Thrown at crates/openlogi-cli/src/cmd/backlight.rs:79

    // mode change look like a side effect of the enable bit.
    if before.mode == BacklightMode::TemporaryManual {
        println!(
            "  note: the level came from the keyboard's backlight keys, a mode software cannot write back — it returns to automatic (ambient-light sensor)"
        );
    }

    let after = openlogi_hid::set_backlight_enabled(&route, enable)
        .await
        .with_context(|| {
            format!(
                "set backlight {}",
                if enable { "enabled" } else { "disabled" }
            )
        })?;
    print_state("read-back", after);

    if after.enabled != enable {
        anyhow::bail!(
            "backlight write not applied: requested enabled={enable}, device reports enabled={}",
            after.enabled
        );
    }

    if enable {
        println!(
            "✓ backlight enabled (level {}/{})",
            after.current_level, after.nb_levels
        );
    } else {
        println!("✓ backlight off — persisted to the keyboard, survives reconnect and power cycle");
    }
    Ok(())
}

async fn read_state(route: &DeviceRoute) -> Result<BacklightState> {
    openlogi_hid::get_backlight(route)

View on GitHub (pinned to e846e6f4b4)