From 1a39a64979b4b97dd34c962b5f4ed0d15ebe98c3 Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Wed, 21 Jan 2026 13:32:51 +0100 Subject: [PATCH] OSUpdate: simplify --- .../com.micropythonos.osupdate/assets/osupdate.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/internal_filesystem/builtin/apps/com.micropythonos.osupdate/assets/osupdate.py b/internal_filesystem/builtin/apps/com.micropythonos.osupdate/assets/osupdate.py index 03f8ce1e..86018e1a 100644 --- a/internal_filesystem/builtin/apps/com.micropythonos.osupdate/assets/osupdate.py +++ b/internal_filesystem/builtin/apps/com.micropythonos.osupdate/assets/osupdate.py @@ -133,12 +133,12 @@ class OSUpdate(Activity): if self.current_state == UpdateState.IDLE or self.current_state == UpdateState.WAITING_WIFI: # Was waiting for network, now can check for updates self.set_state(UpdateState.CHECKING_UPDATE) - self.schedule_show_update_info() + self.show_update_info() elif self.current_state == UpdateState.ERROR: # Was in error state (possibly network error), retry now that network is back print("OSUpdate: Retrying update check after network came back online") self.set_state(UpdateState.CHECKING_UPDATE) - self.schedule_show_update_info() + self.show_update_info() elif self.current_state == UpdateState.DOWNLOAD_PAUSED: # Download was paused, will auto-resume in download thread pass @@ -181,15 +181,6 @@ class OSUpdate(Activity): else: return f"An error occurred:\n{str(error)}\n\nPlease try again." - # Show update info with a delay, to ensure ordering of multiple lv.async_call() - def schedule_show_update_info(self): - # Create async task for show_update_info with a delay - async def delayed_show_update_info(): - await TaskManager.sleep_ms(150) - await self.show_update_info() - - TaskManager.create_task(delayed_show_update_info()) - async def show_update_info(self): hwid = mpos.info.get_hardware_id() @@ -277,7 +268,7 @@ class OSUpdate(Activity): print("OSUpdate: Check Again button clicked") self.check_again_button.add_flag(lv.obj.FLAG.HIDDEN) self.set_state(UpdateState.CHECKING_UPDATE) - self.schedule_show_update_info() + self.show_update_info() async def async_progress_callback(self, percent): """Async progress callback for DownloadManager.