Repository navigation
Razer: DeathStalker V2 Pro / TKL and BlackWidow HyperSpeed keyboards from OpenRazer (#106), unit tests - #122
Conversation
…eyOkay#106) Ten ids from OpenRazer's keyboard driver (razerkbd_driver.c @6820f9d): transaction id 0x9F on the receiver and 0x1F on the cable (razer_attr_read_charge_level), and the USB interface that takes the commands, 2 or 3 (report_index in razer_get_report_params), asked first. The icon shows the keyboard pictogram. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QmGsnjgXs8VbKmmxLkPsf6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QmGsnjgXs8VbKmmxLkPsf6
HeyOkay#120 HeyOkay#122 HeyOkay#123 HeyOkay#124 HeyOkay#125 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QmGsnjgXs8VbKmmxLkPsf6
|
Heads-up from a fellow PR author: I've opened #126, which shortens the README's support table to Our trial merge shows #126 conflicts with this PR in |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QmGsnjgXs8VbKmmxLkPsf6
|
Thanks for this! PR #107 and a batch of other PRs were just merged into main (the listen-only PlayStation handling from e80dfd1 is kept, and |
|
I trial-merged this against today's
After that the full suite passes against current |
Resolved CHANGELOG.md (bullet under Unreleased), README.md (short rows for the new table, detail moved to docs/protocols.md; TKL verified, others not); providers/razer.py merged cleanly with main's BlackWidow V3 Pro rows, which now also get the keyboard icon and interface 2 first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QmGsnjgXs8VbKmmxLkPsf6
…as it is The merge had added 0x025A / 0x025C to KEYBOARD_INTERFACE, which changes the interface order and pictogram of a device this PR does not cover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QmGsnjgXs8VbKmmxLkPsf6
|
Merged |
…S 06BE - The six new device rows from HeyOkay#122, HeyOkay#123, HeyOkay#124, HeyOkay#125 and HeyOkay#141 go to docs/devices.md, where HeyOkay#128 moved the table. - tests/test_steelseries_elite.py: find make_providers( with its new parameter from HeyOkay#134. - Cloud III S: the 06BE revision and the charging state are confirmed in HeyOkay#156 (docs/protocols.md, CHANGELOG). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011GfhP6tYaD8Rt4qP2YtmJ4
This PR adds the Razer keyboards with a battery that OpenRazer's keyboard driver reads. The main one is the DeathStalker V2 Pro TKL on its HyperSpeed receiver from #106. The app skipped it:
skipped: not a known wireless device, because the product stringDSV2Pro TKLhas no "wireless" word and0296was not inKNOWN.Base and other PRs
mainate80dfd1.providers/razer.py,tests/test_razer_keyboards.py(new),README.md(one sentence),CHANGELOG.md.025C): this PR does not add025Cor025A, so the two PRs do not add the same ids. The new table block is above the mice, not at the end ofKNOWN, where Razer BlackWidow V3 Pro: the battery over its 2.4 GHz receiver (#56), unit tests #112 adds its line. Trial merge:CHANGELOG.mdonly.CHANGELOG.mdonly. XInput: an Xbox Bluetooth product id means Bluetooth (no wrong 10%, #108, #97) #118, Razer: another app's replies are not a reading ("no link" while in use, #108), unit tests #119, Menu: keep the menu and its submenus off the taskbar (auto-hide, full screen games), unit tests #120: clean. Tray: device type switches (#96), per-device alert level, time left, percentage icon, quiet while gaming (#76), status file; Audeze stuck dongle and 0% at power-on, unit tests #107 already conflicts withmain; this PR adds none.Source
OpenRazer,
driver/razerkbd_driver.candrazerkbd_driver.hat 6820f9d:razer_attr_read_charge_level()andrazer_attr_read_charge_status()give the transaction id.razer_get_report_params()givesreport_index. OpenRazer sends the request withUSB_RECIP_INTERFACEandwIndex = report_index(razercommon.c), soreport_indexis the USB interface that takes the commands.openrazer_daemon/hardware/keyboards.py) listsget_batteryfor all ten. The wireless classes inherit it from the wired classes.02900x9F02920x1F02960x9F02980x1F02710x9F02580x1F02BA0x9F02B90x1F02D50x9F02D70x1FThe command is the one that the provider already sends to the mice: class
0x07, id0x80(level, 0-255) and0x84(charging). The wired ids are included for the same reason as for the mice (the table follows OpenRazer'scharge_levellist): on the cable the keyboard charges and still reports its level.The change
KNOWN: the ten ids, with the names above and the transaction ids from OpenRazer. The wireless and wired ids of one keyboard have the same name.KEYBOARD_INTERFACE: the interface fromreport_index._poll_group()asks that interface first. The other interfaces stay a fallback, in the same order as before.kind="keyboard", so the tray shows the keyboard pictogram and not the mouse. Mice do not change (kind="", automatic).What this PR does not do
In #106 a Basilisk V3 Pro mouse is paired to the same multi-device receiver. No public source says how to address a second device through the keyboard's receiver (openrazer#1892 is open). This PR does not guess.
Tests
tests/test_razer_keyboards.py(new, 8 tests). It usesFakeMouseandFakeBusfromtests/test_razer.pyand the 12 collections of the #106 receiver.kind="keyboard", two requests with tid0x9F(level, charging).04) keeps the keyboard pictogram (greyed icon).00B9) keepskind="".maybe_wireless(0x0296, " DSV2Pro TKL")is true.Mutation checks: I changed the interface ranking, the kind, the greyed-icon kind, one transaction id and one interface, and each time at least one test failed. All 249 tests pass.
Part of #106 (the keyboard).