Index: leahi_dialin/td/modules/air_pump.py =================================================================== diff -u -r7f463d8649e41b995e1a94cc001ffc50541cafb7 -reb02c56e88faeeda46ed62b1c0ec841dca0b9aba --- leahi_dialin/td/modules/air_pump.py (.../air_pump.py) (revision 7f463d8649e41b995e1a94cc001ffc50541cafb7) +++ leahi_dialin/td/modules/air_pump.py (.../air_pump.py) (revision eb02c56e88faeeda46ed62b1c0ec841dca0b9aba) @@ -71,21 +71,28 @@ def cmd_air_pump_set_state(self, state: int, power: int) -> int: """ Constructs and sends the air pump set state command. + AIR_PUMP_STATE_INIT = 0, ///< Air Pump Initialize state + AIR_PUMP_STATE_OFF, ///< Air Pump Off state + AIR_PUMP_STATE_ON, ///< Air Pump On state + NUM_OF_AIR_PUMP_STATES, ///< Number of air pump states Constraints: Must be logged into TD. + @param state: integer - state value to set the air pump @param power: integer - 0-255 value to set the air pump power @return: 1 if successful, zero otherwise """ - sts = integer_to_bytearray(state) + idx = integer_to_bytearray(state) pwr = integer_to_bytearray(power) - payload = sts + pwr + payload = idx + pwr message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_td_ch_id, message_id=MsgIds.MSG_ID_TD_AIR_PUMP_SET_STATE_REQUEST.value, payload=payload) + self.logger.debug("setting air pump state to" + str(state)) + # Send message received_message = self.can_interface.send(message)