With the Pebble watch battery life being so great, having battery status for the phone the watch is linked to might be more useful for a watch face.
Is there a method of accessing that?
With the Pebble watch battery life being so great, having battery status for the phone the watch is linked to might be more useful for a watch face.
Is there a method of accessing that?
Watchapps/watchfaces have access to the phone through the official Pebble app using Pebblekit JS. (PebbleKit JS // Pebble Developers)
The only three things explicitly allowed are internet access, geolocation, and localStorage.
Getting other phone information could be possible in a future update, but there is not currently a method of accessing things like phone battery level, phone sensor data, etc.
(A convoluted theoretical work-around would be for the user to have another app on their phone that publishes the wanted data to a webserver, then have the watchapp request that data from the webserver. This could be something like a private HomeAssistant instance.)
Since my phone is either in my pocket or backpack, I created a IFTTT applet so that if my phone battery is critically low, a notification is sent to my PT.
Coming soon™ as part of some cool new features
I used Automate to send my phone battery level to one of my personal websites and I read it from there.
Looking forward to it being supported directly.
This would be great! Checking phone battery and cell/wifi strength are major reasons I pull my phone out of my pocket.
You can get the phone battery level through the Navigator.getBattery API in your PebbleKit JS: Navigator: getBattery() method - Web APIs | MDN
This may not be supported on all phones, and older phones might only support the navigator.battery API. But it works on my watchface GitHub - drod0258/BigInfoPebble: A simple, easy to read Pebble watchface. · GitHub with a Pixel 7 phone.
No support on iOS, but should work on Android
Probably should warn - that API is unsupported and could go away if we change the PKJS runner implementation away from WebView on Android. I’m hoping a real API will be available before too long (working on it now, but it’s a big one).