Index: dialin/dg/events.py =================================================================== diff -u -re1a940b7549b37e616b28563e6e7c151a897054c -rda00dd6fd659901cce93ebedeb6fa9ae1220e889 --- dialin/dg/events.py (.../events.py) (revision e1a940b7549b37e616b28563e6e7c151a897054c) +++ dialin/dg/events.py (.../events.py) (revision da00dd6fd659901cce93ebedeb6fa9ae1220e889) @@ -183,17 +183,17 @@ event_data_2 = DGOpModes(event_data_2).name # Check if the event state name is sub mode change. elif event_state_name == DGEventList.DG_EVENT_SUB_MODE_CHANGE.name: - # Get the length of the list of the sub mode list + # Get the length of the list of the op mode list op_list_len = len(self._dg_event_dictionary[DGEventList.DG_EVENT_OP_MODE_CHANGE.name]) - # Get the last tuple of the sub mode + # Get the last tuple of the op mode # It is a list of tuples that each tuple is (timestamp, event type, prev op mode, current op mode) if op_list_len != 0: last_op_tuple = self._dg_event_dictionary[DGEventList.DG_EVENT_OP_MODE_CHANGE.name][op_list_len - 1] else: # No op mode event has been recieved before the submode event was recieved. Use broadcast messages to # determine current op mode. Previous mode can not be known - last_op_tuple = (localtime(self.dg_event_op_mode_timestamp), + last_op_tuple = (datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f'), DGEventList.DG_EVENT_OP_MODE_CHANGE.name, DGEvents.UNKNOWN_STATE, DGOpModes(self.dg_event_op_mode).name) # Get the current and previous operation modes of the last tuple in the list of the sub modes @@ -221,7 +221,6 @@ # operation mode states can be converted from the current sub mode enum class if current_sub_mode_timestamp != 0: if current_op_mode_timestamp <= current_sub_mode_timestamp: - event_data_1 = current_sub_mode_enum_class(event_data_1).name event_data_2 = current_sub_mode_enum_class(event_data_2).name Index: dialin/hd/hd_events.py =================================================================== diff -u -re1a940b7549b37e616b28563e6e7c151a897054c -rda00dd6fd659901cce93ebedeb6fa9ae1220e889 --- dialin/hd/hd_events.py (.../hd_events.py) (revision e1a940b7549b37e616b28563e6e7c151a897054c) +++ dialin/hd/hd_events.py (.../hd_events.py) (revision da00dd6fd659901cce93ebedeb6fa9ae1220e889) @@ -179,17 +179,17 @@ event_data_2 = HDOpModes(event_data_2).name # Check if the event state name is sub mode change. elif event_state_name == HDEventList.HD_EVENT_SUB_MODE_CHANGE.name: - # Get the length of the list of the sub mode list + # Get the length of the list of the op mode list op_list_len = len(self._hd_event_dictionary[HDEventList.HD_EVENT_OP_MODE_CHANGE.name]) - # Get the last tuple of the sub mode + # Get the last tuple of the op mode # It is a list of tuples that each tuple is (timestamp, event type, prev op mode, current op mode) if op_list_len != 0: last_op_tuple = self._hd_event_dictionary[HDEventList.HD_EVENT_OP_MODE_CHANGE.name][op_list_len - 1] else: # No op mode event has been recieved before the submode event was recieved. Use broadcast messages to # determine current op mode. Previous mode can not be known - last_op_tuple = (localtime(self.hd_event_op_mode_timestamp), + last_op_tuple = (datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f'), HDEventList.HD_EVENT_OP_MODE_CHANGE.name, HDEvents.UNKNOWN_STATE, HDOpModes(self.hd_event_op_mode).name) Index: dialin/protocols/CAN.py =================================================================== diff -u -rac5801c48b2b5058c330ca67f849ed5d2c55dc3f -rda00dd6fd659901cce93ebedeb6fa9ae1220e889 --- dialin/protocols/CAN.py (.../CAN.py) (revision ac5801c48b2b5058c330ca67f849ed5d2c55dc3f) +++ dialin/protocols/CAN.py (.../CAN.py) (revision da00dd6fd659901cce93ebedeb6fa9ae1220e889) @@ -663,7 +663,7 @@ # Done with this message, let's get the next one self.messages = None - self.message_queue_mutex.release() + self.message_queue_mutex.release() @staticmethod def is_ui_received_channel(channel_id: int) -> bool: