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

Add basic support for ayaneo slide. #998

Merged
merged 1 commit into from
Feb 18, 2024
Merged

Conversation

DevL0rd
Copy link
Contributor

@DevL0rd DevL0rd commented Feb 16, 2024

Resolves issues #997, and seemingly #976

All buttons working, glyphs are correct, gyro is corrected.

Issues:

I'm not sure how to get the correct ECDetails, as such I have disabled fan control.

However I am interested in learning what I can do to get these functions working :)

Summary by CodeRabbit

  • New Features
    • Introduced support for the AYANEO SLIDE device, including device-specific settings, capabilities, and custom key mappings.
    • Added support for a new device "AS01" by introducing a corresponding class.
    • Added a new image resource file named device_aya_slide.png to the project.

Copy link
Contributor

coderabbitai bot commented Feb 16, 2024

Walkthrough

This update introduces support for the new AYANEOSLIDE device in the HandheldCompanion project. It includes a specialized class for managing device-specific settings, capabilities, and custom key mappings. Additionally, a new image resource has been added to enhance the project's visuals.

Changes

File Path Change Summary
.../Devices/AYANEO/AYANEOSLIDE.cs Introduces AYANEOSlide class extending AYANEODevice with device-specific settings and capabilities. Added support for "AS01" with a corresponding class.
HandheldCompanion/.../HandheldCompanion.csproj Added device_aya_slide.png image resource.
.../Views/Pages/AboutPage.xaml Added "DevL0rd" to a list of names in the AboutPage.xaml file.

🐰✨
In the realm of code, where the bits align,
Comes a new device, the AYANEOSLIDE, so fine.
With LEDs bright and colors so bold,
A rabbit hops in, its story to be told.
Through lines of code, a new journey begins,
For every gamer, a win that grins.
🎮🌟

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

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: 3

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between b85593a and 5d7168e.
Files ignored due to path filters (1)
  • HandheldCompanion/Resources/device_aya_slide.png is excluded by: !**/*.png
Files selected for processing (3)
  • HandheldCompanion/Devices/AYANEO/AYANEOSLIDE.cs (1 hunks)
  • HandheldCompanion/Devices/IDevice.cs (1 hunks)
  • HandheldCompanion/HandheldCompanion.csproj (2 hunks)
Additional comments: 5
HandheldCompanion/Devices/AYANEO/AYANEOSLIDE.cs (3)
  • 11-11: The class AYANEOSLIDE is correctly defined and extends AYANEODevice, ensuring it fits into the existing device hierarchy.
  • 13-19: The LEDGroup enum is well-defined, providing clear identifiers for different LED groups within the device. This will facilitate easier manipulation of LED settings.
  • 98-113: The overridden method GetGlyph(ButtonFlags button) correctly implements custom glyphs for the device's OEM buttons. This ensures that the correct symbols are displayed for the device's custom keys, enhancing the user experience.
HandheldCompanion/Devices/IDevice.cs (1)
  • 268-270: The addition of the case "AS01" with the instantiation of AYANEOSLIDE in the GetDefault method correctly integrates the new device into the system. This ensures that the AYANEOSLIDE device will be recognized and properly initialized when detected.
HandheldCompanion/HandheldCompanion.csproj (1)
  • 112-112: The addition of device_aya_slide.png as a resource is correctly implemented and follows the project's conventions for including image resources. This change supports the PR's objective to introduce support for the AYANEO SLIDE device by ensuring the necessary graphical assets are available within the application.

HandheldCompanion/Devices/AYANEO/AYANEOSLIDE.cs Outdated Show resolved Hide resolved
HandheldCompanion/Devices/AYANEO/AYANEOSLIDE.cs Outdated Show resolved Hide resolved
HandheldCompanion/Devices/AYANEO/AYANEOSLIDE.cs Outdated Show resolved Hide resolved
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 5d7168e and d652845.
Files selected for processing (1)
  • HandheldCompanion/Devices/AYANEO/AYANEOSLIDE.cs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • HandheldCompanion/Devices/AYANEO/AYANEOSLIDE.cs

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 d652845 and 715b943.
Files selected for processing (2)
  • HandheldCompanion/Devices/AYANEO/AYANEOSLIDE.cs (1 hunks)
  • HandheldCompanion/Devices/IDevice.cs (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • HandheldCompanion/Devices/AYANEO/AYANEOSLIDE.cs
  • HandheldCompanion/Devices/IDevice.cs

@DevL0rd
Copy link
Contributor Author

DevL0rd commented Feb 16, 2024

Ok It's ready :D Thanks for showing me around the repo guys <3

@CasperH2O
Copy link
Collaborator

For an image, what I do is get a nice product image online, then in Paint.net, make the area around it transparant. Then realize that the width is the same as the generic device picture and save as png.

For the fan, we use RW everything and check which adresses Ayaspace adjusts and which change based on fan speed.

https://github.com/Valkirie/HandheldCompanion/wiki/Tools#rweverything

Did you get the LEDs working?

@DevL0rd
Copy link
Contributor Author

DevL0rd commented Feb 16, 2024

@CasperH2O using HW everything may be a bit outta my league hahaha

could you give a brief breakdown of some steps to follow to get the addresses?

I'll try the same in the end with the lighting controls. maybe in a different PR

@DevL0rd
Copy link
Contributor Author

DevL0rd commented Feb 16, 2024

ah I get it now. @CasperH2O

I see the button presses from me hitting the extra buttons. but I really can't find a correlation between me settings fans to 100 and to auto.

None for RGB too, but idk really if that would show up here.

any suggestions?

@Valkirie
Copy link
Owner

@DevL0rd may I ask you to share some photos of HC running on AYANEO Slide. I'd like to use them to advertise forthcoming compatibility :)

@DevL0rd
Copy link
Contributor Author

DevL0rd commented Feb 17, 2024

yes sir @Valkirie , I can do so when I am home, right after I make a nice transparent image for the device preview in the about menu. 🙂👍

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 715b943 and 1acc615.
Files ignored due to path filters (1)
  • HandheldCompanion/Resources/device_aya_slide.png is excluded by: !**/*.png
