def parse(self, data):
        """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
        """

        self.validate_packet(data)

        results = self.parse_header_part(data)
        sub_type = results['packet_subtype']

        id_ = self.dump_hex(data[4:6])

        rain_rate_high = data[6]
        rain_rate_low = data[7]
        if sub_type == 0x01:
            rain_rate = rain_rate_high * 0x100 + rain_rate_low
        elif sub_type == 0x02:
            rain_rate = float(rain_rate_high * 0x100 + rain_rate_low) / 100
        else:
            rain_rate = '--??--'
        rain_total1 = data[8]
        rain_total2 = data[9]
        rain_total3 = data[10]
        if sub_type != 0x06:
            rain_total = float(
                rain_total1 * 0x1000 + rain_total2 * 0x100 + rain_total3) / 10
        else:
            rain_total = '--??--'

        sensor_specific = {
            'id': id_
        }
        if rain_rate != '--??--':
            sensor_specific['rain_rate'] = rain_rate
        if rain_total != '--??--':
            sensor_specific['rain_total'] = rain_total

        results.update(RfxPacketUtils.parse_signal_and_battery(data[11]))
        results.update(sensor_specific)

        return results