You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Great! Yes, I'd say that looks good.

    I guess what might be happening is the widget gets Bangle.on('lcdPower' called before the multiclock face is called, so it's not turned on then. You could add a little delay to it?

    Bangle.on('lcdPower', function(on) {
        if (on) {
          setTimeout(function() { WIDGETS.gps.draw(); }, 100); // <-- here
          if (!timerInterval) timerInterval = setInterval(()=>WIDGETS["gps"].draw(), 2000);
        } else {
          if (timerInterval) {
            clearInterval(timerInterval);
            timerInterval = undefined;
          }
        }
      });
    

    or you could just overwrite the function when the widget is loaded so you respond immediately:

    Bangle._setGPSPower = Bangle.setGPSPower;
    Bangle.setGPSPower = function(on,appid) {
      Bangle._setGPSPower(op,appid);
      WIDGETS["gps"].draw();
    };
    
About

Avatar for Gordon @Gordon started