Skip to content

Commit 8bdf7b7

Browse files
author
thyttan
committed
Merge remote-tracking branch 'bobrippling/feat/clkinfo-ble' into app-loader
2 parents 6455bfa + 0e09e27 commit 8bdf7b7

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

apps/clock_info/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@
1414
0.13: Cache loaded ClockInfos so if we have clockInfoWidget and a clock, we don't load them twice (saves ~300ms)
1515
0.14: Check for .clkinfocache and use that if exists (from boot 0.64)
1616
0.15: Fix error when displaying a category with only one clockinfo (fix #3728)
17+
0.16: Add BLE clkinfo entry

apps/clock_info/lib.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,30 @@ exports.load = function() {
118118
}
119119
hrm = 0;
120120
},
121+
},
122+
{ name: "BLE",
123+
hasRange: false,
124+
isOn: () => {
125+
const s = NRF.getSecurityStatus();
126+
return s.advertising || s.connected;
127+
},
128+
get: function() {
129+
return {
130+
text: this.isOn() ? "On" : "Off",
131+
img: atob("CxQBBgDgFgJgR4jZMawfAcA4D4NYybEYIwTAsBwDAA==")
132+
};
133+
},
134+
run: function() {
135+
if (this.isOn()) {
136+
NRF.sleep();
137+
} else {
138+
NRF.wake();
139+
Bluetooth.setConsole(1);
140+
}
141+
setTimeout(() => this.emit("redraw"), 250);
142+
},
143+
show: function(){},
144+
hide: function(){},
121145
}
122146
],
123147
}];

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.15",
4+
"version":"0.16",
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",

0 commit comments

Comments
 (0)