mqtt/pdu.py
def encode(self):
        '''
        Encode and store an UNSUBACK control packet
        '''
        header    = bytearray(1)
        varHeader = encode16Int(self.msgId)
        header[0] = 0xB0 
        header.extend(encodeLength(len(varHeader)))
        header.extend(varHeader)
        self.encoded = header
        return str(header) if PY2 else bytes(header)
def encode(self):
        '''
        Encode and store an UNSUBACK control packet
        '''
        header    = bytearray(1)
        varHeader = encode16Int(self.msgId)
        header[0] = 0xB0 
        header.extend(encodeLength(len(varHeader)))
        header.extend(varHeader)
        self.encoded = header
        return str(header) if PY2 else bytes(header)
Encode and store an UNSUBACK control packet