Skip to content

Commit

Permalink
Merge pull request #3650 from NoobEjby/bttfclock
Browse files Browse the repository at this point in the history
bttfclock: v0.02
  • Loading branch information
bobrippling authored Nov 19, 2024
2 parents d4b781a + f4be9f4 commit ca01ac8
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
3 changes: 2 additions & 1 deletion apps/bttfclock/ChangeLog
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
0.01: Back to the future clock first version
0.01: Back to the future clock first version.
0.02: Added more icons to the status field. Made it posible to custemize the step goal thrue the Health Tracking app.
9 changes: 5 additions & 4 deletions apps/bttfclock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,24 @@ A watchface inspierd by <a target="_blank" href="https://apps.garmin.com/apps/d1

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

## Functionalities

- Current time
- Current day and month
- Steps
- Battery
- Step goal
- Steps
- 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
- Bluetooth connected icon
- Alarm icon
- Notification icon

## Screenshots
Clock:<br/>


## Usage
Install it and enjoy


## Links
Expand Down
26 changes: 18 additions & 8 deletions apps/bttfclock/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ const stepGoalBatTextY = 100;
const stepGoalBatdataY = stepGoalBatTextY+19;
const statusTextY = 140;
const statusDataY = statusTextY+19;
let stepGoal = 7000;
let stepGoal = (require("Storage").readJSON("health.json",1)||10000).stepGoal;
let steps = 0;
let alarmStatus = (require('Storage').readJSON('sched.json',1)||[]).some(alarm=>alarm.on);


let bOn = require("heatshrink").decompress(atob("iEQwYROg3AAokYAgUMg0DAoUBwwFDgE2CIYdHAogREDoopFGoodGABI="));
const bluetoothOnIcon = require("heatshrink").decompress(atob("iEQwYROg3AAokYAgUMg0DAoUBwwFDgE2CIYdHAogREDoopFGoodGABI="));

let bOff = require("heatshrink").decompress(atob("iEQwYLIgwFF4ADBgYFBjAKCsEGBAIABhgFEgOA7AdDmApKmwpCC4OGFIYjFGoVgIIkMEZAAD"));
const bluetoothOffIcon = require("heatshrink").decompress(atob("iEQwYLIgwFF4ADBgYFBjAKCsEGBAIABhgFEgOA7AdDmApKmwpCC4OGFIYjFGoVgIIkMEZAAD"));

const alarmIcon = require("heatshrink").decompress(atob("iEQyBC/AA3/8ABBB7INHA4YLLDqIHVApJRJCZodNCJ4dPHqqPJGp4RLOaozZT8btLF64hJFJpFbAEYA="));

const notificationIcon = require("heatshrink").decompress(atob("iEQyBC/AB3/8ABBD+4bHEa4VJD6YTNEKIf/D/rTDAJ7jTADo5hK+IA=="));


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

//status
var b = bOff;
var b = bluetoothOffIcon;
if (NRF.getSecurityStatus().connected){
b = bOn;
b = bluetoothOnIcon;
}
g.drawImage(b, 62, statusDataY-1);
if (alarmStatus){
g.drawImage(alarmIcon, 78, statusDataY-1);
}
if ((require('Storage').readJSON('messages.json',1)||[]).some(messag=>messag.new==true)){
g.drawImage(notificationIcon, 94, statusDataY-1);
}
g.drawImage(b, 64, statusDataY);


g.reset();
g.setBgColor(0,0,0);
Expand All @@ -211,7 +220,6 @@ function draw(){
*/
g.setTheme({bg:"#000",fg:"#fff",dark:true}).clear();
//draw();

//the following section is from waveclk
Bangle.on('lcdPower',on=>{
if (on) {
Expand All @@ -221,6 +229,8 @@ Bangle.on('lcdPower',on=>{
drawTimeout = undefined;
}
});


Bangle.setUI("clock");
// Load widgets, but don't show them
Bangle.loadWidgets();
Expand Down
2 changes: 1 addition & 1 deletion apps/bttfclock/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "bttfclock",
"name": "Back To The Future",
"version": "0.01",
"version": "0.02",
"description": "The watch of Marty McFly",
"readme": "README.md",
"icon": "app.png",
Expand Down

0 comments on commit ca01ac8

Please sign in to comment.