Skip to content

Commit e1d3f1a

Browse files
Update showbattery app
1 parent 92905dc commit e1d3f1a

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

internal_filesystem/apps/com.micropythonos.showbattery/META-INF/MANIFEST.JSON

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"publisher": "MicroPythonOS",
44
"short_description": "Minimal app",
55
"long_description": "Demonstrates the simplest app.",
6-
"icon_url": "https://apps.micropythonos.com/apps/com.micropythonos.helloworld/icons/com.micropythonos.helloworld_0.0.3_64x64.png",
7-
"download_url": "https://apps.micropythonos.com/apps/com.micropythonos.helloworld/mpks/com.micropythonos.helloworld_0.0.3.mpk",
6+
"icon_url": "https://apps.micropythonos.com/apps/com.micropythonos.helloworld/icons/com.micropythonos.helloworld_0.1.0_64x64.png",
7+
"download_url": "https://apps.micropythonos.com/apps/com.micropythonos.helloworld/mpks/com.micropythonos.helloworld_0.1.0.mpk",
88
"fullname": "com.micropythonos.showbattery",
9-
"version": "0.0.3",
9+
"version": "0.1.0",
1010
"category": "development",
1111
"activities": [
1212
{
13-
"entrypoint": "assets/hello.py",
14-
"classname": "Hello",
13+
"entrypoint": "assets/show_battery.py",
14+
"classname": "ShowBattery",
1515
"intent_filters": [
1616
{
1717
"action": "main",

internal_filesystem/apps/com.micropythonos.showbattery/assets/hello.py renamed to internal_filesystem/apps/com.micropythonos.showbattery/assets/show_battery.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
import lvgl as lv
4141
import time
4242

43-
from mpos import BatteryManager, Activity
43+
from mpos import Activity, BatteryManager
4444

45-
class Hello(Activity):
45+
class ShowBattery(Activity):
4646

4747
refresh_timer = None
4848

@@ -60,14 +60,12 @@ def onResume(self, screen):
6060
super().onResume(screen)
6161

6262
def update_bat(timer):
63-
#global l
6463
r = BatteryManager.read_raw_adc()
6564
v = BatteryManager.read_battery_voltage()
6665
percent = BatteryManager.get_battery_percentage()
6766
text = f"{time.localtime()}\n{r}\n{v}V\n{percent}%"
68-
#text = f"{time.localtime()}: {r}"
6967
print(text)
70-
self.update_ui_threadsafe_if_foreground(self.raw_label.set_text, text)
68+
self.raw_label.set_text(text)
7169

7270
self.refresh_timer = lv.timer_create(update_bat,1000,None) #.set_repeat_count(10)
7371

0 commit comments

Comments
 (0)