Skip to content

Commit bb54ac8

Browse files
committed
records: add_dev_data_id: allow developer_data_id messages without set application_id
It seems like the ELEMNT bolt writes messages without application_id set. In that case, store None there. fixes #35.
1 parent 0d6a748 commit bb54ac8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fitparse/records.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,10 @@ def parse_string(string):
363363
def add_dev_data_id(message):
364364
global DEV_TYPES
365365
dev_data_index = message.get('developer_data_index').raw_value
366-
application_id = message.get('application_id').raw_value
366+
if message.get('application_id'):
367+
application_id = message.get('application_id').raw_value
368+
else:
369+
application_id = None
367370

368371
# Note that nothing in the spec says overwriting an existing type is invalid
369372
DEV_TYPES[dev_data_index] = {'dev_data_index': dev_data_index, 'application_id': application_id, 'fields': {}}

0 commit comments

Comments
 (0)