{"record":{"id":"4e2f3bef649a6bcf","repo":"AprilNEA/OpenLogi","slug":"no-standalone-light-matches-device-query","errorCode":null,"errorMessage":"no standalone light matches --device {query}","messagePattern":"no standalone light matches --device (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/light.rs","lineNumber":201,"sourceCode":"        return match devices {\n            [] => Err(anyhow!(\"no supported standalone light found\")),\n            [device] => Ok(device),\n            _ => Err(anyhow!(\n                \"multiple standalone lights found; select one with --device\"\n            )),\n        };\n    };\n    let query = query.to_ascii_lowercase();\n    let mut matches = devices.iter().filter(|device| {\n        device.display_name.to_ascii_lowercase().contains(&query)\n            || device\n                .address\n                .identity\n                .to_ascii_lowercase()\n                .contains(&query)\n    });\n    let Some(device) = matches.next() else {\n        return Err(anyhow!(\"no standalone light matches --device {query}\"));\n    };\n    if matches.next().is_some() {\n        return Err(anyhow!(\n            \"multiple standalone lights match --device {query}; use a more specific value\"\n        ));\n    }\n    Ok(device)\n}\n\n#[cfg(test)]\nmod tests {\n    use super::select;\n    use openlogi_core::device::{DeviceKind, RawDeviceAddress, StandaloneDevice};\n\n    fn device(name: &str) -> StandaloneDevice {\n        StandaloneDevice {\n            address: RawDeviceAddress {\n                vendor_id: 0x046d,","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/light.rs#L183-L219","documentation":"When a `--device` query IS supplied, `select` case-insensitively filters standalone lights by display-name or identity substring. If the iterator yields nothing, no enumerated light matched the query, and this error is thrown. It is a user-input targeting failure, distinct from the no-device case (100).","triggerScenarios":"Passing `--device <query>` to `set_power`, `set_brightness`, `set_temperature`, etc., where no standalone light's `display_name` or `address.identity` contains the query as a case-insensitive substring.","commonSituations":"Typo in the device name; using the full serial when only part of the identity is enumerated; the light is not attached or not visible to the backend; the query targets a device connected through a receiver and thus absent from the standalone list.","solutions":["List the standalone lights and copy the exact display name or identity substring.","Shorten the query to a distinctive substring (e.g. `--device Glow`).","Verify the light is attached and enumerated (`openlogi list`).","If it is a receiver-connected device, note that only standalone lights are selectable here."],"exampleFix":"// before\n$ openlogi light set-power on --device \"litra glowe\"\nerror: no standalone light matches --device litra glowe\n\n// after\n$ openlogi light set-power on --device \"glow\"","handlingStrategy":"validation","validationCode":"let q = device_query.to_ascii_lowercase();\nlet matches: Vec<_> = devices.iter().filter(|d| {\n    d.display_name.to_ascii_lowercase().contains(&q)\n        || d.address.identity.to_ascii_lowercase().contains(&q)\n}).collect();\nif matches.is_empty() {\n    eprintln!(\"'{device_query}' matches no light; run the list command first\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy --device values from the list command output instead of typing from memory.","Prefer serial/identity substrings over display names for scripts.","Match case-insensitively and keep queries short but unique."],"tags":["cli","device-selection","invalid-identifier","user-input"],"backgroundTag":"record-not-found","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"}