Index: leahi_dialin/dd/modules/drybicart.py =================================================================== diff -u -r8007c58c88b92652c64b3742f73d2ea10bce1440 -r78b7d4b47c77f390fdb0c796e4861cc9abb343fd --- leahi_dialin/dd/modules/drybicart.py (.../drybicart.py) (revision 8007c58c88b92652c64b3742f73d2ea10bce1440) +++ leahi_dialin/dd/modules/drybicart.py (.../drybicart.py) (revision 78b7d4b47c77f390fdb0c796e4861cc9abb343fd) @@ -51,10 +51,10 @@ message_id = MsgIds.MSG_ID_DD_DRY_BICART_DATA.value, function = self._handler_dry_bicart_sync) - self.dd_dry_bicart_timestamp = 0 #: The timestamp of the last message + self.dd_dry_bicart_timestamp = 0.0 #: The timestamp of the last message self.dd_dry_bicart_fill_execution_state = 0 #: The Dry Bicart fill execution state self.dd_bicarb_chamber_fill_execution_state = 0 #: The Bicarb chamber fill execution state - self.dd_dry_bicart_drain_execution_state = 0 #: The Dry Bicart drain execution state + self.dd_dry_bicart_drain_execution_state = 0.0 #: The Dry Bicart drain execution state self.dd_dry_bicart_fill_cycle_counter = 0 #: The Dry Bicart fill cycle counter self.dd_dry_bicart_max_fill_cycle_count = 0 #: The Dry Bicart max fill cycle state self.dd_dry_bicart_fill_request = 0 #: Is fill requested for Dry Bicart or not Index: leahi_dialin/utils/abstract_classes.py =================================================================== diff -u -r775f2d7ca9a4d1c86c02bc27130f8765dc4156ad -r78b7d4b47c77f390fdb0c796e4861cc9abb343fd --- leahi_dialin/utils/abstract_classes.py (.../abstract_classes.py) (revision 775f2d7ca9a4d1c86c02bc27130f8765dc4156ad) +++ leahi_dialin/utils/abstract_classes.py (.../abstract_classes.py) (revision 78b7d4b47c77f390fdb0c796e4861cc9abb343fd) @@ -88,12 +88,16 @@ variable_name = decode_details[0] datatype: DataTypes = decode_details[-1] end_pos = start_pos + datatype.size() - value = struct.unpack(datatype.unpack_attrib(), bytearray(message['message'][start_pos:end_pos]))[0] + try: + value = struct.unpack(datatype.unpack_attrib(), bytearray(message['message'][start_pos:end_pos]))[0] + except Exception as e: + value = None if debug: - print(f'value: {value} ({datatype.name})') + print(f'{variable_name}: {value} ({datatype.name})') print(f'pos: {start_pos} - {end_pos}') if 'nan' in str(value).lower(): - raise ValueError(f'{value} is not an accepted value!') + value = None + # raise ValueError(f'{value} is not an accepted value!') if datatype is DataTypes.BOOL: value = True if value == 1 else False results[variable_name] = value @@ -141,7 +145,8 @@ print(f'value: {value} ({datatype.name})') print(f'pos: {start_pos} - {end_pos}') if 'nan' in str(value).lower(): - raise ValueError(f'{value} is not an accepted value!') + value = None + # raise ValueError(f'{value} is not an accepted value!') # If the type is Bool, convert the value from Integer to Boolean if datatype is DataTypes.BOOL: value = True if value == 1 else False