{"record":{"id":"5163ee311a911bc8","repo":"AprilNEA/OpenLogi","slug":"backlight-write-not-applied-requested-enabled-enable-device","errorCode":null,"errorMessage":"backlight write not applied: requested enabled={enable}, device reports enabled={}","messagePattern":"backlight write not applied: requested enabled=(.+?), device reports enabled=(.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/backlight.rs","lineNumber":79,"sourceCode":"    // mode change look like a side effect of the enable bit.\n    if before.mode == BacklightMode::TemporaryManual {\n        println!(\n            \"  note: the level came from the keyboard's backlight keys, a mode software cannot write back — it returns to automatic (ambient-light sensor)\"\n        );\n    }\n\n    let after = openlogi_hid::set_backlight_enabled(&route, enable)\n        .await\n        .with_context(|| {\n            format!(\n                \"set backlight {}\",\n                if enable { \"enabled\" } else { \"disabled\" }\n            )\n        })?;\n    print_state(\"read-back\", after);\n\n    if after.enabled != enable {\n        anyhow::bail!(\n            \"backlight write not applied: requested enabled={enable}, device reports enabled={}\",\n            after.enabled\n        );\n    }\n\n    if enable {\n        println!(\n            \"✓ backlight enabled (level {}/{})\",\n            after.current_level, after.nb_levels\n        );\n    } else {\n        println!(\"✓ backlight off — persisted to the keyboard, survives reconnect and power cycle\");\n    }\n    Ok(())\n}\n\nasync fn read_state(route: &DeviceRoute) -> Result<BacklightState> {\n    openlogi_hid::get_backlight(route)","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/backlight.rs#L61-L97","documentation":"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.","triggerScenarios":"Thrown at crates/openlogi-cli/src/cmd/backlight.rs:79 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the command; some firmware applies the enable bit lazily or needs a moment before read-back reflects it","Power-cycle or re-pair the device and retry the write","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)","Try `openlogi diag` round-trips on other writable features to determine whether the whole write path or only the backlight feature is affected"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8","analyzedAt":"2026-09-13T03:07:16.451Z","contentChangedAt":"2026-09-13T03:07:16.451Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}