Skip to content

Commit

Permalink
Merge pull request #9 from zeripath/per-remote-templates
Browse files Browse the repository at this point in the history
Allow per-remote templates
  • Loading branch information
slimjim777 committed Dec 15, 2018
2 parents 1b179db + 7b25d8d commit 3bcc5ca
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions remote.py
Expand Up @@ -4,11 +4,12 @@
from lirc.lirc import Lirc
from flask import Flask
from flask import render_template
from flask import request, redirect, url_for
# from flask import request, redirect, url_for

BASE_URL = ''

app = Flask(__name__)
app.config['TEMPLATES_AUTO_RELOAD'] = True

# Initialise the Lirc config parser
lircParse = Lirc('/etc/lirc/lircd.conf')
Expand Down Expand Up @@ -36,7 +37,8 @@ def device(device_id=None):
'id': device_id,
'codes': codes,
}
return render_template('control.html', d=d)
return render_template(
["control_" + device_id.lower() + ".html", "control.html"], d=d)


@app.route("/device/<device_id>/clicked/<op>")
Expand All @@ -47,7 +49,6 @@ def clicked(device_id=None, op=None):
return ""



if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--ipaddr',
Expand Down

0 comments on commit 3bcc5ca

Please sign in to comment.