Skip to content

Instantly share code, notes, and snippets.

/irsend-http.py Secret

Created December 24, 2016 19:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/e0e19347e48c581e53f29a1849a5dbd8 to your computer and use it in GitHub Desktop.
Save anonymous/e0e19347e48c581e53f29a1849a5dbd8 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import flask
import subprocess
app = flask.Flask(__name__)
@app.route("/<path:keys>")
def run_commands(keys):
# note that "samsung" should be replaced with the name of your remote
# as per your LIRC configuration.
for key in keys.split("/"):
subprocess.call(["irsend", "SEND_ONCE", "samsung", "KEY_" + key.upper()])
return "OK"
if __name__ == "__main__":
app.run(host = "0.0.0.0")
@JoniiiXD
Copy link

JoniiiXD commented Mar 3, 2017

He !
thanks for this code! But how can i now control my raspi with alexa ? Do you know how it works ?
kind regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment