Skip to content

fix: handle missing parentheses in capabilities strings - #427

Open
Guitou51 wants to merge 1 commit into
newAM:mainfrom
Guitou51:fix/capabilities-missing-parenthesis
Open

Guitou51 wants to merge 1 commit into
newAM:mainfrom
Guitou51:fix/capabilities-missing-parenthesis

Conversation

@Guitou51

@Guitou51 Guitou51 commented Oct 9, 2026

Copy link
Copy Markdown

Some monitors return a capabilities string with a missing closing parenthesis in vcp(...) or cmds(...). For example, the LEMON25 reports ... 62 87 8D CC mccs_ver(2.2)mswhql(1)), causing the parser to interpret mccs_ver as a hexadecimal VCP code and raise ValueError.

Stop numeric capability extraction at the next named field at the list's outer level. This preserves the supported codes, input sources, color presets, and metadata while keeping nested hexadecimal value lists intact.

Regression tests cover the exact LEMON25 response, its correctly closed equivalent, missing closures in both numeric lists, and nested values. Invalid numeric tokens still raise an error.

Validation: 136 tests passed; Ruff lint, formatting, and git diff --check passed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant