Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions hackeriet/web/brusweb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ def admin():
return render_template('admin.html', username=user,
users=members.list_users())

@app.route("/brus/door/hackeriet/open", methods=['POST'])
@requires_auth
def open_door():
user=request.authorization.username
signature='%s (brusweb)' % user
mqtt('hackeriet/door/hackeriet/open', signature)
return 'Door triggered'

@app.route("/brus/admin/add", methods=['POST'])
@requires_admin
def admin_add():
Expand Down
7 changes: 7 additions & 0 deletions hackeriet/web/brusweb/templates/account.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
<body>
<h1>Hei {{username}}!</h1>
<a href="https://logg:[email protected]/brus/account">Logg ut</a>.

<h2>Vil du åpne døra?</h2>

<form action="/brus/door/hackeriet/open" method="post">
<input type="submit" name="btn_opendoor" value="Trigger Hackeriet door lock">
</form>

<h2>Din saldo er: {{balance}}</h2>

<h2>Fyll på spenn</h2>
Expand Down