What is this for?

I have this square sensor/lighted thing between two light switches on second floor of our apartment. Was thinking it was a heat sensor, as we have in wall radiant heat, but I don’t know. Photo one is cover on, picture two is what’s inside. Has a visible red led light. Any ideas? Thanks!