mirror of https://github.com/espruino/BangleApps
Issue newline before GB commands (solves issue with console.log and ignored commands)
parent
69205d3480
commit
ba7a2f7996
|
@ -25,4 +25,4 @@
|
|||
0.24: Handle new 'nav' event for navigation
|
||||
0.25: Added option to 'ignore' an app from the message
|
||||
0.26: Change handling of GPS status to depend on GPS events instead of connection events
|
||||
|
||||
0.27: Issue newline before GB commands (solves issue with console.log and ignored commands)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id": "android",
|
||||
"name": "Android Integration",
|
||||
"shortName": "Android",
|
||||
"version": "0.26",
|
||||
"version": "0.27",
|
||||
"description": "Display notifications/music/etc sent from the Gadgetbridge app on Android. This replaces the old 'Gadgetbridge' Bangle.js widget.",
|
||||
"icon": "app.png",
|
||||
"tags": "tool,system,messages,notifications,gadgetbridge",
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
(function(back) {
|
||||
|
||||
|
||||
|
||||
function gb(j) {
|
||||
function gbSend(j) {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify(j));
|
||||
}
|
||||
var settings = require("Storage").readJSON("android.settings.json",1)||{};
|
||||
|
@ -16,8 +14,8 @@
|
|||
/*LANG*/"Find Phone" : () => E.showMenu({
|
||||
"" : { "title" : /*LANG*/"Find Phone" },
|
||||
"< Back" : ()=>E.showMenu(mainmenu),
|
||||
/*LANG*/"On" : _=>gb({t:"findPhone",n:true}),
|
||||
/*LANG*/"Off" : _=>gb({t:"findPhone",n:false}),
|
||||
/*LANG*/"On" : _=>gbSend({t:"findPhone",n:true}),
|
||||
/*LANG*/"Off" : _=>gbSend({t:"findPhone",n:false}),
|
||||
}),
|
||||
/*LANG*/"Keep Msgs" : {
|
||||
value : !!settings.keep,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
0.01: First Version
|
||||
0.02: Remove HID requirement, update screen
|
||||
0.03: Fix for Bangle 2, toggle find with top half of screen, exit touch bottom half of screen
|
||||
0.04: Issue newline before GB commands (solves issue with console.log and ignored commands)
|
|
@ -5,11 +5,11 @@ var finding = false;
|
|||
|
||||
function draw() {
|
||||
// show message
|
||||
g.clear(g.theme.bg);
|
||||
g.clear(g.theme.bg);
|
||||
g.setColor(g.theme.fg);
|
||||
g.setFont("Vector", fontSize);
|
||||
g.setFontAlign(0,0);
|
||||
|
||||
|
||||
if (finding) {
|
||||
g.drawString("Finding...", g.getWidth()/2, (g.getHeight()/2)-20);
|
||||
g.drawString("Click to stop", g.getWidth()/2, (g.getHeight()/2)+20);
|
||||
|
@ -20,6 +20,7 @@ function draw() {
|
|||
}
|
||||
|
||||
function findPhone(v) {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"findPhone", n:v}));
|
||||
}
|
||||
|
||||
|
@ -43,7 +44,7 @@ if (process.env.HWVERSION == 1) {
|
|||
|
||||
if (process.env.HWVERSION == 2) {
|
||||
Bangle.on('touch', function(button, xy) {
|
||||
|
||||
|
||||
// click top part of the screen to stop start
|
||||
if (xy.y < g.getHeight() / 2) {
|
||||
find();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id": "findphone",
|
||||
"name": "Find Phone",
|
||||
"shortName": "Find Phone",
|
||||
"version": "0.03",
|
||||
"version": "0.04",
|
||||
"description": "Find your phone via Gadgetbridge. Click any button to let your phone ring. 📳 Note: The functionality is available even without this app, just go to Settings, App Settings, Gadgetbridge, Find Phone.",
|
||||
"icon": "app.png",
|
||||
"tags": "tool,android",
|
||||
|
|
|
@ -10,3 +10,4 @@
|
|||
0.10: Simplify touch events
|
||||
Remove date+time
|
||||
0.11: Use default Bangle formatter for booleans
|
||||
0.12: Issue newline before GB commands (solves issue with console.log and ignored commands)
|
|
@ -415,6 +415,7 @@ let tCommand = {};
|
|||
* @param {string} command - "play"/"pause"/"next"/"previous"/"volumeup"/"volumedown"
|
||||
*/
|
||||
function sendCommand(command) {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t: "music", n: command}));
|
||||
// for control color
|
||||
if (command in tCommand) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id": "gbmusic",
|
||||
"name": "Gadgetbridge Music Controls",
|
||||
"shortName": "Music Controls",
|
||||
"version": "0.11",
|
||||
"version": "0.12",
|
||||
"description": "Control the music on your Gadgetbridge-connected phone",
|
||||
"icon": "icon.png",
|
||||
"screenshots": [{"url":"screenshot_v1_d.png"},{"url":"screenshot_v1_l.png"},
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
0.01: Initial version
|
||||
0.02: Issue newline before GB commands (solves issue with console.log and ignored commands)
|
|
@ -22,14 +22,17 @@ var counter = 0; //stores your counted your twists
|
|||
var tstate = false; //are you ready to count the twists?
|
||||
|
||||
function playx() {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"music", n:"play"}));
|
||||
}
|
||||
|
||||
function volup() {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"music", n:"volumeup"}));
|
||||
}
|
||||
|
||||
function voldn() {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"music", n:"volumedown"}));
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id": "gbtwist",
|
||||
"name": "Gadgetbridge Twist Control",
|
||||
"shortName": "Twist Control",
|
||||
"version": "0.01",
|
||||
"version": "0.02",
|
||||
"description": "Shake your wrist to control your music app via Gadgetbridge",
|
||||
"icon": "app.png",
|
||||
"type": "app",
|
||||
|
|
|
@ -7,3 +7,4 @@
|
|||
0.07: Update clock_info to avoid a redraw
|
||||
0.08: Allow swiping to switch triggers
|
||||
0.09: Improve web interface, arrows in UI
|
||||
0.10: Issue newline before GB commands (solves issue with console.log and ignored commands)
|
|
@ -64,6 +64,7 @@ exports.sendTrigger = function(triggerName){
|
|||
while(retries > 0){
|
||||
try{
|
||||
// Now lets send the trigger that we sould send.
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({
|
||||
t:"intent",
|
||||
action:"com.espruino.gadgetbridge.banglejs.HA",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "ha",
|
||||
"name": "Home Assistant",
|
||||
"version": "0.09",
|
||||
"version": "0.10",
|
||||
"description": "Integrates your Bangle.js into Home Assistant.",
|
||||
"icon": "ha.png",
|
||||
"type": "app",
|
||||
|
|
|
@ -13,3 +13,4 @@
|
|||
0.13: Fix drawPyramid function so pyramids are drawn in correct Y position
|
||||
0.14: Add jumping frame for characters
|
||||
0.15: Disable notification buzz during Quiet Mode
|
||||
0.16: Issue newline before GB commands (solves issue with console.log and ignored commands)
|
|
@ -92,6 +92,7 @@ function writeSettings(newSettings) {
|
|||
}
|
||||
|
||||
function phoneOutbound(msg) {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify(msg));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "marioclock",
|
||||
"name": "Mario Clock",
|
||||
"version": "0.15",
|
||||
"version": "0.16",
|
||||
"description": "Animated retro Mario clock, with Gameboy style 8-bit grey-scale graphics.",
|
||||
"icon": "marioclock.png",
|
||||
"type": "clock",
|
||||
|
|
|
@ -9,4 +9,5 @@
|
|||
0.11: Prevent module not found error
|
||||
0.12: Improve README, option to add functions triggered by status changes or time periods, remove old log (<0.10) conversion
|
||||
0.13: Prevent to stay in consecutive sleep if not worn, correct trigger calling, add trigger object itself as argument to the fn function
|
||||
0.14: Add "Delete all logfiles before" to interface.html, display all logfiles in the interface
|
||||
0.14: Add "Delete all logfiles before" to interface.html, display all logfiles in the interface
|
||||
0.15: Issue newline before GB commands (solves issue with console.log and ignored commands)
|
|
@ -303,6 +303,7 @@ if (sleeplog.conf.enabled) {
|
|||
|
||||
// send status to gadgetbridge
|
||||
var gb_kinds = "unknown,not_worn,activity,light_sleep,deep_sleep";
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({
|
||||
t: "act",
|
||||
act: gb_kinds.split(",")[data.status],
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id":"sleeplog",
|
||||
"name":"Sleep Log",
|
||||
"shortName": "SleepLog",
|
||||
"version": "0.14",
|
||||
"version": "0.15",
|
||||
"description": "Log and view your sleeping habits. This app is using the built in movement calculation.",
|
||||
"icon": "app.png",
|
||||
"type": "app",
|
||||
|
|
|
@ -6,3 +6,4 @@
|
|||
0.06: Make compatible with Fastload Utils app.
|
||||
0.07: Remove just the specific listeners to not interfere with Quick Launch
|
||||
when fastloading.
|
||||
0.08: Issue newline before GB commands (solves issue with console.log and ignored commands)
|
|
@ -62,7 +62,7 @@ let touchHandler = function(_, xy) {
|
|||
backToMenu = true;
|
||||
E.showMenu(spotifyMenu);
|
||||
} else if ((R.x-1<x && x<R.x+len) && (R.y2-len<y && y<R.y2+1)) {
|
||||
//Wake
|
||||
//Wake
|
||||
gadgetbridgeWake();
|
||||
gadgetbridgeWake();
|
||||
} else if ((R.x2-len<x && x<R.x2+1) && (R.y-1<y && y<R.y+len)) {
|
||||
|
@ -76,7 +76,7 @@ let touchHandler = function(_, xy) {
|
|||
Bangle.removeListener("swipe", swipeHandler);
|
||||
E.showMenu(savedMenu);
|
||||
} else if ((R.x-1<x && x<R.x+len) && (R.y+R.h/2-len/2<y && y<R.y+R.h/2+len/2)) {
|
||||
//Previous
|
||||
//Previous
|
||||
spotifyWidget("PREVIOUS");
|
||||
} else if ((R.x2-len+1<x && x<R.x2+1) && (R.y+R.h/2-len/2<y && y<R.y+R.h/2+len/2)) {
|
||||
//Next
|
||||
|
@ -156,75 +156,93 @@ let albumSearchTerm = function() { // input album to search for
|
|||
|
||||
let searchPlayWOTags = function() {//make a spotify search and play using entered terms
|
||||
searchString = simpleSearch;
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"intent", action:"android.media.action.MEDIA_PLAY_FROM_SEARCH", categories:["android.intent.category.DEFAULT"], package:"com.spotify.music", target:"activity", extra:{query:searchString}, flags:["FLAG_ACTIVITY_NEW_TASK"]}));
|
||||
};
|
||||
|
||||
let searchPlayWTags = function() {//make a spotify search and play using entered terms
|
||||
searchString = (artist=="" ? "":("artist:\""+artist+"\"")) + ((artist!="" && track!="") ? " ":"") + (track=="" ? "":("track:\""+track+"\"")) + (((artist!="" && album!="") || (track!="" && album!="")) ? " ":"") + (album=="" ? "":(" album:\""+album+"\""));
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"intent", action:"android.media.action.MEDIA_PLAY_FROM_SEARCH", categories:["android.intent.category.DEFAULT"], package:"com.spotify.music", target:"activity", extra:{query:searchString}, flags:["FLAG_ACTIVITY_NEW_TASK"]}));
|
||||
};
|
||||
|
||||
let playVreden = function() {//Play the track "Vreden" by Sara Parkman via spotify uri-link
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"intent", action:"android.intent.action.VIEW", categories:["android.intent.category.DEFAULT"], package:"com.spotify.music", data:"spotify:track:5QEFFJ5tAeRlVquCUNpAJY:play", target:"activity" , flags:["FLAG_ACTIVITY_NEW_TASK", "FLAG_ACTIVITY_NO_ANIMATION"/*, "FLAG_ACTIVITY_CLEAR_TOP", "FLAG_ACTIVITY_PREVIOUS_IS_TOP"*/]}));
|
||||
};
|
||||
|
||||
let playVredenAlternate = function() {//Play the track "Vreden" by Sara Parkman via spotify uri-link
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"intent", action:"android.intent.action.VIEW", categories:["android.intent.category.DEFAULT"], package:"com.spotify.music", data:"spotify:track:5QEFFJ5tAeRlVquCUNpAJY:play", target:"activity" , flags:["FLAG_ACTIVITY_NEW_TASK"]}));
|
||||
};
|
||||
|
||||
let searchPlayVreden = function() {//Play the track "Vreden" by Sara Parkman via search and play
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"intent", action:"android.media.action.MEDIA_PLAY_FROM_SEARCH", categories:["android.intent.category.DEFAULT"], package:"com.spotify.music", target:"activity", extra:{query:'artist:"Sara Parkman" track:"Vreden"'}, flags:["FLAG_ACTIVITY_NEW_TASK"]}));
|
||||
};
|
||||
|
||||
let openAlbum = function() {//Play EP "The Blue Room" by Coldplay
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"intent", action:"android.intent.action.VIEW", categories:["android.intent.category.DEFAULT"], package:"com.spotify.music", data:"spotify:album:3MVb2CWB36x7VwYo5sZmf2", target:"activity", flags:["FLAG_ACTIVITY_NEW_TASK"]}));
|
||||
};
|
||||
|
||||
let searchPlayAlbum = function() {//Play EP "The Blue Room" by Coldplay via search and play
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"intent", action:"android.media.action.MEDIA_PLAY_FROM_SEARCH", categories:["android.intent.category.DEFAULT"], package:"com.spotify.music", target:"activity", extra:{query:'album:"The blue room" artist:"Coldplay"', "android.intent.extra.focus":"vnd.android.cursor.item/album"}, flags:["FLAG_ACTIVITY_NEW_TASK"]}));
|
||||
};
|
||||
|
||||
let spotifyWidget = function(action) {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"intent", action:("com.spotify.mobile.android.ui.widget."+action), package:"com.spotify.music", target:"broadcastreceiver"}));
|
||||
};
|
||||
|
||||
let gadgetbridgeWake = function() {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"intent", target:"activity", flags:["FLAG_ACTIVITY_NEW_TASK", "FLAG_ACTIVITY_CLEAR_TASK", "FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS", "FLAG_ACTIVITY_NO_ANIMATION"], package:"gadgetbridge", class:"nodomain.freeyourgadget.gadgetbridge.activities.WakeActivity"}));
|
||||
};
|
||||
|
||||
let spotifyPlaylistDW = function() {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"intent", action:"android.intent.action.VIEW", categories:["android.intent.category.DEFAULT"], package:"com.spotify.music", data:"spotify:user:spotify:playlist:37i9dQZEVXcRfaeEbxXIgb:play", target:"activity" , flags:["FLAG_ACTIVITY_NEW_TASK", "FLAG_ACTIVITY_NO_ANIMATION"/*, "FLAG_ACTIVITY_CLEAR_TOP", "FLAG_ACTIVITY_PREVIOUS_IS_TOP"*/]}));
|
||||
};
|
||||
|
||||
let spotifyPlaylistDM1 = function() {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"intent", action:"android.intent.action.VIEW", categories:["android.intent.category.DEFAULT"], package:"com.spotify.music", data:"spotify:user:spotify:playlist:37i9dQZF1E365VyzxE0mxF:play", target:"activity" , flags:["FLAG_ACTIVITY_NEW_TASK", "FLAG_ACTIVITY_NO_ANIMATION"/*, "FLAG_ACTIVITY_CLEAR_TOP", "FLAG_ACTIVITY_PREVIOUS_IS_TOP"*/]}));
|
||||
};
|
||||
|
||||
let spotifyPlaylistDM2 = function() {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"intent", action:"android.intent.action.VIEW", categories:["android.intent.category.DEFAULT"], package:"com.spotify.music", data:"spotify:user:spotify:playlist:37i9dQZF1E38LZHLFnrM61:play", target:"activity" , flags:["FLAG_ACTIVITY_NEW_TASK", "FLAG_ACTIVITY_NO_ANIMATION"/*, "FLAG_ACTIVITY_CLEAR_TOP", "FLAG_ACTIVITY_PREVIOUS_IS_TOP"*/]}));
|
||||
};
|
||||
|
||||
let spotifyPlaylistDM3 = function() {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"intent", action:"android.intent.action.VIEW", categories:["android.intent.category.DEFAULT"], package:"com.spotify.music", data:"spotify:user:spotify:playlist:37i9dQZF1E36RU87qzgBFP:play", target:"activity" , flags:["FLAG_ACTIVITY_NEW_TASK", "FLAG_ACTIVITY_NO_ANIMATION"/*, "FLAG_ACTIVITY_CLEAR_TOP", "FLAG_ACTIVITY_PREVIOUS_IS_TOP"*/]}));
|
||||
};
|
||||
|
||||
let spotifyPlaylistDM4 = function() {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"intent", action:"android.intent.action.VIEW", categories:["android.intent.category.DEFAULT"], package:"com.spotify.music", data:"spotify:user:spotify:playlist:37i9dQZF1E396gGyCXEBFh:play", target:"activity" , flags:["FLAG_ACTIVITY_NEW_TASK", "FLAG_ACTIVITY_NO_ANIMATION"/*, "FLAG_ACTIVITY_CLEAR_TOP", "FLAG_ACTIVITY_PREVIOUS_IS_TOP"*/]}));
|
||||
};
|
||||
|
||||
let spotifyPlaylistDM5 = function() {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"intent", action:"android.intent.action.VIEW", categories:["android.intent.category.DEFAULT"], package:"com.spotify.music", data:"spotify:user:spotify:playlist:37i9dQZF1E37a0Tt6CKJLP:play", target:"activity" , flags:["FLAG_ACTIVITY_NEW_TASK", "FLAG_ACTIVITY_NO_ANIMATION"/*, "FLAG_ACTIVITY_CLEAR_TOP", "FLAG_ACTIVITY_PREVIOUS_IS_TOP"*/]}));
|
||||
};
|
||||
|
||||
let spotifyPlaylistDM6 = function() {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"intent", action:"android.intent.action.VIEW", categories:["android.intent.category.DEFAULT"], package:"com.spotify.music", data:"spotify:user:spotify:playlist:37i9dQZF1E36UIQLQK79od:play", target:"activity" , flags:["FLAG_ACTIVITY_NEW_TASK", "FLAG_ACTIVITY_NO_ANIMATION"/*, "FLAG_ACTIVITY_CLEAR_TOP", "FLAG_ACTIVITY_PREVIOUS_IS_TOP"*/]}));
|
||||
};
|
||||
|
||||
let spotifyPlaylistDD = function() {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"intent", action:"android.intent.action.VIEW", categories:["android.intent.category.DEFAULT"], package:"com.spotify.music", data:"spotify:user:spotify:playlist:37i9dQZF1EfWFiI7QfIAKq:play", target:"activity" , flags:["FLAG_ACTIVITY_NEW_TASK", "FLAG_ACTIVITY_NO_ANIMATION"/*, "FLAG_ACTIVITY_CLEAR_TOP", "FLAG_ACTIVITY_PREVIOUS_IS_TOP"*/]}));
|
||||
};
|
||||
|
||||
let spotifyPlaylistRR = function() {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"intent", action:"android.intent.action.VIEW", categories:["android.intent.category.DEFAULT"], package:"com.spotify.music", data:"spotify:user:spotify:playlist:37i9dQZEVXbs0XkE2V8sMO:play", target:"activity" , flags:["FLAG_ACTIVITY_NEW_TASK", "FLAG_ACTIVITY_NO_ANIMATION"/*, "FLAG_ACTIVITY_CLEAR_TOP", "FLAG_ACTIVITY_PREVIOUS_IS_TOP"*/]}));
|
||||
};
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "spotrem",
|
||||
"name": "Remote for Spotify",
|
||||
"version": "0.07",
|
||||
"version": "0.08",
|
||||
"description": "Control spotify on your android device.",
|
||||
"readme": "README.md",
|
||||
"type": "app",
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
0.01: first version
|
||||
0.02: Issue newline before GB commands (solves issue with console.log and ignored commands)
|
|
@ -3,7 +3,7 @@
|
|||
"shortName":"AGPS Widget",
|
||||
"icon": "widget.png",
|
||||
"type": "widget",
|
||||
"version":"0.01",
|
||||
"version":"0.02",
|
||||
"description": "Once installed, this widget allows your Bangle.js 2 to load AGPS data in the background **via Gadgetbridge on an Android phone** so it is always up to date. If you just want to upload the latest AGPS data from this app loader, please use the `Assisted GPS Update (AGPS)` app.",
|
||||
"readme": "README.md",
|
||||
"tags": "widget,agps,http",
|
||||
|
|
|
@ -6,15 +6,15 @@ if (!global.WIDGETS) {
|
|||
|
||||
(function(){
|
||||
var warnTime = 24*60*60000; //warn missing data
|
||||
var nextTime = 12*60*60000; //time between requests
|
||||
var retryTime = 10*60000; //time between retries
|
||||
var nextTime = 12*60*60000; //time between requests
|
||||
var retryTime = 10*60000; //time between retries
|
||||
|
||||
const JSON_FILE = "agpsdata.json";
|
||||
var isRequesting = false;
|
||||
var lastAGPS = 0;
|
||||
var nextGet = null;
|
||||
|
||||
const WIDGET_ID = "widagps";
|
||||
|
||||
const WIDGET_ID = "widagps";
|
||||
WIDGETS[WIDGET_ID]={
|
||||
area:"tl",
|
||||
width:24,
|
||||
|
@ -28,7 +28,7 @@ if (!global.WIDGETS) {
|
|||
}
|
||||
else {
|
||||
if (Date.now() - lastAGPS > warnTime) {
|
||||
g.setColor("#f00");
|
||||
g.setColor("#f00");
|
||||
w = 24;
|
||||
}
|
||||
}
|
||||
|
@ -127,6 +127,7 @@ g.drawImage(atob("FBQBAAAABgAAYAAPAACwABOAATgAI8ACPABD4AQ+AEPgD8EAg/AQP4AD+CD/wj
|
|||
isRequesting = true;
|
||||
if (Bluetooth.println) {
|
||||
console.log("On device");
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({t:"http", url:"https://www.espruino.com/agps/casic.base64"}));
|
||||
}
|
||||
else {
|
||||
|
@ -143,19 +144,19 @@ g.drawImage(atob("FBQBAAAABgAAYAAPAACwABOAATgAI8ACPABD4AQ+AEPgD8EAg/AQP4AD+CD/wj
|
|||
}, 10000);
|
||||
Bangle.drawWidgets();
|
||||
}
|
||||
|
||||
|
||||
var data = require("Storage").readJSON(JSON_FILE);
|
||||
if (data && data.lastAGPS) {
|
||||
//lastAGPS = data.lastAGPS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
nextAGPS(Math.max(0, nextTime - (Date.now() - lastAGPS)));
|
||||
NRF.on('connect', () => {
|
||||
if (Date.now() - lastAGPS > warnTime) {
|
||||
nextAGPS(0);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var testData = "QUdOU1MgZGF0YSBmcm9tIENBU0lDLgpEYXRhTGVuZ3RoOiAyNTk4LgpMaW1pdGF0aW9uOiAzLzEwMDAuCrrOSAAIB7YdxSr+Sg2h8NYlBux1jiUgQbrXgJk/KJvFZVv8pP//uy3i/PH6rv9EMQH6SwBfAOxepgDsXgAAlCULALv/AAtCAAAAAQM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