Alessandro
Member since Oct 2021 • Last active Jan 2023Most recent activity
-
-
-
- 6 comments
- 1,166 views
-
I updated the
renderTopBar()
method to draw the "widgets" only if its value has been changed but there's something wrong. Last night battery drop from 70% to 30% :-(let prevLocked = undefined; let prevConnected = undefined; function renderTopBar() { const itemW = 10; const itemH = 2; let locked = Bangle.isLocked(); if (locked != prevLocked) { const lockColor = locked ? g.theme.fg : g.theme.bg; g.setColor(lockColor).fillRect(0, 0, itemW, itemH).setColor(g.theme.fg); prevLocked = locked; } let connected = NRF.getSecurityStatus().connected; if (connected != prevConnected) { const bluetoothColor = connected ? (g.theme.dark ? "#0ff" : "#00f") : (g.theme.dark ? "#666" : "#999"); g.setColor(bluetoothColor).fillRect(itemW + 1, 0, 1 + itemW * 2, itemH).setColor(g.theme.fg); prevConnected = connected; } } Bangle.on("lock", b => { renderTopBar(); }); NRF.on("connect", () => { renderTopBar(); }); NRF.on("disconnect", () => { renderTopBar(); });
Am I missing anything else?
-
Not sure if ClockFace and Layout libs do that automatically because I'm currently not using them, but are you drawing the screen every minute or so?
Yes, I configured Clockface with a "precision" of 60 seconds.
If you draw the screen every cycle, it may be the reason.
Damn, I didn't notice I forgot to redraw my topbar only if something changed .-. I'll fix asap!
Thanks!
-
Hello!
Lately I have little free time but I am trying to work on my own clock using ClockFace and Layout libs.
My goals are:
- fullscreen (no widgets)
- only show date + time + steps
- custom "widgets" in the top bar
- battery status in the bottom bar
After I added the top bar I noticed a HUGE battery drain (30-40% per day!) but I don't undestand why.
What's wrong with my code?The code is in my fork: https://github.com/alessandrococco/BangleApps/blob/poc-my-clock/apps/patclock/app.js
Thank you! :-)
- fullscreen (no widgets)
-
-
I recently bought a cheap nylon strap https://www.amazon.it/dp/B09Q62CLXV
It's more comfortable than the silicone one.
Thank you :)