Skip to content

Commit 06fc361

Browse files
authored
Merge branch 'espruino:master' into sleeplogbuxfix
2 parents 9489c19 + b9141d8 commit 06fc361

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1439
-88
lines changed

apps/accelrec/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"description": "This app puts the Bangle's accelerometer into 100Hz mode and reads 2 seconds worth of data after movement starts. The data can then be exported back to the PC.",
77
"icon": "app.png",
88
"tags": "",
9-
"supports": ["BANGLEJS","BANGLEJS2"],
9+
"supports": ["BANGLEJS2"],
1010
"readme": "README.md",
1111
"interface": "interface.html",
1212
"storage": [

apps/clkinfodice/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.01: New Clock Info!

apps/clkinfodice/clkinfo.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
(function() {
2+
let random = Math.randInt(6);
3+
return {
4+
name: "Bangle",
5+
items: [
6+
{ name : "Dice",
7+
get : function() {
8+
return {
9+
text : (random+1).toString(),
10+
img : [
11+
atob("GBiBAAAAAAAAAAAAAAAAAA//8A//8AwAMAwAMAwAMAwAMAwAMAwYMAwYMAwAMAwAMAwAMAwAMAwAMA//8A//8AAAAAAAAAAAAAAAAA=="),
12+
atob("GBiBAAAAAAAAAAAAAAAAAA//8A//8AwAMAwAMAzAMAzAMAwAMAwAMAwAMAwAMAwDMAwDMAwAMAwAMA//8A//8AAAAAAAAAAAAAAAAA=="),
13+
atob("GBiBAAAAAAAAAAAAAAAAAA//8A//8AwAMAwAMAzAMAzAMAwAMAwYMAwYMAwAMAwDMAwDMAwAMAwAMA//8A//8AAAAAAAAAAAAAAAAA=="),
14+
atob("GBiBAAAAAAAAAAAAAAAAAA//8A//8AwAMAwAMAzDMAzDMAwAMAwAMAwAMAwAMAzDMAzDMAwAMAwAMA//8A//8AAAAAAAAAAAAAAAAA=="),
15+
atob("GBiBAAAAAAAAAAAAAAAAAA//8A//8AwAMAwAMAzDMAzDMAwAMAwYMAwYMAwAMAzDMAzDMAwAMAwAMA//8A//8AAAAAAAAAAAAAAAAA=="),
16+
atob("GBiBAAAAAAAAAAAAAAAAAA//8A//8AwAMAwAMAzDMAzDMAwAMAzDMAzDMAwAMAzDMAzDMAwAMAwAMA//8A//8AAAAAAAAAAAAAAAAA==")
17+
][random]
18+
};
19+
},
20+
show : function() { random = Math.randInt(6); },
21+
hide : function() {},
22+
run : function() { random = Math.randInt(6); this.emit("redraw"); }
23+
}
24+
]
25+
};
26+
})

apps/clkinfodice/icon.png

1.38 KB
Loading

apps/clkinfodice/metadata.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{ "id": "clkinfodice",
2+
"name": "Dice Clockinfo",
3+
"version":"0.01",
4+
"author": "gfwilliams",
5+
"description": "A ClockInfo that shows a random dice face. Tap to roll.",
6+
"icon": "icon.png",
7+
"type": "clkinfo",
8+
"tags": "clkinfo,gaming,game",
9+
"supports" : ["BANGLEJS2"],
10+
"storage": [
11+
{"name":"clkinfodice.clkinfo.js","url":"clkinfo.js"}
12+
]
13+
}

apps/clock_info/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@
2020
0.19: Fix Altitude ClockInfo after BLE added
2121
Tapping Altitude now updates the reading
2222
0.20: Altitude ClockInfo now uses the distance units set in locale.
23+
0.21: Add haptics when changing infos and a setting to toggle it on or off

apps/clock_info/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ and previously focussed Clock Infos
4040
progress/percent indicator may be shown. The percentage for altitude will be how far towards
4141
the Max Altitude you are. If you go higher than `Max Altitude` the correct altitude will still
4242
be shown - the percent indicator will just read 100%
43+
* `Haptics` - Whether or not to use a slight vibration when cycling between different infos, or lists (with a slightly stronger buzz).
4344

4445
## API (Software development)
4546

apps/clock_info/lib.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ exports.loadSettings = function() {
2323
hrmOn : 0, // 0(Always), 1(Tap)
2424
defocusOnLock : true,
2525
maxAltitude : 3000,
26+
haptics:true,
2627
apps : {}
2728
},
2829
require("Storage").readJSON("clock_info.json",1)||{}
@@ -293,13 +294,15 @@ exports.addInteractive = function(menu, options) {
293294
var oldMenuItem;
294295
if (ud) {
295296
if (menu[options.menuA].items.length==1) return; // 1 item - can't move
297+
if(settings.haptics) Bangle.buzz(30);
296298
oldMenuItem = menu[options.menuA].items[options.menuB];
297299
options.menuB += ud;
298300
if (options.menuB<0) options.menuB = menu[options.menuA].items.length-1;
299301
if (options.menuB>=menu[options.menuA].items.length) options.menuB = 0;
300302
} else if (lr) {
301303
if (menu.length==1) return; // 1 item - can't move
302304
oldMenuItem = menu[options.menuA].items[options.menuB];
305+
if(settings.haptics) Bangle.buzz(44);
303306
do {
304307
options.menuA += lr;
305308
if (options.menuA<0) options.menuA = menu.length-1;
@@ -355,7 +358,7 @@ exports.addInteractive = function(menu, options) {
355358
if (!options.focus) {
356359
focus();
357360
} else if (menu[options.menuA].items[options.menuB].run) {
358-
Bangle.buzz(100, 0.7);
361+
if(settings.haptics) Bangle.buzz(100, 0.7);
359362
menu[options.menuA].items[options.menuB].run(options); // allow tap on an item to run it (eg home assistant)
360363
}
361364
};

apps/clock_info/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{ "id": "clock_info",
22
"name": "Clock Info Module",
33
"shortName": "Clock Info",
4-
"version":"0.20",
4+
"version":"0.21",
55
"description": "A library used by clocks to provide extra information on the clock face (Altitude, BPM, etc)",
66
"icon": "app.png",
77
"type": "module",

apps/clock_info/settings.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
min: 500, max: 10000, step: 500,
2525
format: v => v+"m",
2626
onchange: x => save('maxAltitude', x),
27+
},
28+
/*LANG*/'Haptics': {
29+
value: !!settings.haptics,
30+
onchange: x => save('haptics', x),
2731
}
2832
};
2933
E.showMenu(menu);

0 commit comments

Comments
 (0)