Android TV Remote to turn off light

I use a keyboard remote with my Nvidia Shield Android TV and want to use a spare key to turn off the lights. My light is connected to Home Assistant and my Shield is on the same network. Is there a key mapper for android that can map a keypress to a POST request? Or some way to toggle a switch in Home Assistant?