Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RogAlly button support #810

Merged
merged 1 commit into from
Nov 3, 2023
Merged

Fix RogAlly button support #810

merged 1 commit into from
Nov 3, 2023

Conversation

Valkirie
Copy link
Owner

@Valkirie Valkirie commented Nov 3, 2023

Summary by CodeRabbit

  • Refactor
    • Improved the ROGAlly class for better device handling and event management.
  • Bug Fixes
    • Ensured device openness before performing actions in SetFanControl, SetFanDuty, and ReadFanDuty methods.
  • Chores
    • Updated the "HidLibrary" package reference in the project file.

Copy link
Contributor

coderabbitai bot commented Nov 3, 2023

Walkthrough

The codebase for the Handheld Companion application has been updated, focusing on the ROGAlly class. The changes include refactoring of the HID device handling, addition of new methods, and modification of existing ones to improve functionality. The project's dependencies have also been updated, with a change in the HidLibrary package reference.

Changes

File Summary
.../Devices/ASUS/ROGAlly.cs Refactored HID device handling, added new methods and modified existing ones for improved functionality.
HandheldCompanion.csproj Removed specific version of "hidlibrary" package and added a new reference to "HidLibrary" with no specified version. Also added a reference to "HidLibrary.dll".

Poem

🍂 As the leaves of November fall,
Code changes we do install.
With every key and byte we tweak,
A stronger app we do seek.

🐇 Hopping through the code with glee,
Making changes for all to see.
In the spirit of the season's cheer,
We celebrate the progress here.

🎉 So here's to the devs, working away,
Making the app better every day.
With each update, we take a leap,
Into the future, the rewards we'll reap. 🥕


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai help to get help.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.json

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between bfbb07b and 2128515.
Files ignored due to filter (1)
  • Resources/HidLibrary.dll
Files selected for processing (2)
  • HandheldCompanion/Devices/ASUS/ROGAlly.cs (9 hunks)
  • HandheldCompanion/HandheldCompanion.csproj (2 hunks)
Additional comments: 12
HandheldCompanion/HandheldCompanion.csproj (2)
  • 139-144: No changes have been made in this hunk.

  • 2270-2272: The reference to "HidLibrary.dll" has been added. Ensure that the DLL is present at the specified path and is compatible with the project's target framework.

<Reference Include="HidLibrary">
  <HintPath>..\Resources\HidLibrary.dll</HintPath>
</Reference>
HandheldCompanion/Devices/ASUS/ROGAlly.cs (10)
  • 1-14: Removed unused namespaces and using statements. This is a good practice as it helps to keep the code clean and reduces the potential for namespace conflicts.

  • 17-25: The keyMapping dictionary has been initialized with some key-value pairs. Ensure that these keys and values are correct and meaningful in the context of your application.

  • 27-30: The hidDevice field has been replaced with a Dictionary<byte, HidDevice> named hidDevices, and a new constant INPUT_HID_ID has been introduced. This change seems to be in line with the new design of handling multiple HID devices.

  • 32-32: The IsOpen property has been updated to check if the HID device with the INPUT_HID_ID is open and if the asusACPI object is not null and open. This is a good practice as it ensures that the device is ready before any operations are performed on it.

  • 88-97: The Open method has been updated to initialize the asusACPI object and check if it is null. This is a good practice as it ensures that the asusACPI object is ready before any operations are performed on it.

  • 102-110: The Close method has been updated to close all HID devices in the hidDevices dictionary. This is a good practice as it ensures that all resources are properly released when the device is closed.

  • 112-144: The IsReady method has been updated to iterate over the HID devices and check if the device with the INPUT_HID_ID is connected and readable. This is a good practice as it ensures that the device is ready before any operations are performed on it.

  • 146-154: A new OnReport method has been added to handle HID report events. This is a good practice as it allows for more granular handling of HID events.

  • 178-185: The SetFanControl, SetFanDuty, and ReadFanDuty methods have been updated to check for device openness before performing actions. This is a good practice as it prevents operations from being performed on a device that is not open.

  • 224-232: > Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [224-237]

The HandleEvent method has been modified to handle specific key events. Ensure that these key events are correct and meaningful in the context of your application.

@Valkirie Valkirie merged commit bf12a03 into main Nov 3, 2023
1 check passed
@Valkirie Valkirie deleted the RogAllyFix branch November 3, 2023 07:37
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