def decode_packet(self, packet_2):
    self.packet_2_error = False
    self.previous_malfunction = self.malfunction
    self.malfunction = False
    self.packet_2_dictionary['1Header2'] = packet_2[0:4]
    self.packet_2_dictionary['2Mode2'] = packet_2[4:6]
    self.packet_2_dictionary['3Filler2a'] = packet_2[6:8]
    self.packet_2_dictionary['4SetTemp2'] = packet_2[8:10]
    self.packet_2_dictionary['5Fan2'] = packet_2[10:12]
    self.previous_actual_temperature = self.packet_2_dictionary['6ActualTemp2']
    self.packet_2_dictionary['6ActualTemp2'] = packet_2[12:14]
    self.packet_2_dictionary['7Filler2b'] = packet_2[14:16]
    self.packet_2_dictionary['8Unknown2'] = packet_2[16:18]
    self.packet_2_dictionary['9Alerts2'] = packet_2[18:20]
    self.packet_2_dictionary['10Filler2c'] = packet_2[20:24]
    self.packet_2_dictionary['11Compressor2'] = packet_2[24:26]
    self.packet_2_dictionary['12Filler2c'] = packet_2[26:30]
    self.packet_2_dictionary['13Checksum2'] = packet_2[30:32]
    packet_no_checksum = packet_2[0:30]
    checksum = self.calculate_checksum(packet_no_checksum)
    if (self.packet_2_dictionary['11Compressor2'] == self.compressor_state['On']):
        if (self.compressor == False):
            self.compressor = True
            self.update_status()
    if (self.packet_2_dictionary['11Compressor2'] == self.compressor_state['Off']):
        if (self.compressor == True):
            self.compressor = False
            self.update_status()
    if ((self.packet_2_dictionary['9Alerts2'] == self.alerts['Warmup'][0]) or (self.packet_2_dictionary['9Alerts2'] == self.alerts['Warmup'][1])):
        if (self.heating == False):
            self.heating = True
            self.update_status()
    if ((self.packet_2_dictionary['9Alerts2'] == self.alerts['Not in Warmup'][0]) or (self.packet_2_dictionary['9Alerts2'] == self.alerts['Not in Warmup'][1])):
        if (self.heating == True):
            self.heating = False
            self.update_status()
    if ((self.packet_2_dictionary['9Alerts2'] == self.alerts['Clean Filter'][0]) or (self.packet_2_dictionary['9Alerts2'] == self.alerts['Clean Filter'][1])):
        if (self.filter == False):
            self.filter = True
            self.print_status('Filter Clean Alert Active on ')
            self.update_status()
    if ((self.packet_2_dictionary['9Alerts2'] == self.alerts['Filter OK'][0]) or (self.packet_2_dictionary['9Alerts2'] == self.alerts['Filter OK'][1])):
        if (self.filter == True):
            self.filter = False
            self.print_status('Filter Clean Alert Reset on ')
            self.update_status()
    if (self.packet_2_dictionary['8Unknown2'] != 'e0'):
        self.print_status('Unknown Byte 8 of Packet 2 ')
        print('Expected e0 but received ', self.packet_2_dictionary['8Unknown2'])
    if (checksum != self.packet_2_dictionary['13Checksum2']):
        print('Packet 2 Checksum Error. Expected ', checksum, ' Received ', self.packet_2_dictionary['13Checksum2'])
        self.packet_2_error = True
        self.malfunction = True
    if (packet_2[4:12] != self.packet_1_with_checksum[4:12]):
        print('Mismatch between Packets 1 and 2. Expected ', self.packet_1_with_checksum[4:12], ' but received ', packet_2[4:12])
    if (self.malfunction != self.previous_malfunction):
        self.update_status()
def decode_packet(self, packet_2):
    self.packet_2_error = False
    self.previous_malfunction = self.malfunction
    self.malfunction = False
    self.packet_2_dictionary['1Header2'] = packet_2[0:4]
    self.packet_2_dictionary['2Mode2'] = packet_2[4:6]
    self.packet_2_dictionary['3Filler2a'] = packet_2[6:8]
    self.packet_2_dictionary['4SetTemp2'] = packet_2[8:10]
    self.packet_2_dictionary['5Fan2'] = packet_2[10:12]
    self.previous_actual_temperature = self.packet_2_dictionary['6ActualTemp2']
    self.packet_2_dictionary['6ActualTemp2'] = packet_2[12:14]
    self.packet_2_dictionary['7Filler2b'] = packet_2[14:16]
    self.packet_2_dictionary['8Unknown2'] = packet_2[16:18]
    self.packet_2_dictionary['9Alerts2'] = packet_2[18:20]
    self.packet_2_dictionary['10Filler2c'] = packet_2[20:24]
    self.packet_2_dictionary['11Compressor2'] = packet_2[24:26]
    self.packet_2_dictionary['12Filler2c'] = packet_2[26:30]
    self.packet_2_dictionary['13Checksum2'] = packet_2[30:32]
    packet_no_checksum = packet_2[0:30]
    checksum = self.calculate_checksum(packet_no_checksum)
    if (self.packet_2_dictionary['11Compressor2'] == self.compressor_state['On']):
        if (self.compressor == False):
            self.compressor = True
            self.update_status()
    if (self.packet_2_dictionary['11Compressor2'] == self.compressor_state['Off']):
        if (self.compressor == True):
            self.compressor = False
            self.update_status()
    if ((self.packet_2_dictionary['9Alerts2'] == self.alerts['Warmup'][0]) or (self.packet_2_dictionary['9Alerts2'] == self.alerts['Warmup'][1])):
        if (self.heating == False):
            self.heating = True
            self.update_status()
    if ((self.packet_2_dictionary['9Alerts2'] == self.alerts['Not in Warmup'][0]) or (self.packet_2_dictionary['9Alerts2'] == self.alerts['Not in Warmup'][1])):
        if (self.heating == True):
            self.heating = False
            self.update_status()
    if ((self.packet_2_dictionary['9Alerts2'] == self.alerts['Clean Filter'][0]) or (self.packet_2_dictionary['9Alerts2'] == self.alerts['Clean Filter'][1])):
        if (self.filter == False):
            self.filter = True
            self.print_status('Filter Clean Alert Active on ')
            self.update_status()
    if ((self.packet_2_dictionary['9Alerts2'] == self.alerts['Filter OK'][0]) or (self.packet_2_dictionary['9Alerts2'] == self.alerts['Filter OK'][1])):
        if (self.filter == True):
            self.filter = False
            self.print_status('Filter Clean Alert Reset on ')
            self.update_status()
    if (self.packet_2_dictionary['8Unknown2'] != 'e0'):
        self.print_status('Unknown Byte 8 of Packet 2 ')
        print('Expected e0 but received ', self.packet_2_dictionary['8Unknown2'])
    if (checksum != self.packet_2_dictionary['13Checksum2']):
        print('Packet 2 Checksum Error. Expected ', checksum, ' Received ', self.packet_2_dictionary['13Checksum2'])
        self.packet_2_error = True
        self.malfunction = True
    if (packet_2[4:12] != self.packet_1_with_checksum[4:12]):
        print('Mismatch between Packets 1 and 2. Expected ', self.packet_1_with_checksum[4:12], ' but received ', packet_2[4:12])
    if (self.malfunction != self.previous_malfunction):
        self.update_status()