Fix poweroff button

This commit is contained in:
Thomas Farstrike
2025-07-07 17:05:52 +02:00
parent 8102a74084
commit 5b7b21a84f
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -5,6 +5,7 @@
- Settings: add Timezone configuration
- Draw: new app for simple drawing on a canvas
- IMU: new app for showing data from the Intertial Measurement Unit ("Accellerometer")
- Speed up QR decoding 4x - thanks @kdmukai!
0.0.8
+2 -1
View File
@@ -301,6 +301,7 @@ def create_drawer(display=None):
restart_label.set_text(lv.SYMBOL.REFRESH+" Reset")
restart_label.center()
def reset_cb(e):
mpos.ui.remove_and_stop_current_activity() # make sure current app, like camera, does cleanup, saves progress, stops hardware etc.
import machine
if hasattr(machine, 'reset'):
machine.reset()
@@ -317,7 +318,7 @@ def create_drawer(display=None):
poweroff_label.center()
def poweroff_cb(e):
print("Power off action...")
remove_and_stop_current_activity() # make sure current app, like camera, does cleanup, saves progress, stops hardware etc.
mpos.ui.remove_and_stop_current_activity() # make sure current app, like camera, does cleanup, saves progress, stops hardware etc.
import sys
if sys.platform == "esp32":
#On ESP32, there's no power off but there is a forever sleep