@staticmethod<EOL><INDENT>def create_from_response_pdu(resp_pdu, req_pdu):<DEDENT>
read_discrete_inputs = ReadDiscreteInputs()<EOL>read_discrete_inputs.quantity = struct.unpack('<STR_LIT>', req_pdu[-<NUM_LIT:2>:])[<NUM_LIT:0>]<EOL>byte_count = struct.unpack('<STR_LIT>', resp_pdu[<NUM_LIT:1>:<NUM_LIT:2>])[<NUM_LIT:0>]<EOL>fmt = '<STR_LIT:>>' + ('<STR_LIT:B>' * byte_count)<EOL>bytes_ = struct.unpack(fmt, resp_pdu[<NUM_LIT:2>:])<EOL>data = list()<EOL>for i, value in enumerate(bytes_):<EOL><INDENT>padding = <NUM_LIT:8> if (read_discrete_inputs.quantity - (<NUM_LIT:8> * i)) // <NUM_LIT:8> > <NUM_LIT:0>else read_discrete_inputs.quantity % <NUM_LIT:8><EOL>fmt = '<STR_LIT>'.format(padding=padding)<EOL>data = data + [int(i) for i in fmt.format(value)][::-<NUM_LIT:1>]<EOL><DEDENT>read_discrete_inputs.data = data<EOL>return read_discrete_inputs<EOL>
Create instance from response PDU.

        Response PDU is required together with the quantity of inputs read.

        :param resp_pdu: Byte array with request PDU.
        :param quantity: Number of inputs read.
        :return: Instance of :class:`ReadDiscreteInputs`.