It appears that the body presence detector is using up quite a bit of battery life. Is it possible to deactivate it when not required and then only turn it on when required to determine if the person is wearing it?
The API doesnt appear to have a deactivate command.
Thanks,
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.
It really shouldn't be. The onreading event should only be called when the state changes, but I guess it's always running in the background, so that may have an impact.
Anyway, all sensors should support the stop() method, you could try using that when the display is off, then start() when the display is on.
import { display } from "display";
display.addEventListener("change", function() {
if (display.on) {
// start
} else {
// stop
}
})
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.
It really shouldn't be. The onreading event should only be called when the state changes, but I guess it's always running in the background, so that may have an impact.
Anyway, all sensors should support the stop() method, you could try using that when the display is off, then start() when the display is on.
import { display } from "display";
display.addEventListener("change", function() {
if (display.on) {
// start
} else {
// stop
}
})