Skip to content

add support for onelap#72

Open
zyallday wants to merge 3 commits into
jat255:mainfrom
zyallday:main
Open

add support for onelap#72
zyallday wants to merge 3 commits into
jat255:mainfrom
zyallday:main

Conversation

@zyallday

Copy link
Copy Markdown

No description provided.

@jat255 jat255 added enhancement New feature or request fit-file Having to do with FIT files somehow labels Apr 26, 2026

@jat255 jat255 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for adding Onelap support! The overall direction is right, but there are a few things to address before merging:

Issues

1. Use Manufacturer.ONELAP.value instead of raw 307

Unlike MYWHOOSH (331), which truly is unknown to the vendored fit_tool, Onelap is defined in the enum as Manufacturer.ONELAP. The raw integer with a comment is inconsistent with every other entry in those lists:

# Both _should_modify_manufacturer and _should_modify_device_info
Manufacturer.ONELAP.value,  # instead of: 307,  # ONELAP

2. Skipping software messages (ID 35) is a global behavior change

if message.global_id == 35:
    _logger.debug(f"Skipping Software message at record {i}")
    continue

This drops software messages from all platforms, not just Onelap. If Onelap requires this (e.g., their software message causes Garmin Connect to reject the file), it should be gated on the source manufacturer. Dropping this silently for all manufacturers is not acceptable.

3. Broken docstrings

The rewrite_file_id_message and _should_modify_manufacturer docstrings now list only MYWHOOSH and ONELAP as supported manufacturers, omitting DEVELOPMENT, ZWIFT, WAHOO_FITNESS, PEAKSWARE, HAMMERHEAD, and COROS. Looks like a multi-line string was accidentally truncated rather than appended to (maybe an agent mishit when editing?).

4. No tests

The project maintains 100% coverage with a test FIT file per platform. This PR needs a sample Onelap FIT file in tests/files/ and corresponding test cases in test_config.py / test_app.py (at minimum covering AppType.ONELAP and OnelapDetector path detection). The PR will not be accepted until 100% coverage is met.


Minor notes

  • The if message.product is not None: change (vs the old truthiness check) is a real correctness fix -- good catch.
  • OnelapDetector looks reasonable. One nit: the docstring lists both macOS and Windows pointing to the same ~/Documents/Onelap/Activity/ path, which is slightly confusing.

Comment thread fit_file_faker/config.py Outdated
Comment thread fit_file_faker/fit_editor.py Outdated
Comment thread fit_file_faker/fit_editor.py Outdated
Comment thread fit_file_faker/fit_editor.py Outdated
Comment thread fit_file_faker/fit_editor.py
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d899364) to head (0e2efd2).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #72   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines         1238      1252   +14     
=========================================
+ Hits          1238      1252   +14     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request fit-file Having to do with FIT files somehow needs-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants