You are reading a single comment by @!evil and its replies. Click here to read the full conversation.
  • Hi,

    I was using https://banglejs.com/apps/?id=health for a day until I realized that it doesn't stop HRM when I stop wearing it at night.

    see edit below
    Regarding Bangle.getHealthStatus().movement > 146: from the docs,
    movement is the sum of diffs, so you can't just use a constant
    threshold. And as Gordon pointed out, it only resets every 10min.

    Anyways, Bangle.js already detects movement for powerSave option and for me this would be sufficient. The following proof-of-concept works well enough for me:

    function is_worn() {
        return new Promise(function(resolve, reject) {
            var i = 0;
            function on_accel(a) { i++; }
            Bangle.on('accel', on_accel);
            setTimeout(function() {
                Bangle.removeListener('accel', on_accel);
                resolve(1 < i);
            }, 3*80);
        });
    }
    

    I didn't find a way to get the current power state/poll interval/"hasn't moved". Is there?

    edit: I was wrong, acceleration diffs are unsigned, sry

About

Avatar for !evil @!evil started