Skip to content

Fix: Initialize lastGearValue to prevent unwanted setResistance on init (#4018) - #4156

Open
cagnulein wants to merge 1 commit into
masterfrom
claude/debug-kickr-resistance-command-YeQgR
Open

Fix: Initialize lastGearValue to prevent unwanted setResistance on init (#4018)#4156
cagnulein wants to merge 1 commit into
masterfrom
claude/debug-kickr-resistance-command-YeQgR

Conversation

@cagnulein

Copy link
Copy Markdown
Owner

Problem:

  • lastGearValue was initialized to -1 (default)
  • During init, it was not set to the current gears() value
  • On first update after init, the condition "lastGearValue != gears()"
    was always true (-1 != 0)
  • This caused an unwanted setResistance command (0x40 0x5b 0x3f) to be
    sent immediately after setSimMode

Solution:

  • Initialize lastGearValue = gears() during init (line 264)
  • This prevents false gear change detection on first update
  • setResistance is now only sent when there's an actual gear change

Fixes issue #4018 - Resistance Changes when Virtual Shifting

…it (#4018)

Problem:
- lastGearValue was initialized to -1 (default)
- During init, it was not set to the current gears() value
- On first update after init, the condition "lastGearValue != gears()"
  was always true (-1 != 0)
- This caused an unwanted setResistance command (0x40 0x5b 0x3f) to be
  sent immediately after setSimMode

Solution:
- Initialize lastGearValue = gears() during init (line 264)
- This prevents false gear change detection on first update
- setResistance is now only sent when there's an actual gear change

Fixes issue #4018 - Resistance Changes when Virtual Shifting
@stale

stale Bot commented Jan 29, 2026

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the wontfix This will not be worked on label Jan 29, 2026
@stale stale Bot closed this Feb 5, 2026
@cagnulein cagnulein reopened this Feb 6, 2026
@stale stale Bot removed the wontfix This will not be worked on label Feb 6, 2026
@stale

stale Bot commented Feb 21, 2026

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the wontfix This will not be worked on label Feb 21, 2026
@stale stale Bot closed this Feb 28, 2026
@cagnulein cagnulein reopened this Feb 28, 2026
@stale stale Bot removed the wontfix This will not be worked on label Feb 28, 2026
@stale

stale Bot commented Mar 20, 2026

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the wontfix This will not be worked on label Mar 20, 2026
@stale stale Bot closed this Mar 27, 2026
@cagnulein cagnulein reopened this Mar 27, 2026
@stale stale Bot closed this Apr 3, 2026
@cagnulein cagnulein reopened this Apr 4, 2026
@stale stale Bot removed the wontfix This will not be worked on label Apr 4, 2026
@stale

stale Bot commented Apr 19, 2026

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the wontfix This will not be worked on label Apr 19, 2026
@stale stale Bot closed this Apr 28, 2026
@cagnulein cagnulein reopened this Apr 28, 2026
@stale stale Bot removed the wontfix This will not be worked on label Apr 28, 2026
@stale

stale Bot commented May 13, 2026

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the wontfix This will not be worked on label May 13, 2026
@stale stale Bot closed this May 20, 2026
@cagnulein cagnulein reopened this May 20, 2026
@stale stale Bot removed the wontfix This will not be worked on label May 20, 2026
@stale

stale Bot commented Jun 5, 2026

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the wontfix This will not be worked on label Jun 5, 2026
@stale stale Bot closed this Jun 14, 2026
@cagnulein cagnulein reopened this Jun 14, 2026
@stale stale Bot removed the wontfix This will not be worked on label Jun 14, 2026
@stale

stale Bot commented Jun 30, 2026

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the wontfix This will not be worked on label Jun 30, 2026
@stale stale Bot closed this Jul 7, 2026
@cagnulein cagnulein reopened this Jul 7, 2026
@stale stale Bot removed the wontfix This will not be worked on label Jul 7, 2026
@stale

stale Bot commented Jul 22, 2026

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the wontfix This will not be worked on label Jul 22, 2026
@stale stale Bot closed this Jul 30, 2026
@cagnulein cagnulein reopened this Jul 30, 2026
@stale stale Bot removed the wontfix This will not be worked on label Jul 30, 2026
@cagnulein

Copy link
Copy Markdown
Owner Author

#4881

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