• I guess you could hijack the setGPSPower function:

        const old = Bangle.isGPSOn();
        gps.apply(Bangle, arguments);
        const now = Bangle.isGPSOn();
        if (old!==now) Bangle.emit('power', 'GPS', now, app);
    Bangle.on('power', (what, on, app) => console.log(`${what} turned ${on ? 'on' : 'off'} ${app ? 'by '+app : ''}`));

    Edit: but yes, built-in events would be nice.

  • @rigrig I don't intend to do anything like that anytime soon, BUT I really liked the concept here, thanks for the idea in general.


Avatar for rigrig @rigrig started