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:6>])<EOL>rain_rate_high = data[<NUM_LIT:6>]<EOL>rain_rate_low = data[<NUM_LIT:7>]<EOL>if sub_type == <NUM_LIT>:<EOL><INDENT>rain_rate = rain_rate_high * <NUM_LIT> + rain_rate_low<EOL><DEDENT>elif sub_type == <NUM_LIT>:<EOL><INDENT>rain_rate = float(rain_rate_high * <NUM_LIT> + rain_rate_low) / <NUM_LIT:100><EOL><DEDENT>else:<EOL><INDENT>rain_rate = '<STR_LIT>'<EOL><DEDENT>rain_total1 = data[<NUM_LIT:8>]<EOL>rain_total2 = data[<NUM_LIT:9>]<EOL>rain_total3 = data[<NUM_LIT:10>]<EOL>if sub_type != <NUM_LIT>:<EOL><INDENT>rain_total = float(<EOL>rain_total1 * <NUM_LIT> + rain_total2 * <NUM_LIT> + rain_total3) / <NUM_LIT:10><EOL><DEDENT>else:<EOL><INDENT>rain_total = '<STR_LIT>'<EOL><DEDENT>sensor_specific = {<EOL>'<STR_LIT:id>': id_<EOL>}<EOL>if rain_rate != '<STR_LIT>':<EOL><INDENT>sensor_specific['<STR_LIT>'] = rain_rate<EOL><DEDENT>if rain_total != '<STR_LIT>':<EOL><INDENT>sensor_specific['<STR_LIT>'] = rain_total<EOL><DEDENT>results.update(RfxPacketUtils.parse_signal_and_battery(data[<NUM_LIT:11>]))<EOL>results.update(sensor_specific)<EOL>return results<EOL>
Parse a 12 bytes packet in the Rain format and return a
        dictionary containing the data extracted. An example of a return value
        would be:

        .. code-block:: python

            {
                'id': "0x2EB2",
                'packet_length': 11,
                'packet_type': 85,
                'packet_type_name': 'Rain sensors',
                'sequence_number': 0,
                'packet_subtype': 1,
                'packet_subtype_name': "RGR126/682/918",
                'rain_rate': 5,
                'rain_total': 130.0,
                'signal_level': 9,
                'battery_level': 6,
            }

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

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