Repository navigation
Razer BlackWidow V3 Pro: the battery over its 2.4 GHz receiver (#56), unit tests - #112
Conversation
The wireless id (1532:025C) answers the same 0x07:0x80 battery and 0x07:0x84 charging commands this provider already sends, so it is one row in the table plus tests: OpenRazer's RazerBlackWidowV3ProWireless class lists get_battery/is_charging, and its driver reads them with razer_chroma_misc_get_battery_level() (class 0x07, id 0x80). The wired twin (0x025A) is deliberately left out: its OpenRazer class has no get_battery, and a wired keyboard's answer to the battery command is a meaningless value (the Huntsman V2 note above WIRELESS_WORDS). OpenRazer's keyboard driver does not pin a transaction id for this model, so 0x3f is tried first - the one its wireless devices of this generation use - and the provider's fallback list covers the rest. The keyboard's control collection is 0059:0001 rather than a vendor page; the probe order already reaches it, and a test polls exactly that shape. Reported in HeyOkay#56 by @KKiruano, whose diagnostics pinned both pids. Unverified on hardware: no Razer keyboard here, so the reporter can confirm the level, the charging flag and the transaction id in one Diagnostics report.
|
Thanks @casparas123. I checked this against OpenRazer's keyboard driver while I worked on the DeathStalker V2 Pro for #106 (#122). There are three points. Links are to OpenRazer 6820f9d. 1. Transaction id for case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_PRO_WIRELESS:
...
case USB_DEVICE_ID_RAZER_DEATHSTALKER_V2_PRO_TKL_WIRELESS:
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V4_TENKEYLESS_HYPERSPEED_WIRELESS:
request.transaction_id.id = 0x9f;
break;
case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_PRO_WIRED:
request.transaction_id.id = 0x3f;
break;So 2. The wired 3. Interface. #122 does not add |
… twin razer_attr_read_charge_level() reads the wireless keyboards of this generation with transaction id 0x9f and their wired twins with 0x3f, and OpenRazer lists get_battery/is_charging on the wired class (0x025A) as well - the wireless model inherits it. So 0x025C moves from 0x3f to 0x9f and 0x025A joins the table.
The 0059:0001 line could not be re-derived from any source - it is not in the HeyOkay#56 dump, libratbag has no BlackWidow V3 Pro file and OpenRazer records no such usage. The README now states what is verified: commands, transaction ids 0x9F/0x3F and USB interface 2 from OpenRazer's keyboard driver, with the probe order as a preference, not a filter. Thanks @ahmedkhursheed23 for the review.
|
Thanks - and you're right on all three. Points 1 and 2 landed here just after you wrote this, as the second commit ( Point 3 is the valuable one: re-deriving the And on |
…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
This PR adds the Razer BlackWidow V3 Pro - the last Razer device of #56 - over its 2.4 GHz receiver. It is one row in
razer.py's table plus tests: the keyboard answers the commands this provider already sends.Base and other PRs
mainat e80dfd1.git merge-tree:CHANGELOG.mdonly (both add an### Addedsection under[Unreleased]). The README row andproviders/razer.pymerge cleanly. Keep both sides.mainand already conflicts with plainmaininCHANGELOG.md,README.md,halo_battery.pyw,providers/playstation.pyandtests/test_hide_rename.py. Trial-merging it with this branch gives that same set, so this PR adds no conflicts of its own. Keep both sides.CHANGELOG.mdonly, again keep both sides.providers/razer.py(one table row)tests/test_razer.py(three cases)README.md(a row next to the other Razer rows),CHANGELOG.md1. Why
#56's diagnostics dump shows the keyboard twice:
025ais not in the table and never gets a request, so nothing is read;025cis not there either, and the name alone does not pass the wireless filter.2. Source
OpenRazer, which the maintainer's comment on #56 names:
RazerBlackWidowV3ProWirelesslistsget_batteryandis_charging, and the Wired class (USB_PID 0x025A) lists them too - the wireless model inherits that class. (The first draft claimed the Wired class lists neither; thanks @ahmedkhursheed23 for catching it.)0x07, id0x80for the level and id0x84for charging, with the level scaled/255*100, exactly as OpenRazer's driver/daemon pair does it for the mice.The transaction ids come from
razer_attr_read_charge_level():0x9Ffor the wireless id,0x3Ffor the wired one, which a second commit adds to the table.3. Which collection gets the request
The keyboard answers on a control collection, not a
ff00vendor page. OpenRazer sends its commands withwIndex = report_index = 0x02(razer_get_report_params()), i.e. USB interface 2, for both ids; the probe order's ranking is a preference, not a filter, so it reaches whichever collection answers - a test polls a non-vendor collection and reads 71% from0xB5. An earlier draft of this section named a specific0059:0001collection; that could not be re-derived from any source and is dropped.4. Verification
Unverified on hardware: there is no Razer keyboard here. The level, the charging flag and the transaction id come from the reference; the reporter of #56 offered to test, and the diagnostics the provider prints carry every request and its reply, which settles the transaction id and the answering collection if the table is off.
Tests:
python -m unittest discover -s tests- 245 pass; the three new ones fail if the table row is removed (checked by mutation).