mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
new: added clean shutdown button to the web ui (closes #161)
This commit is contained in:
@ -1,4 +1,8 @@
|
||||
import subprocess
|
||||
import os
|
||||
import logging
|
||||
import time
|
||||
import pwnagotchi.ui.view as view
|
||||
|
||||
version = '1.0.0a'
|
||||
|
||||
@ -46,3 +50,13 @@ def temperature(celsius=True):
|
||||
temp = int(fp.read().strip())
|
||||
c = int(temp / 1000)
|
||||
return c if celsius else ((c * (9 / 5)) + 32)
|
||||
|
||||
|
||||
def shutdown():
|
||||
logging.warning("shutting down ...")
|
||||
if view.ROOT:
|
||||
view.ROOT.on_shutdown()
|
||||
# give it some time to refresh the ui
|
||||
time.sleep(5)
|
||||
os.system("sync")
|
||||
os.system("halt")
|
||||
|
Reference in New Issue
Block a user