Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions garmin_fit_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.205.0Release
# Tag = production/release/21.205.0-0-gb3c261eb
# Profile Version = 21.208.0Release
# Tag = production/release/21.208.0-0-g5209d509
############################################################################################


Expand All @@ -23,4 +23,4 @@
from garmin_fit_sdk.stream import Stream
from garmin_fit_sdk.util import FIT_EPOCH_S, convert_datetime_to_timestamp, convert_timestamp_to_datetime, BASE_TYPE_TO_FIELD_TYPE, FIELD_TYPE_TO_BASE_TYPE

__version__ = '21.205.0'
__version__ = '21.208.0'
4 changes: 2 additions & 2 deletions garmin_fit_sdk/accumulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.205.0Release
# Tag = production/release/21.205.0-0-gb3c261eb
# Profile Version = 21.208.0Release
# Tag = production/release/21.208.0-0-g5209d509
############################################################################################


Expand Down
4 changes: 2 additions & 2 deletions garmin_fit_sdk/bitstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.205.0Release
# Tag = production/release/21.205.0-0-gb3c261eb
# Profile Version = 21.208.0Release
# Tag = production/release/21.208.0-0-g5209d509
############################################################################################


Expand Down
4 changes: 2 additions & 2 deletions garmin_fit_sdk/crc_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.205.0Release
# Tag = production/release/21.205.0-0-gb3c261eb
# Profile Version = 21.208.0Release
# Tag = production/release/21.208.0-0-g5209d509
############################################################################################


Expand Down
28 changes: 11 additions & 17 deletions garmin_fit_sdk/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.205.0Release
# Tag = production/release/21.205.0-0-gb3c261eb
# Profile Version = 21.208.0Release
# Tag = production/release/21.208.0-0-g5209d509
############################################################################################


Expand Down Expand Up @@ -361,11 +361,6 @@ def __read_message(self, mesg_def):
field_profile = mesg_def['fields'][field_id] if field_id in mesg_def['fields'] else None
field_name = field_profile['name'] if field_id in mesg_def['fields'] else field_id

if field_profile is not None and 'has_components' in field_profile:
convert_invalids_to_none = not field_profile['has_components']
else:
convert_invalids_to_none = True

field_value = None

# Fields with strings or string arrays
Expand All @@ -381,15 +376,15 @@ def __read_message(self, mesg_def):
field_value = raw_array if util._only_invalid_values(raw_array, invalid) is False else None
else:
for i in range(num_elements):
raw_value = raw_values[index + i] if raw_values[index + i] != invalid or not convert_invalids_to_none else None
raw_value = raw_values[index + i] if raw_values[index + i] != invalid else None
field_value.append(raw_value)

if self.__is_array_all_none(field_value) is True:
field_value = None

# Fields with a single value
else:
if raw_values[index] != invalid or not convert_invalids_to_none:
if raw_values[index] != invalid:
field_value = raw_values[index]

if field_value is not None:
Expand Down Expand Up @@ -469,7 +464,7 @@ def __expand_components(self, mesg_num, message, fields, mesg_def):
field_definition_number = field_to_expand['field_definition_number']
field_profile = mesg_def['fields'].get(field_definition_number)

if field_profile is None:
if field_profile is None:
continue

is_sub_field = field_to_expand.get('is_sub_field') or False
Expand Down Expand Up @@ -505,7 +500,7 @@ def __expand_components(self, mesg_num, message, fields, mesg_def):

value = bitstream.read_bits(field_profile['bits'][i])

if target_field['is_accumulated'] is True:
if target_field['is_accumulated'] is True:
value = self._accumulator.accumulate(mesg_num, target_field['num'], value, field_profile['bits'][i])

# Undo component scale and offset before applying the destination field's scale and offset
Expand Down Expand Up @@ -571,10 +566,10 @@ def __expand_sub_field(self, message, field_profile):
def __get_subfield_profile(self, field_profile, name):
return next(sub_field for sub_field in field_profile['sub_fields'] if sub_field['name'] == name) or {}

def __set_accumulated_value(self, mesg_def, message, field, raw_field_value):
def __set_accumulated_value(self, mesg_def, message, field, raw_field_value):
raw_field_values = raw_field_value if type(raw_field_value) == list else [raw_field_value]

for value in raw_field_values:
for value in raw_field_values:
for containing_field in message.values():
components = mesg_def['fields'].get(field['num'])['components']
for i, component_field_num in enumerate(components):
Expand All @@ -597,11 +592,10 @@ def __convert_type_to_string(self, field_type, raw_field_value):

if isinstance(raw_field_value, list):
for i in range(len(raw_field_value)):
key = str(raw_field_value[i])
field_value[i] = types.get(key, raw_field_value[i])
field_value[i] = types.get(raw_field_value[i], raw_field_value[i])
return field_value

return types.get(str(raw_field_value), field_value)
return types.get(raw_field_value, field_value)
except Exception:
return raw_field_value

Expand Down Expand Up @@ -754,7 +748,7 @@ def __init__(self, stream, decode_mode):
self.data_size = data_size

return

self.header_size = stream.read_byte()
self.protocol_version = stream.read_byte()
self.profile_version = stream.read_unint_16("little")
Expand Down
6 changes: 3 additions & 3 deletions garmin_fit_sdk/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.205.0Release
# Tag = production/release/21.205.0-0-gb3c261eb
# Profile Version = 21.208.0Release
# Tag = production/release/21.208.0-0-g5209d509
############################################################################################


Expand Down Expand Up @@ -242,7 +242,7 @@ def _transform_value(self, value, field_definition):
profile_type = Profile['types'].get(field_type, {})
for type_key, type_value in profile_type.items():
if type_value == value:
return int(type_key, 0)
return type_key

raise ValueError()

Expand Down
4 changes: 2 additions & 2 deletions garmin_fit_sdk/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.205.0Release
# Tag = production/release/21.205.0-0-gb3c261eb
# Profile Version = 21.208.0Release
# Tag = production/release/21.208.0-0-g5209d509
############################################################################################


Expand Down
4 changes: 2 additions & 2 deletions garmin_fit_sdk/hr_mesg_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.205.0Release
# Tag = production/release/21.205.0-0-gb3c261eb
# Profile Version = 21.208.0Release
# Tag = production/release/21.208.0-0-g5209d509
############################################################################################


Expand Down
4 changes: 2 additions & 2 deletions garmin_fit_sdk/mesg_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.205.0Release
# Tag = production/release/21.205.0-0-gb3c261eb
# Profile Version = 21.208.0Release
# Tag = production/release/21.208.0-0-g5209d509
############################################################################################


Expand Down
4 changes: 2 additions & 2 deletions garmin_fit_sdk/output_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Transfer (FIT) Protocol License.
###########################################################################################
# ****WARNING**** This file is auto-generated! Do NOT edit this file.
# Profile Version = 21.205.0Release
# Tag = production/release/21.205.0-0-gb3c261eb
# Profile Version = 21.208.0Release
# Tag = production/release/21.208.0-0-g5209d509
############################################################################################


Expand Down
Loading
Loading