Hi guys,
I am building a clock face and am finding that when the Fitbit app is open on my phone, the Fitbit device drains extremely quickly. When the phone app is closed, the device drains at a more stable 1% per hour.
The basis of my code is from a previous post that uses setTimout to call a function when the screen is on.
Any thoughts on how to limit the Fitbit watch power drain when the phone app is open?
import { display } from "display";
let timeoutID;
display.addEventListener("change", function() {
if (display.on) {
wake();
} else {
sleep();
}
})
function wake() {
// do something when the screen wakes
// also, cancel the timeout if it's still scheduled
clearTimeout(timeoutID);
}
function sleep() {
// do something when the screen sleeps
// here you can calculate when you need to wake up
let delayMilliseconds = 30 * 60 * 1000; // 30 minutes
timeoutID = setTimeout(doSomething, delayMilliseconds);
}
function doSomething() {
// do this even when the screen is still off
}
Answered! Go to the Best Answer.
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
If you have the developer bridge enabled, then you're using WiFi and that will drain the battery.
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.