Skip to content

Fix #1234#1333

Merged
Valkirie merged 2 commits intoValkirie:mainfrom
GopherTheCoder:main
Dec 8, 2025
Merged

Fix #1234#1333
Valkirie merged 2 commits intoValkirie:mainfrom
GopherTheCoder:main

Conversation

@GopherTheCoder
Copy link
Contributor

@GopherTheCoder GopherTheCoder commented Nov 29, 2025

Should be a common issue for CEii devices (AIR Plus/Slide). Tested on my AIR Plus AMD.

I'm also trying to fix other potential CEii bugs (charge bypass not working/TDP control not resetting), thus create a darft here.

I'm aiming to finalize this PR before Monday.

Summary by CodeRabbit

  • New Features

    • Enhanced LED control to support simultaneous updates for both stick groups on compatible devices.
  • Bug Fixes

    • Improved charging bypass behavior on select AYANEO models for more reliable operation.
  • Refactor

    • Simplified device initialization by removing legacy axis configuration assignments.
  • Chores

    • Updated installer tool version used in build/release workflow.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 29, 2025

Walkthrough

Removed device-axis initializations from AYANEOAIRPlus, switched two EC memory reads to a different read function in AYANEODeviceCEc, added rgbConfirmation initialization plus LED group and bypass-charge value/address adjustments in AYANEODeviceCEii, and bumped INNO_VERSION in the publish workflow.

Changes

Cohort / File(s) Summary
AYANEO Device Axis Configuration
HandheldCompanion/Devices/AYANEO/AYANEOAIRPlus.cs
Removed constructor initialization of GyrometerAxis, GyrometerAxisSwap, AccelerometerAxis, and AccelerometerAxisSwap (axis mapping no longer set during construction).
AYANEO EC memory and control logic
HandheldCompanion/Devices/AYANEO/AYANEODeviceCEc.cs, HandheldCompanion/Devices/AYANEO/AYANEODeviceCEii.cs
AYANEODeviceCEc.cs: replaced ECRamReadByte calls with EcReadByte for address 0x1e in two bypass-charge methods. AYANEODeviceCEii.cs: added this.rgbConfirmation = false in constructor; CEcControl_RgbI2cWrite now handles LEDGroup.StickBoth by writing StickLeft and StickRight then returning; CEcControl_BypassChargeOpen/Close now compare ECRamDirectRead(0xd1) against 0x01/0x65 and write those values when different.
CI / Release workflow
.github/workflows/publish-hc.yml
Updated environment variable INNO_VERSION from 6.2.2 to 6.6.1 in the Build and Release workflow.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–25 minutes

  • Areas to focus on:
    • Code paths that previously relied on AYANEOAIRPlus axis properties during initialization or later runtime.
    • Correctness of ECRamReadByteEcReadByte replacement semantics for the targeted EC address.
    • New ECRamDirectRead(0xd1) comparisons and write values (0x01 / 0x65) in bypass-charge methods.
    • LEDGroup.StickBoth handling to ensure simultaneous writes and early return do not skip needed logic.

Possibly related PRs

Poem

🐰 I hopped through code with nimble paws,
Removed some axes, tuned a few laws,
LEDs blinked as bytes rearranged,
Version bumped, the workflow changed,
A tiny hop — the drivers applause 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Fix #1234' is extremely vague and does not convey any meaningful information about the actual changes made to the codebase. Replace with a descriptive title that summarizes the main change, e.g., 'Fix CEii device axis configuration and charge bypass logic' or similar based on the primary bug being fixed.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

If "group" == Both, explicitly apply to two sticks. Since the implemention doesn't support set both at once.

Fix charge bypass for CEc & CEii. Thanks to @BenjaminLSR

Clean up redundant configs in AYANEOAIRPlus.cs
@GopherTheCoder GopherTheCoder marked this pull request as ready for review December 1, 2025 07:39
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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
HandheldCompanion/Devices/AYANEO/AYANEODeviceCEii.cs (1)

110-126: StickBoth handling in CEii RGB write correctly fans out to left/right without recursion issues.

The early group == LEDGroup.StickBoth branch that delegates to StickLeft and StickRight and then returns is a safe way to support the composite group on CEii while keeping the AYASpace-style address mapping for other groups. There are no recursion or correctness problems here. As a minor readability tweak, you could replace the ternaries for applyAddress/groupAddress with a small switch over the supported groups to make the mapping more self-documenting, but that’s optional.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 834a2bd and a2919ae.

📒 Files selected for processing (3)
  • HandheldCompanion/Devices/AYANEO/AYANEOAIRPlus.cs (0 hunks)
  • HandheldCompanion/Devices/AYANEO/AYANEODeviceCEc.cs (1 hunks)
  • HandheldCompanion/Devices/AYANEO/AYANEODeviceCEii.cs (3 hunks)
