Avatar for rigrig

rigrig

Member since Apr 2020 • Last active Jan 2022
  • 3 conversations
  • 62 comments

Most recent activity

  • in Bangle.js
    Avatar for rigrig

    I'm all for it, now that the GitHub pages thing keeps working for newcomers.

    Much tidier, less merge conflicts, plus we get an excuse to play with new and exiting ways to make apps.json automagically update in other scenarios ;-)

  • in Bangle.js
    Avatar for rigrig

    I guess you could hijack the setGPSPower function:

    Bangle.setGPSPower=((gps)=>((on,app)=>{
        const old = Bangle.isGPSOn();
        gps.apply(Bangle, arguments);
        const now = Bangle.isGPSOn();
        if (old!==now) Bangle.emit('power', 'GPS', now, app);
    }))(Bangle.setGPSPower)
    
    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.

  • in Bangle.js
    Avatar for rigrig

    Did that actually work? Because as far as I can tell, loadWidgets doesn't look at the .info file, just at the sortorder defined inside the widget code.

    (Also, editing the code to change widget order seems suboptimal, so I made a widget editor)

  • in Bangle.js
    Avatar for rigrig

    if you need to specify something best to just stick a sortorder in apps.json

    I think you want to put it in the widget code instead: the apps.json affects the order in the App Loader page, but loadWidgets() looks at the widget.

    So something like

    WIDGETS["lock"]={area:"tl",sortorder:-1,­width:Bangle.isLocked()?16:0,...
    
  • in Bangle.js
    Avatar for rigrig

    Yeah, the app loader doesn't connect to the emulator: it opens the IDE and tells it to load the app.js code.
    So it only works for apps that simply run a single file without needing any other files, otherwise it's better to disable allow_emulator.

    You can get more complex apps to work by manually uploading all parts to the emulator, which can be worth the effort for testing/screenshotting.

    (And yes, having the App Loader open the emulator directly would be nice.)

  • in Bangle.js
    Avatar for rigrig

    This looks pretty neat, have you considered making it into a customizable app?

    • 4 comments
    • 200 views
  • in Bangle.js
    Avatar for rigrig

    What firmware version were you using at the time?

    I'm 90% sure some 2v11 from a while back...

    I just tried the code you posted here on an up to date Bangle and it seems to work fine for me

    Maybe it could have something to do with my earlier testing? I think messages.json already contained a bunch of largeish messages, could Storage loading those, adding more, and then writing back to the same file break things?

    I'll try to remember to document errors a bit more if it ever happens again, instead of just going whoops-reflash.

  • in Bangle.js
    Avatar for rigrig

    I was fiddling with the messages app, and to test things I foolishly dumped this all at once into the IDE left side (i.e. gave it a ton of messages to process and append to messages.json):

    function test(src){GB({"t":"notify","id":src+'-te­st',"src":src,"title":"Test","body":src+­" test message."});}
    ["calendar", "mail", "music", "phone", "sms message"].forEach(test);
    ["facebook", "gmail", "google home", "hangouts", "instagram", "messenger", "outlook mail", "skype", "slack", "telegram", "twitter", "whatsapp", "wordfeud"].forEach(test);
    

    I guess I shouldn't be surprised that Things went Wrong, but somehow it even managed to trash the storage bad enough that it wouldn't boot anymore and I had to reflash the firmware. (using the IDE Storage button definitely listed corrupted file names)
    I'm just wondering if that should be possible? (and if not, I guess this might be a way to reproduce it, haven't tried it again...)

    (After reflashing, the watch detected that my storage was corrupt and properly wiped everything back to factory settings, so that went pretty smooth :-)

Actions