Files selected for processing (1)
  • HandheldCompanion/Views/Pages/AboutPage.xaml (1 hunks)
Additional comments: 1
HandheldCompanion/Views/Pages/AboutPage.xaml (1)
  • 214-214: The addition of "DevL0rd" to the contributors list is correctly implemented and follows the existing convention for listing names. This change effectively acknowledges the contributions made towards supporting the AYANEO SLIDE device. It's important to ensure that all contributors are credited appropriately, and this update seems to align with that goal.

@DevL0rd
Copy link
Contributor Author

DevL0rd commented Feb 17, 2024

20240217_191044
Screenshot_2024-02-17_191155
Screenshot_2024-02-17_191226
@Valkirie Ready!

@Valkirie
Copy link
Owner

Thanks! @CasperH2O shall we merge as-is or do you want to wait until you get yours ?

@CasperH2O
Copy link
Collaborator

Nice pictures!

Im good with doing this set now and the fan and LED later when I have a device.

Can we squash this PR in one commit though, seems cleaner?

@DevL0rd
Copy link
Contributor Author

DevL0rd commented Feb 18, 2024

idk how to squash haha.

but yeah I figure do fan and led after I'm going to play with it myself and see if I learn something meanwhile.

at least for now everything else works.

Just a note from that issue, ayaneo ships with a broken driver for the gyro and accelerometer. have to install the latest driver or gyro just doesn't function at all.

@CasperH2O
Copy link
Collaborator

CasperH2O commented Feb 18, 2024

Depending on your Git client, squash and merge commit instructions for GitHub Desktop Client: https://docs.github.com/en/desktop/managing-commits/squashing-commits-in-github-desktop

An alternative quick and easy way is to copy the changed files from your repo, make a new branch from main, paste the files, test they work, commit and PR.

Or...

@Valkirie or me hits the squash and merge button on this PR. 😅

@CasperH2O
Copy link
Collaborator

Correction, using GitHubs squash and merge still creates a merge commit, which we dont want.

Support for Ayaneo Slide
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 b85593a and ec711c6.
Files ignored due to path filters (1)
  • HandheldCompanion/Resources/device_aya_slide.png is excluded by: !**/*.png
Files selected for processing (4)
  • HandheldCompanion/Devices/AYANEO/AYANEOSLIDE.cs (1 hunks)
  • HandheldCompanion/Devices/IDevice.cs (1 hunks)
  • HandheldCompanion/HandheldCompanion.csproj (2 hunks)
  • HandheldCompanion/Views/Pages/AboutPage.xaml (1 hunks)
Files skipped from review as they are similar to previous changes (4)
  • HandheldCompanion/Devices/AYANEO/AYANEOSLIDE.cs
  • HandheldCompanion/Devices/IDevice.cs
  • HandheldCompanion/HandheldCompanion.csproj
  • HandheldCompanion/Views/Pages/AboutPage.xaml

@DevL0rd
Copy link
Contributor Author

DevL0rd commented Feb 18, 2024

alright guess I'm using GitHub desktop now haha.

all done!

@CasperH2O CasperH2O merged commit 185a730 into Valkirie:main Feb 18, 2024
1 check passed
@CasperH2O
Copy link
Collaborator

Excellent!

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.

3 participants