What's this

I’m going out on a limb here, my guess it’s a oil pressure sending unit for a idiot light.