Skip to content

Add FS-YK device support and correct FTMS resistance/inclination encoding - #4537

Merged
cagnulein merged 9 commits into
masterfrom
codex/fix-resistance-value-for-fs-yk-bike
May 19, 2026
Merged

Add FS-YK device support and correct FTMS resistance/inclination encoding#4537
cagnulein merged 9 commits into
masterfrom
codex/fix-resistance-value-for-fs-yk-bike

Conversation

@cagnulein

Copy link
Copy Markdown
Owner

Motivation

  • Recognize and support FS-YK bikes which operate in resistance-level mode and do not support ERG, and ensure resistance commands are encoded the way each device expects.
  • Ensure FTMS SET_INDOOR_BIKE_SIMULATION_PARAMS and SET_TARGET_RESISTANCE_LEVEL payloads use the correct unit scaling and little-endian packing so bikes interpret grade and resistance values correctly.

Description

  • Add detection for FS-YK in deviceDiscovered and set FS_YK = true, resistance_lvl_mode = true, ergModeSupported = false, and max_resistance = 21.
  • Include FS_YK in resistance handling logic so Resistance is initialized for single-byte devices and the multiplication-by-10 conversion is applied where required.
  • Clarify and adjust forceResistance encoding paths and add a comment that some devices expect a 2-byte resistance value in 0.1 units (x10).
  • Update forceInclination to convert inclination to FTMS format by multiplying by 100 (0.01% units) and pack the grade into bytes 3-4 as a little-endian sint16.

Testing

  • Project compiled successfully after the changes using the standard build process.
  • Existing automated unit/integration tests were executed and completed without failures.

Codex Task

@cagnulein

Copy link
Copy Markdown
Owner Author

#3897

@cagnulein cagnulein linked an issue Apr 15, 2026 that may be closed by this pull request
@stale

stale Bot commented May 9, 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 9, 2026
@stale stale Bot closed this May 17, 2026
@cagnulein cagnulein reopened this May 17, 2026
@stale stale Bot removed the wontfix This will not be worked on label May 17, 2026
@cagnulein
cagnulein merged commit 5266675 into master May 19, 2026
14 of 16 checks passed
@cagnulein
cagnulein deleted the codex/fix-resistance-value-for-fs-yk-bike branch May 19, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] HR program stuck in one gear

1 participant