Merge pull request #1203 from hughbarney/master
Pastel: Added weather icons, other small changes that have been soak tested over christmaspull/1214/head
26
apps.json
|
@ -167,7 +167,7 @@
|
||||||
{
|
{
|
||||||
"id": "setting",
|
"id": "setting",
|
||||||
"name": "Settings",
|
"name": "Settings",
|
||||||
"version": "0.39",
|
"version": "0.40",
|
||||||
"description": "A menu for setting up Bangle.js",
|
"description": "A menu for setting up Bangle.js",
|
||||||
"icon": "settings.png",
|
"icon": "settings.png",
|
||||||
"tags": "tool,system",
|
"tags": "tool,system",
|
||||||
|
@ -4210,13 +4210,13 @@
|
||||||
"id": "pastel",
|
"id": "pastel",
|
||||||
"name": "Pastel Clock",
|
"name": "Pastel Clock",
|
||||||
"shortName": "Pastel",
|
"shortName": "Pastel",
|
||||||
"version": "0.09",
|
"version": "0.10",
|
||||||
"description": "A Configurable clock with custom fonts and background. Has a cyclic information line that includes, day, date, battery, sunrise and sunset times",
|
"description": "A Configurable clock with custom fonts, background and weather display. Has a cyclic information line that includes, day, date, battery, sunrise and sunset times",
|
||||||
"icon": "pastel.png",
|
"icon": "pastel.png",
|
||||||
"dependencies": {"mylocation":"app", "widpedom":"app"},
|
"dependencies": {"mylocation":"app", "widpedom":"app","weather":"app"},
|
||||||
"screenshots": [{"url":"screenshot_pastel.png"}],
|
"screenshots": [{"url":"screenshot_pastel.png"}, {"url":"weather_icons.png"}],
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
"tags": "clock",
|
"tags": "clock, weather, tool",
|
||||||
"supports": ["BANGLEJS","BANGLEJS2"],
|
"supports": ["BANGLEJS","BANGLEJS2"],
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
"storage": [
|
"storage": [
|
||||||
|
@ -4382,7 +4382,7 @@
|
||||||
{
|
{
|
||||||
"id": "gpstouch",
|
"id": "gpstouch",
|
||||||
"name": "GPS Touch",
|
"name": "GPS Touch",
|
||||||
"version": "0.01",
|
"version": "0.02",
|
||||||
"description": "A touch based GPS watch, shows OS map reference",
|
"description": "A touch based GPS watch, shows OS map reference",
|
||||||
"icon": "gpstouch.png",
|
"icon": "gpstouch.png",
|
||||||
"screenshots": [{"url":"screenshot4.png"},{"url":"screenshot2.png"},{"url":"screenshot3.png"},{"url":"screenshot1.png"}],
|
"screenshots": [{"url":"screenshot4.png"},{"url":"screenshot2.png"},{"url":"screenshot3.png"},{"url":"screenshot1.png"}],
|
||||||
|
@ -4621,7 +4621,7 @@
|
||||||
"shortName":"93 Dub",
|
"shortName":"93 Dub",
|
||||||
"icon": "93dub.png",
|
"icon": "93dub.png",
|
||||||
"screenshots": [{"url":"screenshot.png"}],
|
"screenshots": [{"url":"screenshot.png"}],
|
||||||
"version":"0.05",
|
"version":"0.06",
|
||||||
"description": "Fan recreation of orviwan's 91 Dub app for the Pebble smartwatch. Uses assets from his 91-Dub-v2.0 repo",
|
"description": "Fan recreation of orviwan's 91 Dub app for the Pebble smartwatch. Uses assets from his 91-Dub-v2.0 repo",
|
||||||
"tags": "clock",
|
"tags": "clock",
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
|
@ -4710,7 +4710,7 @@
|
||||||
"icon": "mylocation.png",
|
"icon": "mylocation.png",
|
||||||
"type": "app",
|
"type": "app",
|
||||||
"screenshots": [{"url":"screenshot_1.png"}],
|
"screenshots": [{"url":"screenshot_1.png"}],
|
||||||
"version":"0.01",
|
"version":"0.02",
|
||||||
"description": "Sets and stores the lat and long of your preferred City or it can be set from the GPS. mylocation.json can be used by other apps that need your main location lat and lon. See README",
|
"description": "Sets and stores the lat and long of your preferred City or it can be set from the GPS. mylocation.json can be used by other apps that need your main location lat and lon. See README",
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
"tags": "tool,utility",
|
"tags": "tool,utility",
|
||||||
|
@ -4727,7 +4727,7 @@
|
||||||
"id": "pebble",
|
"id": "pebble",
|
||||||
"name": "Pebble Clock",
|
"name": "Pebble Clock",
|
||||||
"shortName": "Pebble",
|
"shortName": "Pebble",
|
||||||
"version": "0.06",
|
"version": "0.07",
|
||||||
"description": "A pebble style clock to keep the rebellion going",
|
"description": "A pebble style clock to keep the rebellion going",
|
||||||
"dependencies": {"widpedom":"app"},
|
"dependencies": {"widpedom":"app"},
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
|
@ -4735,7 +4735,7 @@
|
||||||
"screenshots": [{"url":"pebble_screenshot.png"}],
|
"screenshots": [{"url":"pebble_screenshot.png"}],
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
"tags": "clock",
|
"tags": "clock",
|
||||||
"supports": ["BANGLEJS2"],
|
"supports": ["BANGLEJS", "BANGLEJS2"],
|
||||||
"storage": [
|
"storage": [
|
||||||
{"name":"pebble.app.js","url":"pebble.app.js"},
|
{"name":"pebble.app.js","url":"pebble.app.js"},
|
||||||
{"name":"pebble.settings.js","url":"pebble.settings.js"},
|
{"name":"pebble.settings.js","url":"pebble.settings.js"},
|
||||||
|
@ -4769,7 +4769,7 @@
|
||||||
"screenshots": [{"url":"screenshot_widbata_1.png"}],
|
"screenshots": [{"url":"screenshot_widbata_1.png"}],
|
||||||
"version":"0.01",
|
"version":"0.01",
|
||||||
"type": "widget",
|
"type": "widget",
|
||||||
"supports": ["BANGLEJS2"],
|
"supports": ["BANGLEJS", "BANGLEJS2"],
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
"description": "Shows the current battery level status in the top right using the clocks colour theme",
|
"description": "Shows the current battery level status in the top right using the clocks colour theme",
|
||||||
"tags": "widget,battery",
|
"tags": "widget,battery",
|
||||||
|
@ -4914,7 +4914,7 @@
|
||||||
"id": "rebble",
|
"id": "rebble",
|
||||||
"name": "Rebble Clock",
|
"name": "Rebble Clock",
|
||||||
"shortName": "Rebble",
|
"shortName": "Rebble",
|
||||||
"version": "0.03",
|
"version": "0.04",
|
||||||
"description": "A Pebble style clock, with configurable background, three sidebars including steps, day, date, sunrise, sunset, long live the rebellion",
|
"description": "A Pebble style clock, with configurable background, three sidebars including steps, day, date, sunrise, sunset, long live the rebellion",
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
"icon": "rebble.png",
|
"icon": "rebble.png",
|
||||||
|
|
|
@ -3,3 +3,4 @@
|
||||||
0.03: Code style cleanup
|
0.03: Code style cleanup
|
||||||
0.04: Set 00:00 to 12:00 for 12 hour time
|
0.04: Set 00:00 to 12:00 for 12 hour time
|
||||||
0.05: Display time, even on Thursday
|
0.05: Display time, even on Thursday
|
||||||
|
0.06: Fix light theme issue, where widgets would end up on a light strip
|
||||||
|
|
|
@ -122,7 +122,13 @@ function draw(){
|
||||||
queueDraw();
|
queueDraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This watch is mostly dark, it does not make sense to respect the
|
||||||
|
* light theme as you end up with a white strip at the top for the
|
||||||
|
* widgets and black watch. So set the colours to the dark theme.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
g.setTheme({bg:"#000",fg:"#fff",dark:true}).clear();
|
||||||
draw();
|
draw();
|
||||||
|
|
||||||
//the following section is also from waveclk
|
//the following section is also from waveclk
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
0.01: First version
|
0.01: First version
|
||||||
|
0.02: Enchanced contrast of icon image
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
require("heatshrink").decompress(atob("mEw4UA///j+EAYO/uYDB//wCYcPBA4AFh/ABZMDBbkX6gLIgtX6tQBY9VBYNVBY0BBYdABYsFqoACEgQLDitVtWpqtUBYtVq2q1WVGAQLErQLB0oLFHQNqBYIkBHgMDIwYKBAAJIDIweqz/2BYJtDBYI6Bv/9HgILHYwILGh4gBBYWfbooLF6AjPBYW//wLGL4Wv/RfGNZaDIBYibEBYizIBYjLDBYzXBd4TXCBZ60BBYRqEBZpUBBYRSFJAQLCA4b7BHgQLFgYLGIwYLEgoLBHQYLEgILBHQYLEgALBAoYLFi/UBZMHBZUD6ALKApQAFBbHwBZMP/4ABBwgIDA="))
|
require("heatshrink").decompress(atob("mEw4UA///iADCn+EqoAWqAuJgoLcn/8BZENGwNwBY/VBYNXBY0DJ4fABYoiCEggLDmtX1Wq6tcBYvVrQLB0owCBYdVtQLB1NVBYg6BBQIABHgQLCgIuCGAVABYcNqwtBGIOVJAILFyoCCBY5eBBdo7IgIIB1t6BYJfENZaDB9QKB1aDFBYKbEBYizBrwLB2qnFdwSmCX401cYdUBZTjGfYgHCBZB2BBYhUBAARSBBYhICAAIGCBYkVBQJSCBYpICIwQLFHgQ6CBYo8CHQQLFHgQFDBYsVQIQLHgo6DBY0BHQYLGgY6DBYwAFBbCjDACY"))
|
||||||
|
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.4 KiB |
|
@ -1 +1,2 @@
|
||||||
0.01: First release
|
0.01: First release
|
||||||
|
0.02: Enhanced icon, make it bolder
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
require("heatshrink").decompress(atob("mEw4UA///t/7j/P3/vB4cBqtVoAbHBQIABBQ0FBYdQBYsVBYdUERIkGHIQADHoguEGAwuEGAwKFBZg8DHQw8EBYNf/1Vq3/8oLDIwNf/Wpv//0oLG9Wq3/qBYJUCBYuqBaBqBBYW+BepHEBbybCBYP+BYSnErYLDyoLFAANq/r8Ga5T7MBZZUBAAhSCfhA6DBZhIGBQg8FHQg8GHQgwGFwowFBQwwDFwwLMlS7Bqta1AKEn2q1K1C1WgBYf/1WqBYIDB1QKCgYLC0taBYoXB/QICBY0//7vBAAQ8EEgIABCwwME9QVEA"))
|
require("heatshrink").decompress(atob("mEw4UA///gH4AYPO/QPDgNVqtADY/1BYNfBQ0PBQIAB+ALFmoLDrgLF6oLDq4KEgYKDBYPABYcNBYlVuAuIGAwuEAANUBYYKFHgg6Bq4ZCr4DBHgQLBvWq2te1WlBYZGBBYOr1Wq1qSDBYNqBIILDKgQLLgoLHqBqDBfJHLBZBrOgKPCBYiPCU4NaBYe1WYrABBQLCCfgYGCrwVBa4kAirvKNgIAErgLDKgIAEKQQ8EAAY6DBZhIDIww8GHQg8GHQgwGFwowEFwx5EOog8GHQ0AlWpBYNq1AKFWIILBAYOgBYbICytWAgQKCgTgDcwYXGAAgvGAAY8EEgYWGBgoVEA=="))
|
||||||
|
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.6 KiB |
|
@ -7,3 +7,4 @@
|
||||||
0.07: Added info line that cycles on BTN1/BTN3 (or vitual buttons on a bangle 2)
|
0.07: Added info line that cycles on BTN1/BTN3 (or vitual buttons on a bangle 2)
|
||||||
0.08: Added dependancy on MyLocation
|
0.08: Added dependancy on MyLocation
|
||||||
0.09: Added dependancy on Pedometer Widget
|
0.09: Added dependancy on Pedometer Widget
|
||||||
|
0.10: Added Weather line, fixed issues on a Bangle 1, update every minute
|
||||||
|
|
|
@ -1,45 +1,83 @@
|
||||||
# Pastel Clock
|
# Pastel Clock
|
||||||
|
|
||||||
*a configurable clock with custom fonts and background. Has a cyclic information line that includes, day, date, battery, sunrise and sunset times*
|
*a configurable clock with custom fonts, background and optional weather icons. Has a cyclic information line that includes, day, date, battery, sunrise and sunset times*
|
||||||
|
|
||||||
* Designed specifically for Bangle 1 and Bangle 2
|
* Designed specifically for Bangle 1 and Bangle 2
|
||||||
* A choice of 7 different custom fonts
|
* A choice of 7 different custom fonts
|
||||||
* Supports the Light and Dark themes
|
* Supports the Light and Dark themes
|
||||||
* Has a settings menu, change font, enable/disable the grid
|
* Has a settings menu, change font, enable/disable the grid, weather icons
|
||||||
* On Bangle 1 use BTN1,BTN3 to cycle through the info display (Date, ID, Batt %, Ram % etc)
|
* On Bangle 1 use BTN1,BTN3 to cycle through the info display (Date, ID, Batt %, Ram % etc)
|
||||||
* On Bangle 2 touch the top right/top left to cycle through the info display (Date, ID, Batt %, Ram % etc)
|
* On Bangle 2 touch the top right/top left to cycle through the info display (Date, ID, Batt %, Ram % etc)
|
||||||
|
* The information display will cycle on each screen update
|
||||||
* Uses mylocation.json from MyLocation app to calculate sunrise and sunset times for your location
|
* Uses mylocation.json from MyLocation app to calculate sunrise and sunset times for your location
|
||||||
* Uses pedometer widget to get latest step count
|
* Uses pedometer widget to get latest step count
|
||||||
|
* Use the weather widget to get weather status
|
||||||
* Dependant apps are installed when Pastel installs
|
* Dependant apps are installed when Pastel installs
|
||||||
|
* The screen is updated every minute to save battery power
|
||||||
|
* The weather display will display temperature and wind speed on alternate screen refreshes
|
||||||
|
|
||||||
I came up with the name Pastel due to the shade of the grid background.
|
I came up with the name Pastel due to the shade of the grid background.
|
||||||
|
|
||||||
Written by: [Hugh Barney](https://github.com/hughbarney) For support and discussion please post in the [Bangle JS Forum](http://forum.espruino.com/microcosms/1424/)
|
Written by: [Hugh Barney](https://github.com/hughbarney) For support and discussion please post in the [Bangle JS Forum](http://forum.espruino.com/microcosms/1424/)
|
||||||
|
|
||||||
## Lato
|
|
||||||
|
## Weather Support
|
||||||
|
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Pastel installs the weather app and weather widget. You may want to
|
||||||
|
hide the weather widget display, this can be done through the weather
|
||||||
|
widget settings. You should first get the weather app working. If
|
||||||
|
the weather App is not working, then it is not going to work for
|
||||||
|
Pastel.
|
||||||
|
|
||||||
|
The following weather icons are supported.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Mostly cloudy, Sunny, Mostly Sunny, Snow, Rain.
|
||||||
|
|
||||||
|
The triangle icon shows there is a problem connecting to GadgetBridge and the weather service.
|
||||||
|
You should follow the setup and trouble shooting guide for the Weather App.
|
||||||
|
|
||||||
|
If you find the weather / gadgetbridge service unreliable you can
|
||||||
|
disable weather updates to pastel through the settings app.
|
||||||
|
|
||||||
|
|
||||||
|
## Fonts
|
||||||
|
|
||||||
|
### Lato
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
## Architect
|
### Architect
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
## Gochihand
|
### Gochihand
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
## Monoton
|
### Monoton
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
## Elite
|
### Elite
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
## Cabin Sketch
|
### Cabin Sketch
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
## Orbitron
|
### Orbitron
|
||||||

|

|
||||||
|
|
||||||
|
### The Grid
|
||||||
|
|
||||||
|
Setting the grid on provides a graph paper style background to the App.
|
||||||
|
The grid is not supported on a Bangle 1 due to flicker issues.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,22 @@
|
||||||
var SunCalc = require("https://raw.githubusercontent.com/mourner/suncalc/master/suncalc.js");
|
var SunCalc = require("https://raw.githubusercontent.com/mourner/suncalc/master/suncalc.js");
|
||||||
require("f_latosmall").add(Graphics);
|
require("f_latosmall").add(Graphics);
|
||||||
|
const storage = require('Storage');
|
||||||
|
const locale = require("locale");
|
||||||
const SETTINGS_FILE = "pastel.json";
|
const SETTINGS_FILE = "pastel.json";
|
||||||
const LOCATION_FILE = "mylocation.json";
|
const LOCATION_FILE = "mylocation.json";
|
||||||
let settings;
|
let settings;
|
||||||
let location;
|
let location;
|
||||||
|
|
||||||
|
// cloud, sun, partSun, snow, rain, storm, error
|
||||||
|
// create 1 bit, max contrast, brightness set to 85
|
||||||
|
var cloudIcon = require("heatshrink").decompress(atob("kEggIfcj+AAYM/8ADBuFwAYPAmADCCAMBwEf8ADBhFwg4aBnEPAYMYjAVBhgDDDoQDHCYc4jwDB+EP///FYIDBMTgA=="));
|
||||||
|
var sunIcon = require("heatshrink").decompress(atob("kEggILIgOAAZkDAYPAgeBwPAgIFBBgPhw4TBp/yAYMcnADBnEcAYMwhgDBsEGgE/AYP8AYYLDCYgbDEYYrD8fHIwI7CIYZLDL54AHA=="));
|
||||||
|
var sunPartIcon = require("heatshrink").decompress(atob("kEggIHEmADJjEwsEAjkw8EAh0B4EAg35wEAgP+CYMDwv8AYMDBAP2g8HgH+g0DBYMMgPwAYX8gOMEwMG3kAg8OvgSBjg2BgcYGQIcBAY5CBg0Av//HAM///4MYgNBEIMOCoUMDoUAnBwGkEA"));
|
||||||
|
var snowIcon = require("heatshrink").decompress(atob("kEggITQj/AAYM98ADBsEwAYPAjADCj+AgOAj/gAYMIuEHwEAjEPAYQVChk4AYQhCAYcYBYQTDnEPgEB+EH///IAQACE4IAB8EICIPghwDB4EeBYNAjgDBg8EAYQYCg4bCgZuFA=="));
|
||||||
|
var rainIcon = require("heatshrink").decompress(atob("kEggIPMh+AAYM/8ADBuFwAYPgmADB4EbAYOAj/ggOAhnwg4aBnAeCjEcCIMMjADCDoQDHjAPCnAXCuEP///8EDAYJECAAXBwkAgPDhwDBwUMgEEhkggEOjFgFgMQLYQAOA=="));
|
||||||
|
var errIcon = require("heatshrink").decompress(atob("kEggILIgOAAYsD4ADBg/gAYMGsADBhkwAYsYjADCjgDBmEMAYNxxwDBsOGAYPBwYDEgOBwOAgYDB4EDHYPAgwDBsADDhgDBFIcwjAHBjE4AYMcmADBhhNCKIcG/4AGOw4A=="));
|
||||||
|
|
||||||
|
|
||||||
function loadSettings() {
|
function loadSettings() {
|
||||||
settings = require("Storage").readJSON(SETTINGS_FILE,1)||{};
|
settings = require("Storage").readJSON(SETTINGS_FILE,1)||{};
|
||||||
settings.grid = settings.grid||false;
|
settings.grid = settings.grid||false;
|
||||||
|
@ -93,7 +105,49 @@ function prevInfo() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var mm_prev = "xx";
|
|
||||||
|
/**
|
||||||
|
Choose weather icon to display based on condition.
|
||||||
|
Based on function from the Bangle weather app so it should handle all of the conditions
|
||||||
|
sent from gadget bridge.
|
||||||
|
*/
|
||||||
|
function chooseIcon(condition) {
|
||||||
|
condition = condition.toLowerCase();
|
||||||
|
if (condition.includes("thunderstorm")) return stormIcon;
|
||||||
|
if (condition.includes("freezing")||condition.includes("snow")||
|
||||||
|
condition.includes("sleet")) {
|
||||||
|
return snowIcon;
|
||||||
|
}
|
||||||
|
if (condition.includes("drizzle")||
|
||||||
|
condition.includes("shower")) {
|
||||||
|
return rainIcon;
|
||||||
|
}
|
||||||
|
if (condition.includes("rain")) return rainIcon;
|
||||||
|
if (condition.includes("clear")) return sunIcon;
|
||||||
|
if (condition.includes("few clouds")) return partSunIcon;
|
||||||
|
if (condition.includes("scattered clouds")) return cloudIcon;
|
||||||
|
if (condition.includes("clouds")) return cloudIcon;
|
||||||
|
if (condition.includes("mist") ||
|
||||||
|
condition.includes("smoke") ||
|
||||||
|
condition.includes("haze") ||
|
||||||
|
condition.includes("sand") ||
|
||||||
|
condition.includes("dust") ||
|
||||||
|
condition.includes("fog") ||
|
||||||
|
condition.includes("ash") ||
|
||||||
|
condition.includes("squalls") ||
|
||||||
|
condition.includes("tornado")) {
|
||||||
|
return cloudIcon;
|
||||||
|
}
|
||||||
|
return cloudIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get weather stored in json file by weather app.
|
||||||
|
*/
|
||||||
|
function getWeather() {
|
||||||
|
let jsonWeather = storage.readJSON('weather.json');
|
||||||
|
return jsonWeather;
|
||||||
|
}
|
||||||
|
|
||||||
function draw() {
|
function draw() {
|
||||||
var d = new Date();
|
var d = new Date();
|
||||||
|
@ -115,19 +169,27 @@ function draw() {
|
||||||
var x = (g.getWidth()/2);
|
var x = (g.getWidth()/2);
|
||||||
var y = (g.getHeight()/3);
|
var y = (g.getHeight()/3);
|
||||||
|
|
||||||
g.reset();
|
var weatherJson = getWeather();
|
||||||
|
var w_temp;
|
||||||
|
var w_icon;
|
||||||
|
var w_wind;
|
||||||
|
|
||||||
if (process.env.HWVERSION == 1) {
|
if (settings.weather && weatherJson && weatherJson.weather) {
|
||||||
// avoid flicker on a bangle 1 by comparing with previous minute
|
var currentWeather = weatherJson.weather;
|
||||||
if (mm_prev != mm) {
|
const temp = locale.temp(currentWeather.temp-273.15).match(/^(\D*\d*)(.*)$/);
|
||||||
mm_prev = mm;
|
w_temp = temp[1] + " " + temp[2];
|
||||||
g.clearRect(0, 30, w, h - 24);
|
w_icon = chooseIcon(currentWeather.txt);
|
||||||
}
|
const wind = locale.speed(currentWeather.wind).match(/^(\D*\d*)(.*)$/);
|
||||||
|
w_wind = wind[1] + " " + wind[2] + " " + (currentWeather.wrose||'').toUpperCase();
|
||||||
} else {
|
} else {
|
||||||
// on a b2 safe to just clear anyway as there is no flicker
|
w_temp = "Err";
|
||||||
g.clearRect(0, 30, w, h - 24);
|
w_wind = "???";
|
||||||
|
w_icon = errIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g.reset();
|
||||||
|
g.clearRect(0, 30, w, h - 24);
|
||||||
|
|
||||||
// draw a grid like graph paper
|
// draw a grid like graph paper
|
||||||
if (settings.grid && process.env.HWVERSION !=1) {
|
if (settings.grid && process.env.HWVERSION !=1) {
|
||||||
g.setColor("#0f0");
|
g.setColor("#0f0");
|
||||||
|
@ -139,6 +201,18 @@ function draw() {
|
||||||
|
|
||||||
g.setColor(g.theme.fg);
|
g.setColor(g.theme.fg);
|
||||||
|
|
||||||
|
// draw weather line
|
||||||
|
if (settings.weather) {
|
||||||
|
g.drawImage(w_icon, (w/2) - 40, 24);
|
||||||
|
g.setFontLatoSmall();
|
||||||
|
g.setFontAlign(-1,0); // left aligned
|
||||||
|
if (drawCount % 2 == 0)
|
||||||
|
g.drawString(w_temp, (w/2) + 6, 24 + ((y - 24)/2));
|
||||||
|
else
|
||||||
|
g.drawString( (w_wind.split(' ').slice(0, 2).join(' ')), (w/2) + 6, 24 + ((y - 24)/2));
|
||||||
|
// display first 2 words of the wind string eg '4 mph'
|
||||||
|
}
|
||||||
|
|
||||||
if (settings.font == "Architect")
|
if (settings.font == "Architect")
|
||||||
g.setFontArchitect();
|
g.setFontArchitect();
|
||||||
else if (settings.font == "GochiHand")
|
else if (settings.font == "GochiHand")
|
||||||
|
@ -161,36 +235,39 @@ function draw() {
|
||||||
|
|
||||||
// for the colon
|
// for the colon
|
||||||
g.setFontAlign(0,-1); // centre aligned
|
g.setFontAlign(0,-1); // centre aligned
|
||||||
|
|
||||||
if (d.getSeconds()&1) {
|
|
||||||
g.drawString(":", x,y);
|
g.drawString(":", x,y);
|
||||||
} else {
|
|
||||||
// on bangle 1, we are not using clearRect(), hide : by printing over it in reverse color
|
|
||||||
if (process.env.HWVERSION == 1) {
|
|
||||||
g.setColor(g.theme.bg);
|
|
||||||
g.drawString(":", x,y);
|
|
||||||
g.setColor(g.theme.fg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
g.setFontLatoSmall();
|
g.setFontLatoSmall();
|
||||||
g.setFontAlign(0, -1);
|
g.setFontAlign(0, -1);
|
||||||
g.drawString((infoData[infoMode].calc()), w/2, h - 24 - 24);
|
g.drawString((infoData[infoMode].calc()), w/2, h - 24 - 24);
|
||||||
|
|
||||||
if (drawCount % 3600 == 0)
|
// recalc sunrise / sunset every hour
|
||||||
|
if (drawCount % 60 == 0)
|
||||||
updateSunRiseSunSet(new Date(), location.lat, location.lon);
|
updateSunRiseSunSet(new Date(), location.lat, location.lon);
|
||||||
drawCount++;
|
drawCount++;
|
||||||
|
queueDraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only update when display turns on
|
// timeout used to update every minute
|
||||||
if (process.env.BOARD!="SMAQ3") // hack for Q3 which is always-on
|
var drawTimeout;
|
||||||
Bangle.on('lcdPower', function(on) {
|
|
||||||
if (secondInterval)
|
// schedule a draw for the next minute
|
||||||
clearInterval(secondInterval);
|
function queueDraw() {
|
||||||
secondInterval = undefined;
|
if (drawTimeout) clearTimeout(drawTimeout);
|
||||||
if (on)
|
drawTimeout = setTimeout(function() {
|
||||||
secondInterval = setInterval(draw, 1000);
|
drawTimeout = undefined;
|
||||||
|
nextInfo();
|
||||||
draw();
|
draw();
|
||||||
|
}, 60000 - (Date.now() % 60000));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Stop updates when LCD is off, restart when on
|
||||||
|
Bangle.on('lcdPower',on=>{
|
||||||
|
if (on) {
|
||||||
|
draw(); // draw immediately, queue redraw
|
||||||
|
} else { // stop draw timer
|
||||||
|
if (drawTimeout) clearTimeout(drawTimeout);
|
||||||
|
drawTimeout = undefined;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Bangle.setUI("clockupdown", btn=> {
|
Bangle.setUI("clockupdown", btn=> {
|
||||||
|
@ -204,8 +281,6 @@ loadFonts();
|
||||||
loadLocation();
|
loadLocation();
|
||||||
|
|
||||||
g.clear();
|
g.clear();
|
||||||
var secondInterval = setInterval(draw, 1000);
|
|
||||||
draw();
|
|
||||||
|
|
||||||
Bangle.loadWidgets();
|
Bangle.loadWidgets();
|
||||||
Bangle.drawWidgets();
|
Bangle.drawWidgets();
|
||||||
|
draw();
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
// initialize with default settings...
|
// initialize with default settings...
|
||||||
let s = {
|
let s = {
|
||||||
'grid': false,
|
'grid': false,
|
||||||
|
'weather': false,
|
||||||
'font': "Lato"
|
'font': "Lato"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,8 +40,16 @@
|
||||||
value: s.grid,
|
value: s.grid,
|
||||||
format: () => (s.grid ? 'Yes' : 'No'),
|
format: () => (s.grid ? 'Yes' : 'No'),
|
||||||
onchange: () => {
|
onchange: () => {
|
||||||
s.grid = !s.grid
|
s.grid = !s.grid;
|
||||||
save()
|
save();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'Show Weather': {
|
||||||
|
value: s.weather,
|
||||||
|
format: () => (s.weather ? 'Yes' : 'No'),
|
||||||
|
onchange: () => {
|
||||||
|
s.weather = !s.weather;
|
||||||
|
save();
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 1.5 KiB |
|
@ -4,3 +4,4 @@
|
||||||
0.04: Fix widget hiding code (fix #1046)
|
0.04: Fix widget hiding code (fix #1046)
|
||||||
0.05: Fix typo in settings - Purple
|
0.05: Fix typo in settings - Purple
|
||||||
0.06: Added dependancy on Pedometer Widget
|
0.06: Added dependancy on Pedometer Widget
|
||||||
|
0.07: Fixed icon and ong file to 48x48
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
require("heatshrink").decompress(atob("oFAwgNKiIAIFqofegIf/DAUzAAMyAwUQD60T/4ACD7Q/cPxIf/YCofcDhYiSXYYfuUZgf/D/4f/D6USkUgD/4fuogAID6vtDw/UD6vu6geF73kb6vuEAtN9wfYMIneD7JADDwIfaIAJdBD7YgBHwQfbAAgfkf6Qf/D/4feogAID6oAND/4f/iAdJD/4f/D/4fUDxYABD74iODiAftTZgfnYYczAAMyD7UT/4ACH/S+bD8DAKD9Y="))
|
require("heatshrink").decompress(atob("mEw4UA///ssp4XthFCBwUBqoABqAaGBZcFBZdX1W1qgLHrwLKqv/6oLJAAILHioLJn5qBAAYLEBQoLeHQQABv4LjGAgLYq2qAAOlBbBHFBdPAKcQLdWcb7jAAoLcn4LKgEVHQVUBQsAgoLLq//6oLIr2q2oXJBZQvCqALGgILTA="))
|
||||||
|
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.3 KiB |
|
@ -1,3 +1,4 @@
|
||||||
0.01: First release
|
0.01: First release
|
||||||
0.02: Fix typo to Purple
|
0.02: Fix typo to Purple
|
||||||
0.03: Added dependancy on Pedometer Widget
|
0.03: Added dependancy on Pedometer Widget
|
||||||
|
0.04: Fixed icon and png to 48x48 pixels
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
* Uses pedometer widget to get latest step count
|
* Uses pedometer widget to get latest step count
|
||||||
* Dependant apps are installed when Rebble installs
|
* Dependant apps are installed when Rebble installs
|
||||||
* Uses the whole screen, widgets are made invisible but still run in the background
|
* Uses the whole screen, widgets are made invisible but still run in the background
|
||||||
|
* The icon is James Dean - 'Rebel Without a Cause'
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|
|
@ -1 +1 @@
|
||||||
require("heatshrink").decompress(atob("oFA4X/AAIHBw3Aiv3HmE/HQQAF/gPEnWqAAOpy2VqoFB3gPIBoIABtQPJ1PVqv1q3qB5OlrNVEIQPK2tlBwOptQPIyvdH4VtrQPI3tbqtdB4OaB5FVH4NV0pgBB5F13//MIIPJ1O2TgWV/o/I1fbB4WpqoPI1NvB4REBJ5APD/wPBD5JOBB4WVqwPH0oPE0oPJ/NX//6AoNVF5HZq3pq2qSYIPI6tX+pNBB5Ol6v6B4IABH5P7//b1oPBN5GlLwPr9IPK1IPC/SvK1QPCOAIPL6te//5B5lW/5ABL5APB/wPB3IPJ1Y/C/yuBF5APC9X+yo/K34LB3QPBtQPJ//23SPB1QPI3eVs2qJwIPJ1flqyeBtQPJtZPBLwIPKzf/1ROCB5OWAQJOBB5QsBAAQGBf5FlB5tVvoPMNQO9B4daB5O+B4aPIqtX35tBB5M1qtbB4i/HB4WvOAjvGB4IpBIQIADB46aBB4t8B49VB54AFB6zrB1Wm1RTBywPI0oPCeQOaB4+ltOlq2V02VqwPOrQPIF5w/PFQIvPB71pH4uqX8g"))
|
require("heatshrink").decompress(atob("mEw4X/AoOG4EV+/I+dVAAVUCgcFBIYABpIJBgcFoIKEqkQgEH6EH0ILEqAhCgkBqEVBYdAhUBBoU9GAlAlw5CgERgILDIocEgEGoALDlEHwEAlkUg8EBYfAFwVA+BgEqmQjWrBgMQhgvDqmA9Wq1WsNoMALweDBQIAB4E8BYdTpwLD/kA4AXDjwKC1f/IAILDnQLC1//4ALEHQQLCKgILDFwYLB6EATgVABYe///MNgdA3kQEoILGqCNBlfQh//4NAPAVQ+YLBQYM/ocABYfAiEqgE0g6DBF4eAlFrYQZHDoOu1Xo8lgBYtCKIOo9aOBAAJrCBYWv9X/+gXEqSZC/f//4LHz/6DQIjEBYOhgG6BY1a1WggDCB3ojErYTBoEOa4QLF1X9jWrXwILGKYOvBYtfKYX+17iBHYdX1WQgf/34LBUwQLB1cLWIJqCBYdV9W+1+//oLBWQVVqnuD4M/KQoAB/+kBYJGBCwYLCI4P/DQILFnwLCEQ1Vp+q/46CBYtDXgJ1FAAVwfI4ABqAUCBY8A9gLIqEA9ALEKYYLB9YLERwQ="))
|
||||||
|
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.0 KiB |
|
@ -42,3 +42,4 @@
|
||||||
0.37: Going into passkey menu now saves settings with passkey
|
0.37: Going into passkey menu now saves settings with passkey
|
||||||
0.38: Restructed menus as per forum discussion
|
0.38: Restructed menus as per forum discussion
|
||||||
0.39: Fix misbehaving debug info option
|
0.39: Fix misbehaving debug info option
|
||||||
|
0.40: Moved off into Utils, put System after Apps
|
||||||
|
|
|
@ -66,11 +66,10 @@ function showMainMenu() {
|
||||||
'': { 'title': 'Settings' },
|
'': { 'title': 'Settings' },
|
||||||
'< Back': ()=>load(),
|
'< Back': ()=>load(),
|
||||||
/*LANG*/'Apps': ()=>showAppSettingsMenu(),
|
/*LANG*/'Apps': ()=>showAppSettingsMenu(),
|
||||||
/*LANG*/'Bluetooth': ()=>showBLEMenu(),
|
|
||||||
/*LANG*/'System': ()=>showSystemMenu(),
|
/*LANG*/'System': ()=>showSystemMenu(),
|
||||||
|
/*LANG*/'Bluetooth': ()=>showBLEMenu(),
|
||||||
/*LANG*/'Alerts': ()=>showAlertsMenu(),
|
/*LANG*/'Alerts': ()=>showAlertsMenu(),
|
||||||
/*LANG*/'Utils': ()=>showUtilMenu(),
|
/*LANG*/'Utils': ()=>showUtilMenu()
|
||||||
/*LANG*/'Turn Off': ()=>{ if (Bangle.softOff) Bangle.softOff(); else Bangle.off() }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return E.showMenu(mainmenu);
|
return E.showMenu(mainmenu);
|
||||||
|
@ -537,7 +536,8 @@ function showUtilMenu() {
|
||||||
setTimeout(showMainMenu, 50);
|
setTimeout(showMainMenu, 50);
|
||||||
} else showUtilMenu();
|
} else showUtilMenu();
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
|
/*LANG*/'Turn Off': ()=>{ if (Bangle.softOff) Bangle.softOff(); else Bangle.off() }
|
||||||
};
|
};
|
||||||
if (Bangle.factoryReset) {
|
if (Bangle.factoryReset) {
|
||||||
menu['Factory Reset'] = ()=>{
|
menu['Factory Reset'] = ()=>{
|
||||||
|
|