-
-
Save anonymous/e0e19347e48c581e53f29a1849a5dbd8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
He !
thanks for this code! But how can i now control my raspi with alexa ? Do you know how it works ?
kind regards