Closed erwinfs closed 4 years ago
I have the same problem with a file recorded and exported from the Stava Android app. It seems that some messages don't have the unit field such that message.get('units').raw_value fails as described above.
An example message is: <DataMessage: field_description (#206) -- local mesg: #0, fields: [developer_data_index: 0, field_definition_number: 1, fit_base_type_id: string, field_name: activity_type]>
The issue can be fixed, by testing if the output from message.get('units') is equal to None.
if message.get('units') is not None:
units = message.get('units').raw_value
else:
units = None
Hi, Thank you for your very useful program.
I had an issue with a file generated by the Wahoo iOS app (files from my Garmin watch work fine). I printed the field names and units in add_dev_field_description:
The fields that lack units cause the problem.
Replacing line 453 in records.py with the following solved the problem for me
if message.get('units'): units = message.get('units').raw_value else: units = ''