💤 Files with no reviewable changes (1)
  • HandheldCompanion/Devices/AYANEO/AYANEOAIRPlus.cs
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-07-27T07:08:12.731Z
Learnt from: romracer
Repo: Valkirie/HandheldCompanion PR: 1012
File: HandheldCompanion/Devices/MSI/ClawA1M.cs:0-0
Timestamp: 2024-07-27T07:08:12.731Z
Learning: The `ClawA1M` class in the `HandheldCompanion` project has been refactored to improve readability and maintainability. Changes include the removal of `scope` as a private field, simplification by removing thread logic, encapsulation of WMI event monitoring setup and teardown in separate methods with proper exception handling, and marking `specialKeyWatcher` as nullable.

Applied to files:

  • HandheldCompanion/Devices/AYANEO/AYANEODeviceCEii.cs
🧬 Code graph analysis (1)
HandheldCompanion/Devices/AYANEO/AYANEODeviceCEii.cs (1)
HandheldCompanion/Devices/AYANEO/AYANEODeviceCEc.cs (2)
  • CEcControl_RgbI2cWrite (305-313)
  • CEcControl_BypassChargeClose (331-335)
🔇 Additional comments (3)
HandheldCompanion/Devices/AYANEO/AYANEODeviceCEc.cs (1)

325-335: Bypass charge now uses EcReadByte on 0x1e; logic looks consistent but is shared across all CEc devices.

The read-before-write pattern against register 0x1e with values 0x55 (open) and 0xaa (close) is straightforward and matches the existing writes, so the change looks correct from a code perspective. Since this base implementation is used by all CEc-based AYANEO models, please confirm that 0x1e/0x55/0xaa are valid for every CEc device you intend to support and that moving from the previous EC RAM read to EcReadByte doesn’t change semantics on any of them.

HandheldCompanion/Devices/AYANEO/AYANEODeviceCEii.cs (2)

64-69: Disabling rgbConfirmation for CEii to avoid CEc-style confirmation writes makes sense.

Setting this.rgbConfirmation = false ensures the base CEcRgb_I2cWrite no longer issues the extra StickBoth confirmation command that the CEc path expects, which would otherwise go through your CEii-specific CEcControl_RgbI2cWrite override in a non‑AYASpace‑like way. This looks appropriate for the CEii protocol; just confirm that none of the CEii lighting behaviors rely on that extra confirmation pulse.


148-160: CEii bypass-charge overrides on 0xd1 (0x01 open / 0x65 close) match the intended pattern but rely on firmware-specific values.

The overrides keep the same “read EC, only write if different” pattern as the base implementation, now using ECRamDirectRead/Write(0xd1) with 0x01 for open and 0x65 for close, aligned with the AYASpace helper comments. From a code standpoint this is fine; please double-check these magic values and the 0xd1 address against AYASpace or vendor documentation for all CEii SKUs (AIR Plus variants and Slide) to ensure they behave identically across devices.

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.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a2919ae and b784f31.

📒 Files selected for processing (1)
  • .github/workflows/publish-hc.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build and Release

env:
SOLUTION_NAME: HandheldCompanion
INNO_VERSION: 6.2.2
INNO_VERSION: 6.6.1
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

Innosetup 6.6.1 release notes changelog breaking changes

💡 Result:

Short answer: There are no explicit "breaking changes" listed in the Inno Setup 6.6.1 release notes. The release contains a few behavioral/documentation/security changes you may need to check in your scripts:

Notable changes (may affect some setups)

  • RTF display with custom styles: default foreground colors are now replaced only when appropriate (previously all foreground colors were replaced by the style foreground). [1][2]
  • New [Setup] directive WizardImageOpacity (controls wizard image opacity). Compiler also now stores identical regular and DynamicDark wizard images only once. [1][2]
  • Pascal Script doc fix: CreateCustomForm prototype in docs corrected. [1]
  • New [Files] section flag notimestamp to avoid storing file timestamps (helps reproducible builds). [1][2]
  • Other minor improvements and security fixes. [1]

Sources: Inno Setup 6.6.1 changelog (summaries). [1] [2]


🌐 Web query:

Innosetup version 6.2.2 vs 6.6.1 differences compatibility

💡 Result:

Short summary — what changed between Inno Setup 6.2.2 (Feb 15, 2023) and 6.6.1 (Nov 20, 2025), and compatibility notes

Key differences (high‑level)

  • Security / reproducible builds: added [Files] flag notimestamp to avoid storing file timestamps (helps reproducible builds). [1]
  • UI / styles: improved custom style handling for RTF foreground colors; new [Setup] directive WizardImageOpacity; identical regular/DynamicDark wizard images are stored only once. Documentation fixes for CreateCustomForm. [1][2]
  • Pascal Script additions / fixes across 6.3–6.6: fixes for TStream.Seek, Extract7ZipArchive, improved download/basic-auth support earlier, and various Pascal Script stability/improvements. (Multiple point releases between 6.2.2 → 6.6.1 include script API fixes.) [3][4]
  • Compression / toolchain changes: LZMA SDK updated (6.4.x) which affects compression behavior/tuning; other internal tool/Delphi upgrades and minor behavior changes in 6.3–6.5. [5]
  • New tooling: ISSigTool.exe (ECDSA P‑256 signatures for verifying some bundled DLLs) introduced as a preview in 6.4.3. [5]
  • Miscellaneous: many small IDE/compiler improvements, DPI/font tweaks, high‑quality system icons on some dialogs, CloseApplicationsFilterExcludes, RedirectionGuard logging, and other minor/security/compatibility fixes added in point releases. See full changelogs for details. [3][5][1]

