def receive_serial_aircon_data(self):
    header_loop_count = 0
    found_packet_2_header = False
    while (header_loop_count < 16):
        test_for_header_1 = self.aircon_comms.read(1)
        if (test_for_header_1 == b'\x80'):
            test_for_header_2 = self.aircon_comms.read(1)
            if (test_for_header_2 == b'\x8c'):
                found_packet_2_header = True
                exit_loop_count = header_loop_count
                header_loop_count = 16
            else:
                header_loop_count += 1
        else:
            header_loop_count += 1
    if (found_packet_2_header == True):
        self.raw_response_1 = self.aircon_comms.read(6)
        self.raw_response_2 = self.aircon_comms.read(8)
        self.raw_response = b''.join([test_for_header_1, test_for_header_2, self.raw_response_1, self.raw_response_2])
        self.packet_2 = str(binascii.hexlify(self.raw_response), 'utf-8')
        self.decode_packet(self.packet_2)
    else:
        print('No valid Packet 2 Header received')
        self.packet_2_error = True
        self.malfunction = True
def receive_serial_aircon_data(self):
    header_loop_count = 0
    found_packet_2_header = False
    while (header_loop_count < 16):
        test_for_header_1 = self.aircon_comms.read(1)
        if (test_for_header_1 == b'\x80'):
            test_for_header_2 = self.aircon_comms.read(1)
            if (test_for_header_2 == b'\x8c'):
                found_packet_2_header = True
                exit_loop_count = header_loop_count
                header_loop_count = 16
            else:
                header_loop_count += 1
        else:
            header_loop_count += 1
    if (found_packet_2_header == True):
        self.raw_response_1 = self.aircon_comms.read(6)
        self.raw_response_2 = self.aircon_comms.read(8)
        self.raw_response = b.join([test_for_header_1, test_for_header_2, self.raw_response_1, self.raw_response_2])
        self.packet_2 = str(binascii.hexlify(self.raw_response), 'utf-8')
        self.decode_packet(self.packet_2)
    else:
        print('No valid Packet 2 Header received')
        self.packet_2_error = True
        self.malfunction = True