Skip to content

Commit ca01ac8

Browse files
authored
Merge pull request espruino#3650 from NoobEjby/bttfclock
bttfclock: v0.02
2 parents d4b781a + f4be9f4 commit ca01ac8

File tree

4 files changed

+26
-14
lines changed

4 files changed

+26
-14
lines changed

apps/bttfclock/ChangeLog

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
0.01: Back to the future clock first version
1+
0.01: Back to the future clock first version.
2+
0.02: Added more icons to the status field. Made it posible to custemize the step goal thrue the Health Tracking app.

apps/bttfclock/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,24 @@ A watchface inspierd by <a target="_blank" href="https://apps.garmin.com/apps/d1
88

99
- Improving quality of Fonts.
1010
- More status icons.
11-
- A way to change step golas.
12-
- Improving bangle app performances (using functions for images and specialized array).
1311

1412
## Functionalities
1513

1614
- Current time
1715
- Current day and month
18-
- Steps
1916
- Battery
20-
- Step goal
17+
- Steps
18+
- Step goal can be set white the <a target="_blank" href="https://github.com/espruino/BangleApps/tree/master/apps/health">Health Tracking</a> app defult is 10000
2119
- Bluetooth connected icon
20+
- Alarm icon
21+
- Notification icon
2222

2323
## Screenshots
2424
Clock:<br/>
2525

2626

2727
## Usage
28+
Install it and enjoy
2829

2930

3031
## Links

apps/bttfclock/app.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ const stepGoalBatTextY = 100;
1111
const stepGoalBatdataY = stepGoalBatTextY+19;
1212
const statusTextY = 140;
1313
const statusDataY = statusTextY+19;
14-
let stepGoal = 7000;
14+
let stepGoal = (require("Storage").readJSON("health.json",1)||10000).stepGoal;
1515
let steps = 0;
16+
let alarmStatus = (require('Storage').readJSON('sched.json',1)||[]).some(alarm=>alarm.on);
1617

1718

18-
let bOn = require("heatshrink").decompress(atob("iEQwYROg3AAokYAgUMg0DAoUBwwFDgE2CIYdHAogREDoopFGoodGABI="));
19+
const bluetoothOnIcon = require("heatshrink").decompress(atob("iEQwYROg3AAokYAgUMg0DAoUBwwFDgE2CIYdHAogREDoopFGoodGABI="));
1920

20-
let bOff = require("heatshrink").decompress(atob("iEQwYLIgwFF4ADBgYFBjAKCsEGBAIABhgFEgOA7AdDmApKmwpCC4OGFIYjFGoVgIIkMEZAAD"));
21+
const bluetoothOffIcon = require("heatshrink").decompress(atob("iEQwYLIgwFF4ADBgYFBjAKCsEGBAIABhgFEgOA7AdDmApKmwpCC4OGFIYjFGoVgIIkMEZAAD"));
2122

23+
const alarmIcon = require("heatshrink").decompress(atob("iEQyBC/AA3/8ABBB7INHA4YLLDqIHVApJRJCZodNCJ4dPHqqPJGp4RLOaozZT8btLF64hJFJpFbAEYA="));
24+
25+
const notificationIcon = require("heatshrink").decompress(atob("iEQyBC/AB3/8ABBD+4bHEa4VJD6YTNEKIf/D/rTDAJ7jTADo5hK+IA=="));
2226

2327

2428
//the following 2 sections are used from waveclk to schedule minutely updates
@@ -187,12 +191,17 @@ function draw(){
187191
g.drawString(bat, batDrawX, stepGoalBatdataY);
188192

189193
//status
190-
var b = bOff;
194+
var b = bluetoothOffIcon;
191195
if (NRF.getSecurityStatus().connected){
192-
b = bOn;
196+
b = bluetoothOnIcon;
197+
}
198+
g.drawImage(b, 62, statusDataY-1);
199+
if (alarmStatus){
200+
g.drawImage(alarmIcon, 78, statusDataY-1);
201+
}
202+
if ((require('Storage').readJSON('messages.json',1)||[]).some(messag=>messag.new==true)){
203+
g.drawImage(notificationIcon, 94, statusDataY-1);
193204
}
194-
g.drawImage(b, 64, statusDataY);
195-
196205

197206
g.reset();
198207
g.setBgColor(0,0,0);
@@ -211,7 +220,6 @@ function draw(){
211220
*/
212221
g.setTheme({bg:"#000",fg:"#fff",dark:true}).clear();
213222
//draw();
214-
215223
//the following section is from waveclk
216224
Bangle.on('lcdPower',on=>{
217225
if (on) {
@@ -221,6 +229,8 @@ Bangle.on('lcdPower',on=>{
221229
drawTimeout = undefined;
222230
}
223231
});
232+
233+
224234
Bangle.setUI("clock");
225235
// Load widgets, but don't show them
226236
Bangle.loadWidgets();

apps/bttfclock/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "bttfclock",
33
"name": "Back To The Future",
4-
"version": "0.01",
4+
"version": "0.02",
55
"description": "The watch of Marty McFly",
66
"readme": "README.md",
77
"icon": "app.png",

0 commit comments

Comments
 (0)