def read_sensor_package(bytes_serial):
    """
    Read a sensor from serial bytes. Expected format is 5 bytes:
        1, 2 : Package start 0x59 for YY
        3 : unsigned integer for sensor index
        4, 5 : unsigned integer for reading
    :return:
        sensor_index, reading
    """

    if bytes_serial[0] == 0x59 and bytes_serial[1] == 0x59:  # check for 'YY'
        # print(bytes_serial)
        sensor_index = bytes_serial[2]  # sensor index
        reading = bytes_serial[4] + bytes_serial[3] * 256  # 2 bytes for reading
        return sensor_index, reading
    else:
        return -1, None