Repository navigation
Fix device_info rewrite for devices that omit product (COROS DURA) — fixes #80 - #86
Open
nothingshocking wants to merge 2 commits into
Open
nothingshocking wants to merge 2 commits into
nothingshocking wants to merge 2 commits into
Conversation
2 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #80.
Problem
The COROS DURA writes a
device_inforecord containing onlymanufacturer(294)and a text
product_name. It has no numericproduct,device_index,serial_number, orsource_type. The existing rewrite only overwritesproductwhen it is already present, so the output has
manufacturer=GARMINwith no product,and Garmin Connect shows no device for the activity.
Simply removing the
is not Noneguard isn't enough: a parsed message's fields arebound to the source definition, so assigning a field that wasn't defined raises
Field is not growable.Fix
When a
device_inforecord being modified has noproduct/garmin_product:DeviceInfoMessage(same approach as theFileIdMessagerewrite), copying all populated fields across.
productto the profile's target device.device_index=0(creator),source_type=local, andserial_number(from theprofile, falling back to the existing default) if absent, so Garmin Connect
recognises the record as the recording device.
Records that already carry a product (e.g. Hammerhead Karoo) go through the existing
code path unchanged.
Testing
tests/test_fit_editor.py(synthetic DURA-style files).test_show_dirs_flag_with_garmin_dirs, which also failson unmodified
mainin my environment.Garmin Connect. After: shows Edge 830. Karoo activities upload unchanged (409
duplicate as expected).