Compatibility implications / migration notes

  • Script compatibility: Most .iss scripts remain compatible. However, Pascal Script code can be sensitive to engine changes — review any custom [Code] uses (TStream, Extract7ZipArchive, download APIs, Format behavior) and retest installers after upgrading. If you rely on third‑party tools (e.g., Graphical Installer) confirm compatibility with the target Inno Setup version. [3][4]
  • Compression differences: If you rely on exact installer sizes or specific LZMA tuning, re‑test compression settings after 6.4.x (LZMA SDK) because some settings (e.g., LZMABlockSize vs dictionary size) may behave differently. [5]
  • Visual/custom style changes: If you use custom styles or custom RTF/wizard images, test them (WizardImageOpacity, color handling, DynamicDark image deduplication). [1]
  • Security/behavior under SYSTEM: Various mitigations for DLL preloading and other security fixes were added after 6.2.2 — those can change runtime behavior in restricted contexts; test installers run as SERVICE/SYSTEM where relevant. [3]

Where to read the full details (changelogs)

  • 6.6.1 whatsnew (Inno Setup official): jrsoftware.org files/6.6.1 notes. [1]
  • 6.4.x and 6.3.x revision histories (notable changes such as LZMA SDK, ISSigTool, Pascal Script fixes): jrsoftware.org whatsnew pages. [5][3]
  • 6.2.2 whatsnew (base you’re coming from): jrsoftware.org 6.2.2 notes. [3]

References

  1. Inno Setup 6.6.1 changelog / whatsnew (jrsoftware). [https://jrsoftware.org/files/is6-whatsnew.htm — see 6.6.1]. [1]
  2. Inno Setup GitHub mirror / whatsnew (documentation bits). [https://jrsoftware.github.io/issrc/whatsnew.htm]. [2]
  3. Inno Setup 6.2.2 whatsnew (jrsoftware). [https://jrsoftware.org/files/is6.2-whatsnew.htm]. [3]
  4. Pascal Script / community notes (examples of fixes and Graphical Installer compatibility discussions). (Inno Setup mailing list / groups). [4]
  5. Inno Setup 6.4.x revision history (LZMA SDK update, ISSigTool, IDE changes). [https://jrsoftware.org/files/is6.4-whatsnew.htm]. [5]

If you want, I can:

  • extract the exact changelog entries for every intermediate version (6.3.0 → 6.6.1), or
  • scan your script for likely incompatibilities and list lines to test/adjust. Which would you prefer?

Clarify the necessity of the Innosetup version bump for this PR.

Line 40 updates INNO_VERSION from 6.2.2 to 6.6.1. While 6.6.1 is a stable release with no documented breaking changes, the upgrade spans multiple minor versions (~2.8 years). The PR objectives focus on CEii device fixes (charge bypass, TDP control), and it's unclear why an Innosetup version bump is required or included.

Before merging, clarify:

  1. Whether this version bump is necessary for the device fixes or is an unrelated update
  2. Whether your installer scripts or build process depend on changes in 6.6.1
  3. That the installer still functions correctly with 6.6.1 in your build environment
🤖 Prompt for AI Agents
.github/workflows/publish-hc.yml around line 40: the INNO_VERSION was changed
from 6.2.2 to 6.6.1 without explanation; either revert this bump if it is
unrelated to the CEii device fixes, or provide explicit justification and
verification steps: state in the PR description why 6.6.1 is required for the
fixes (or confirm it is a separate maintenance update), run a full installer
build using 6.6.1 in your CI/local environment and report pass/fail, ensure
installer behavior is unchanged (smoke test install/uninstall), and add a short
note in the workflow commit message or changelog indicating the reason for the
version bump and test results; if the build fails or no dependency exists,
revert to 6.2.2.

@GopherTheCoder
Copy link
Contributor Author

Inno Setup 6.2.2 doesn't support ArchitecturesInstallIn64BitMode=x64compatible, so I just update that to latest version.

@Valkirie
Copy link
Owner

Valkirie commented Dec 1, 2025

Looks alright. Let me know when you want me to merge.

@GopherTheCoder
Copy link
Contributor Author

Looks alright. Let me know when you want me to merge.

Thanks, please merge. Also can you link the bug to close it with merge? Or you'll close it with next release?

@Valkirie Valkirie merged commit 423ac2a into Valkirie:main Dec 8, 2025
2 checks passed
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.

2 participants