def parse(self, data):
self.validate_packet(data)<EOL>results = self.parse_header_part(data)<EOL>sub_type = results['<STR_LIT>']<EOL>id_ = self.dump_hex(data[<NUM_LIT:4>:<NUM_LIT:8>])<EOL>unit_code = data[<NUM_LIT:8>]<EOL>command = data[<NUM_LIT:9>]<EOL>command_text = SUB_TYPE_COMMANDS.get(sub_type, {}).get(command)<EOL>dim_level = DIM_LEVEL_TO_PERCENT.get(data[<NUM_LIT:10>], '<STR_LIT>')<EOL>sensor_specific = {<EOL>'<STR_LIT:id>': id_,<EOL>'<STR_LIT>': unit_code,<EOL>'<STR_LIT>': command,<EOL>'<STR_LIT>': command_text,<EOL>'<STR_LIT>': dim_level<EOL>}<EOL>results.update(RfxPacketUtils.parse_signal_upper(data[<NUM_LIT:11>]))<EOL>results.update(sensor_specific)<EOL>return results<EOL>
Parse a 12 bytes packet in the Lighting2 format and return a
        dictionary containing the data extracted. An example of a return value
        would be:

        .. code-block:: python

            {
                'id': "0x111F342",
                'packet_length': 10,
                'packet_type': 17,
                'packet_type_name': 'Humidity sensors',
                'sequence_number': 19,
                'packet_subtype': 0,
                'packet_subtype_name': "AC",
                'unit_code': 10,
                'command': 1,
                'command_text': "Off",
                'level': 7,
                'signal_level': 9,
            }

        :param data: bytearray to be parsed
        :type data: bytearray

        :return: Data dictionary containing the parsed values
        :rtype: dict