Index: leahi_dialin/td/modules/buttons.py =================================================================== diff -u -r5c1132f5aadff6082afa56588ad1f4a64f828cd9 -r655be738c7bb307fcf3baa139acba0fb6c62ec4b --- leahi_dialin/td/modules/buttons.py (.../buttons.py) (revision 5c1132f5aadff6082afa56588ad1f4a64f828cd9) +++ leahi_dialin/td/modules/buttons.py (.../buttons.py) (revision 655be738c7bb307fcf3baa139acba0fb6c62ec4b) @@ -78,11 +78,14 @@ self.logger.debug("Poweroff message id detected, but was the wrong length.") return - mode = struct.unpack(DataTypes.U16.unpack_attrib(), bytearray( - message["message"][MsgFieldPositions.START_POS_FIELD_1: MsgFieldPositions.START_POS_FIELD_1 + 2])) + msg_list = [] + msg_list.append(('mode', DataTypes.U16)) - if len(mode) > 0: - self.poweroff_timeout_expired = bool(mode[0]) + result = self.process_into_vars(decoder_list = msg_list, + message = message) + + if len(result['mode']) > 0: + self.poweroff_timeout_expired = bool(result['mode'][0]) self.td_power_off_timestamp = timestamp self.handler_execution_times.append((timestamp, message, time.perf_counter() - start))