-
Some clocks do it like that
var _12hour = (require("Storage").readJSON("setting.json",1)||{})["12hour"]||false;
It reads the 12hour value from the main settings file. If the settings file can not be read it initalizes the value with false.
You can then test in your code if you need to draw a 12 hour or 24 hour value:
if (_12hour){ //do 12 hour stuff } else { //do 24 hour stuff }
-
What does STARTdo? Will have to test...
If you are willing to read into the GB source code, you can find it here: https://codeberg.org/freeyourgadget/gadgetbridge
-
I'm not sure if dialing numbers via GadgetBridge is already supported.
From the documentation https://www.espruino.com/Gadgetbridge it seems there is a notification supported including a telephone number and a message:
t:"notify", id:int, n:"DISMISS,DISMISS_ALL/OPEN/MUTE/REPLY",
if REPLY can use tel:string(optional), msg:stringI don't know though what this triggers, just a message or a phone call.
EDIT: Just tested this: it sends a text message (SMS) to the provided number.What is already support is accepting/rejecting incoming calls using
It is only a matter of integrating it into GadgetBridge.
I guess the question is, how do we deal with all the different GB widget ideas? I got many ideas myself and I am planning on forking my own GB widget to have it customized for my needs and wishes.
-
Ok, short update. I got the c-clip off (luckily it jumped right on my thumb) and removed the button.
Seems like the inner o-ring that seals the button wasn't lubed properly anymore. I lubed it and reassembled it. I also masked the inner buttons with one layer of electrical tape to try to improve the haptic of the button.Seems to work. Hopefully I don't need to redo the lubing regularly.
-
-
-
Just wanted to post my experience here. My BTN2 is acting up lately. It has a strange haptic to it. If I press it firmly to select a clock from the launcher it often brings me back to the launcher right away. Just like it isn't released fast enough or being pressed a second time.
However I can also trigger it by pressing it ever so slightly, but without giving me feedback with a click. I tried lubing the pin, but I guess it is also more a problem of the inner button itself.
EDIT: I disassembled the watch again and the internal buttons seem to work fine. It is indeed the outer button that is being stuck/stiff sometimes. Does anyone have a tip how to remove (and get back on! ;-)) those tiny c-clips?
-
-
So I could reproduce writing duplicate files with a mixture of
writeJSON
andwrite
Not sure it is what happened here and with the alarm app though, but maybe it is related:let set={"id":1,"test":2}; let sto=require("Storage"); sto.writeJSON("test.json",set); sto.write("test.json","test123"); sto.list("test.json"); =[ "test.json", "test.json" ] >sto.read("test.json") ="test123" >sto.readJSON("test.json") Uncaught SyntaxError: Expecting a valid value, got ID at line 1 col 8 test123 ^
So both
read
andreadJSON
then only can read the latter file. -
Good to hear you got it working. Can you reproduce how it came to the two test.json files? Might be helpful for @Gordon to find a fix.
-
Works fine for me. Though I had to use settings1 as variable name because settings is already reserved for the settings of my watch face.
Maybe it is something similar for you? Is the settings variable already set to something before your code run?
EDIT: have you checked how many test.json files you have? Maybe it is related to this post?
-
-
-
-
-
The official loader at https://banglejs.com/apps is hosted by Gordon himself I think. Not sure what his update intervals are on there.
But there is also the GitHub hosted version of the Repo at https://espruino.github.io/BangleApps/
This currently shows settings in version 0.10.
BTW: I installed myself an Apache using the XAMPP for Windows package and self host locally because of the GitHub refresh issues. Works well. Doesn't even need https.
-
-
-
Hi there,
so I forked my own app loader to create new apps. What I'm having difficulty with is refreshing the app loader in Chrome after pushing changes into the repository.Chrome often still shows old versions of apps (e.g. version numbers and changelog text) and only after a clearing all data on Chrome and restarting Chrome itself do I see the changes. This is kind of annoying. Is there any other way to tell the app loader to reload all files from scratch or is this indeed a Chrome caching issue?
Anyone else experiences this?
EDIT: So right know I can't even trigger an update of the app loader in Chrome. Deleted all caches and cookies and what not, but still I don't see the updated Changelog and if I re-upload the app it is still the old version, not the updated one.
-
Are you running GadgetBridge? Then its probably related to this: http://forum.espruino.com/comments/15181427/
-
-
So according to this: https://www.tutorialspoint.com/java/util/java_util_timezone.htm
abstract int getRawOffset()
This method returns the amount of time in milliseconds to add to UTC to get standard time in this time zone.So getRawOffset() should give (for my timezone) +1 right. But because of daylight saving it should be +2.
So there is another method getDSTSaving()
int getDSTSavings()
This method returns the amount of time to be added to local standard time to get local wall clock time.Maybe a simple RawOffset+DSTSavings is enough?
E.setTimeZone("+((TimeZone.getDefault().getRawOffset()+TimeZone.getDefault().getDSTSavings())/3600000)
But despite that the first really helpful fix would be for GB not setting the time at all if disabled in GB settings.
Maybe it is related to the duplicate files issue, see http://forum.espruino.com/conversations/345948/#comment15216864
Can you do a
to see if there are duplicate files? But, they may they only appear if you are acutally experiencing the "data loss".
You could possibly also update to 2.05 and then see if the issue is gone.