Index: dialin/common/msg_ids.py =================================================================== diff -u -r70647af995e01166cc59996470e2554e2f54b378 -r4bd0d881b01877bf5200ebbb9eda7dfc040ee702 --- dialin/common/msg_ids.py (.../msg_ids.py) (revision 70647af995e01166cc59996470e2554e2f54b378) +++ dialin/common/msg_ids.py (.../msg_ids.py) (revision 4bd0d881b01877bf5200ebbb9eda7dfc040ee702) @@ -217,6 +217,7 @@ MSG_ID_DG_START_STOP_CHEM_DISINFECT_FLUSH = 0xC2 MSG_ID_UI_CHEM_DISINFECT_FLUSH_CONFIRM = 0xC3 MSG_ID_HD_CHEM_DISINFECT_FLUSH_CONFIRM_RESPONSE = 0xC4 + MSG_ID_HD_AIR_PUMP_DATA = 0xC7 MSG_ID_CAN_ERROR_COUNT = 0x999 Index: dialin/hd/air_pump.py =================================================================== diff -u -r95c9212e8ea98f30b4c16f50d7834aa6575c4657 -r4bd0d881b01877bf5200ebbb9eda7dfc040ee702 --- dialin/hd/air_pump.py (.../air_pump.py) (revision 95c9212e8ea98f30b4c16f50d7834aa6575c4657) +++ dialin/hd/air_pump.py (.../air_pump.py) (revision 4bd0d881b01877bf5200ebbb9eda7dfc040ee702) @@ -37,7 +37,7 @@ if self.can_interface is not None: channel_id = DenaliChannels.hd_sync_broadcast_ch_id - msg_id = MsgIds.MSG_ID_HD_AIR_TRAP_DATA.value + msg_id = MsgIds.MSG_ID_HD_AIR_PUMP_DATA.value self.can_interface.register_receiving_publication_function(channel_id, msg_id, self._handler_air_pump_sync) @@ -46,22 +46,24 @@ def get_air_pump_state(self): return self.air_pump_state + @publish(["air_pump_state"]) def _handler_air_pump_sync(self, message): """ Handles published air pump data messages. @param message: published air pump data message as: air pump state @return: None """ - self.air_pump_state = struct.unpack(' int: + self.air_pump_state = aps[0] + + def cmd_air_pump_set_state(self, state: int) -> int: """ - Constructs and sends the air pump level sensor override command + Constructs and sends the air pump set state command. Constraints: Must be logged into HD. - Given sensor must be one of the sensors listed below. """ @@ -72,7 +74,7 @@ message_id=MsgIds.MSG_ID_HD_AIR_PUMP_SET_STATE.value, payload=payload) - self.logger.debug("override air pump level sensor detection value for sensor " + str(state)) + self.logger.debug("setting air pump state to" + str(state)) # Send message received_message = self.can_interface.send(message)