Easy. Plug the port (I keep the caps from new batteries) and you're good to go. Obviously don't drown the bastard, but I've experimented with some damaged ones and they've worked flawlessly after a good wash.
That kinda what I do, put all the stuff in a small box (with holes drilled under it to allow liquid to drain), and let it wash for a good while, while I clean and recabled the bike.
TBH, Di2 is that easy to sort out, I do like servicing bicycle with Di2 as all I need to do is diagnostic it and make sure it's updated.
The only thing I dislike about Di2 is that I can't exactly put the derailleurs in the part washer...