Skip to content

Add Legacy Stationary Bike#124

Merged
StephenHidem merged 3 commits into
masterfrom
121-stationary-bike-fitness-equipment-type-0x15
Apr 14, 2026
Merged

Add Legacy Stationary Bike#124
StephenHidem merged 3 commits into
masterfrom
121-stationary-bike-fitness-equipment-type-0x15

Conversation

@StephenHidem
Copy link
Copy Markdown
Owner

PR Classification

New feature and refactor: Adds support for the ANT+ Legacy Stationary Bike device profile, refactors lap toggle handling, and fixes treadmill state handling.

PR Summary

This PR introduces the StationaryBike device profile to the Fitness Equipment category, refactors lap toggle event handling for consistency, and fixes treadmill state management. It also adds targeted unit tests and updates documentation and dependencies.

  • FitnessEquipment.cs: Adds StationaryBike support, refactors lap toggle logic into HandleFEState, and fixes treadmill state handling.
  • StationaryBike.cs: Implements the new StationaryBike class with cadence and power parsing.
  • FitnessEquipmentTests.cs and StationaryBikeTests.cs: Adds and updates unit tests for StationaryBike and lap toggle events.
  • Updates enums (FitnessEquipmentType, DataPage) to include StationaryBike.
  • Updates version to 6.1.0 and documentation/release notes.

Closes #121.

- Introduce StationaryBikeData and StationaryBike enum values
- Implement StationaryBike class with cadence and power parsing
- Update factory methods to instantiate StationaryBike as needed
- Move lap toggle logic to HandleFEState for consistency
- Add unit tests for StationaryBike covering parsing, invalid values, and ToString().
- Update XML docs to clarify invalid cadence/power values.
- Call HandleFEState in StationaryBike and Treadmill Parse methods.
- Expand FitnessEquipmentTests to cover StationaryBike and LapToggled event for all equipment types.
- Bump version to 6.1.0 and update release notes/docs
- Add Legacy Stationary Bike device profile to Fitness Equipment
- Refactor: HandleFEState now handles lap toggle
- Fix: Treadmill correctly handles fitness equipment state
- Update NuGet dependencies
- Improve XML docs for StationaryBike and TrainerStationaryBike
@StephenHidem StephenHidem linked an issue Apr 14, 2026 that may be closed by this pull request
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the Legacy Stationary Bike device profile to the Fitness Equipment category, including its parsing logic and associated unit tests. It also refactors the FitnessEquipment base class to centralize lap toggle handling within HandleFEState and fixes an issue where the treadmill profile was not correctly processing equipment state. Feedback focuses on correctly parsing the 12-bit instantaneous power value for stationary bikes, updating documentation for invalid power constants, ensuring the handledPage flag is correctly set after parsing, and improving unit test robustness by using literal values instead of Moq matchers in constructors.

Comment thread AntPlus/DeviceProfiles/FitnessEquipment/StationaryBike.cs
Comment thread AntPlus/DeviceProfiles/FitnessEquipment/StationaryBike.cs
Comment thread AntPlus/DeviceProfiles/FitnessEquipment/StationaryBike.cs
@StephenHidem StephenHidem merged commit 9ec4b70 into master Apr 14, 2026
5 checks passed
@StephenHidem StephenHidem deleted the 121-stationary-bike-fitness-equipment-type-0x15 branch April 14, 2026 22:34
@Rob-Hague
Copy link
Copy Markdown

Thanks Stephen, it looks good to me, I'll test it out on the weekend and let you know if anything looks up

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.

Stationary bike fitness equipment type 0x15

2 participants