Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds reboot button #155

Open
wants to merge 1 commit into
base: rpi3_32bit_omxplayer
Choose a base branch
from
Open
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
16 changes: 16 additions & 0 deletions flask/Server.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,18 @@ def get(self):
return jsonify({'response': 500, 'description': 'not ok!'})


class Reboot(Resource):
def get(self):
logging.warning(
"Reboot has been called! There will be no response from this call!"
)
try:
os.system("echo b > /sysrq")
except Exception as e:
return jsonify(
{"response": 500, "error": "Something went wrong with reboot"}
)

# URLs / routes defined here

api.add_resource(GetTrackList, '/get-track-list')
Expand All @@ -527,6 +539,10 @@ def get(self):
api.add_resource(ScentRoomTrigger, '/scentroom-trigger') # POST
api.add_resource(ScentRoomIdle, '/scentroom-idle') # GET

# Admin endpoint

api.add_resource(Reboot, '/reboot') # GET


def appFactory():
"""
Expand Down
2 changes: 1 addition & 1 deletion flask/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
<link rel="stylesheet" href="styles.a8a70ed607d8d0a15839.css"></head>
<body>
<app-root></app-root>
<script type="text/javascript" src="runtime.a66f828dca56eeb90e02.js"></script><script type="text/javascript" src="polyfills.983148f0e85686d18cbf.js"></script><script type="text/javascript" src="main.bb9f6d348b5fea0437e7.js"></script></body>
<script type="text/javascript" src="runtime.a66f828dca56eeb90e02.js"></script><script type="text/javascript" src="polyfills.983148f0e85686d18cbf.js"></script><script type="text/javascript" src="main.9fba95fc9e4a04143879.js"></script></body>
</html>
1 change: 1 addition & 0 deletions flask/static/main.9fba95fc9e4a04143879.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion flask/static/main.bb9f6d348b5fea0437e7.js

This file was deleted.