def build(self):
data_length = len(self.data)<EOL>ords = [<NUM_LIT>, (data_length >> <NUM_LIT:8>) & <NUM_LIT>, data_length & <NUM_LIT>, len(self.optional), int(self.packet_type)]<EOL>ords.append(crc8.calc(ords[<NUM_LIT:1>:<NUM_LIT:5>]))<EOL>ords.extend(self.data)<EOL>ords.extend(self.optional)<EOL>ords.append(crc8.calc(ords[<NUM_LIT:6>:]))<EOL>return ords<EOL>
Build Packet for sending to EnOcean controller