Index: leahi_dialin/td/modules/air_trap.py =================================================================== diff -u -r0b843faddee1416bfddb6f2589aedecf950c6df8 -re5c5e1a8c10903e8caa793694b8f309125b2f6d8 --- leahi_dialin/td/modules/air_trap.py (.../air_trap.py) (revision 0b843faddee1416bfddb6f2589aedecf950c6df8) +++ leahi_dialin/td/modules/air_trap.py (.../air_trap.py) (revision e5c5e1a8c10903e8caa793694b8f309125b2f6d8) @@ -249,3 +249,28 @@ else: self.logger.debug("timeout!!") return False + + def cmd_set_td_air_trap_control(self, control: int = 0) -> int: + """ + Constructs and sends a set control command to the TD air trap. + + @param valve: start/stop for air trap control + @returns 1 if successful, zero otherwise + """ + + ctl = integer_to_bytearray(control) + payload = ctl + + message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_td_ch_id, + message_id=MsgIds.MSG_ID_TD_SET_AIR_TRAP_CONTROL.value, + payload=payload) + # Send message + received_message = self.can_interface.send(message) + + # If there is content... + if received_message is not None: + # response payload is OK or not OK + return received_message['message'][DenaliMessage.PAYLOAD_START_INDEX] + else: + self.logger.debug("timeout!!") + return False \ No newline at end of file