Repository navigation
feat(attackshark): enable live battery percent readout for X11 SE - #223
Merged
Merged
Conversation
|
🎉 This PR is included in version 0.42.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enables live battery percentage reporting for the Attack Shark X11 SE (receiver model ID
0x07).The model was already tracked in
X11_RECEIVER_MODELS, but lacked thebattery: "percent"scale property (which was kept unassigned until verified on hardware).Verified on real hardware against the official Attack Shark software and community reference implementations (
HarukaYamamoto0/attack-shark-x11-driver): the X11 SE streams standard 0–100% battery values via the 5th byte of the receiver's telemetry packet (03 07 40 01 <percent>).Changes
src/drivers/attackshark/hid.ts: Flagged model ID0x07with"percent"inX11_RECEIVER_MODELS.src/drivers/attackshark/hid.test.ts: Added unit test asserting that report[0x03, 0x07, 0x40, 0x01, 85]parses as 85%.Testing
npx tsx --test src/drivers/attackshark/hid.test.ts(29 passed, 0 failed).npm run buildsucceeds without diagnostics.Summary by CodeRabbit