def read_data(device, num_of_bytes=31):
    """Reads a specified number of bytes from I2C, then parses and
    displays the result. Function is based on AtlasI2C.py read()
    with compact output.

    Returns a compact string of data from the device. e.g. pH:10.468
    """
    data = ""
    raw_data = device.file_read.read(num_of_bytes)
    response = device.get_response(raw_data=raw_data)
    is_valid, error_code = device.response_valid(response=response)

    if is_valid:
        char_list = device.handle_raspi_glitch(response[1:])
        data_string = str("".join(char_list))
        # Remove \x00 padding from data
        data_string = data_string.replace("\x00", "")
        data = f"{device._module}:{data_string}"
    else:
        print(f"Error: {device._module} - {error_code}")
        data = "0"

    return data