When I'm on my way back home from somewhere, I want to be able to switch my AC on a few minutes before I arrive at my apartment, probably by using my phone to connect to my Raspberry Pi on my desk which will, in turn, control the AC. The AC is controllable using an infrared remote control. I want the Raspberry Pi to emit the needed signal.
What do I have to buy for the Raspberry Pi to allow it to send the needed signal? Also, I will need something that will allow me to sample the signal sent by the original remote control, so I could tell the Raspberry Pi which signal to send. How do I do that?
Please note that the only programming language I know how to use is Python. If something requires programming in C or something, it's not a good solution to me.