So Hermione had set up the party there, hoping its link to Harry would draw his spirit. It didn't work, obviously, but it did draw Neville Longbottom. He transformed himself into his Animagus shape ... a dragonfly ... and hid in a lampshade to watch proceedings and report back to Harry on how Hermione was doing.