That’s what I thought, too, but it turns out to be a proximity sensor:
I suppose having no exposed switch contacts in there counts as a win, but I definitely did not expect that!