From e1d3f1a279cd18a78dcf1a522b28bde96f2dc8a9 Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Sun, 25 Jan 2026 23:52:05 +0100 Subject: [PATCH] Update showbattery app --- .../META-INF/MANIFEST.JSON | 10 +++++----- .../assets/{hello.py => show_battery.py} | 8 +++----- 2 files changed, 8 insertions(+), 10 deletions(-) rename internal_filesystem/apps/com.micropythonos.showbattery/assets/{hello.py => show_battery.py} (88%) diff --git a/internal_filesystem/apps/com.micropythonos.showbattery/META-INF/MANIFEST.JSON b/internal_filesystem/apps/com.micropythonos.showbattery/META-INF/MANIFEST.JSON index bc91e470..f1bb6d43 100644 --- a/internal_filesystem/apps/com.micropythonos.showbattery/META-INF/MANIFEST.JSON +++ b/internal_filesystem/apps/com.micropythonos.showbattery/META-INF/MANIFEST.JSON @@ -3,15 +3,15 @@ "publisher": "MicroPythonOS", "short_description": "Minimal app", "long_description": "Demonstrates the simplest app.", -"icon_url": "https://apps.micropythonos.com/apps/com.micropythonos.helloworld/icons/com.micropythonos.helloworld_0.0.3_64x64.png", -"download_url": "https://apps.micropythonos.com/apps/com.micropythonos.helloworld/mpks/com.micropythonos.helloworld_0.0.3.mpk", +"icon_url": "https://apps.micropythonos.com/apps/com.micropythonos.helloworld/icons/com.micropythonos.helloworld_0.1.0_64x64.png", +"download_url": "https://apps.micropythonos.com/apps/com.micropythonos.helloworld/mpks/com.micropythonos.helloworld_0.1.0.mpk", "fullname": "com.micropythonos.showbattery", -"version": "0.0.3", +"version": "0.1.0", "category": "development", "activities": [ { - "entrypoint": "assets/hello.py", - "classname": "Hello", + "entrypoint": "assets/show_battery.py", + "classname": "ShowBattery", "intent_filters": [ { "action": "main", diff --git a/internal_filesystem/apps/com.micropythonos.showbattery/assets/hello.py b/internal_filesystem/apps/com.micropythonos.showbattery/assets/show_battery.py similarity index 88% rename from internal_filesystem/apps/com.micropythonos.showbattery/assets/hello.py rename to internal_filesystem/apps/com.micropythonos.showbattery/assets/show_battery.py index a9622ba8..cc4b92a4 100644 --- a/internal_filesystem/apps/com.micropythonos.showbattery/assets/hello.py +++ b/internal_filesystem/apps/com.micropythonos.showbattery/assets/show_battery.py @@ -40,9 +40,9 @@ battery power: import lvgl as lv import time -from mpos import BatteryManager, Activity +from mpos import Activity, BatteryManager -class Hello(Activity): +class ShowBattery(Activity): refresh_timer = None @@ -60,14 +60,12 @@ class Hello(Activity): super().onResume(screen) def update_bat(timer): - #global l r = BatteryManager.read_raw_adc() v = BatteryManager.read_battery_voltage() percent = BatteryManager.get_battery_percentage() text = f"{time.localtime()}\n{r}\n{v}V\n{percent}%" - #text = f"{time.localtime()}: {r}" print(text) - self.update_ui_threadsafe_if_foreground(self.raw_label.set_text, text) + self.raw_label.set_text(text) self.refresh_timer = lv.timer_create(update_bat,1000,None) #.set_repeat_count(10)