Merge branch 'espruino:master' into master

pull/2035/head
awkirk71 2022-07-07 10:57:59 +01:00 committed by GitHub
commit 2398f7c964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 20 additions and 7 deletions

View File

@ -56,3 +56,4 @@
0.41: Add notification icons in the widget
0.42: Fix messages ignoring "Vibrate: Off" setting
0.43: Add new Icons (Airbnb, warnwetter)
0.44: Separate buzz pattern for incoming calls

View File

@ -12,6 +12,7 @@ You can change settings by going to the global `Settings` app, then `App Setting
and `Messages`:
* `Vibrate` - This is the pattern of buzzes that should be made when a new message is received
* `Vibrate for calls` - This is the pattern of buzzes that should be made when an incoming call is received
* `Repeat` - How often should buzzes repeat - the default of 4 means the Bangle will buzz every 4 seconds
* `Unread Timer` - When a new message is received we go into the Messages app.
If there is no user input for this amount of time then the app will exit and return

View File

@ -54,7 +54,7 @@ var onMessagesModified = function(msg) {
// TODO: if new, show this new one
if (msg && msg.id!=="music" && msg.new && active!="map" &&
!((require('Storage').readJSON('setting.json', 1) || {}).quiet)) {
if (WIDGETS["messages"]) WIDGETS["messages"].buzz();
if (WIDGETS["messages"]) WIDGETS["messages"].buzz(msg.src);
else Bangle.buzz();
}
if (msg && msg.id=="music") {

View File

@ -70,7 +70,7 @@ exports.pushMessage = function(event) {
}
// first, buzz
if (!quiet && loadMessages && global.WIDGETS && WIDGETS.messages){
WIDGETS.messages.buzz();
WIDGETS.messages.buzz(event.src);
if(unlockWatch != false){
Bangle.setLocked(false);
Bangle.setLCDPower(1); // turn screen on

View File

@ -1,7 +1,7 @@
{
"id": "messages",
"name": "Messages",
"version": "0.43",
"version": "0.44",
"description": "App to display notifications from iOS and Gadgetbridge/Android",
"icon": "app.png",
"type": "app",

View File

@ -2,6 +2,7 @@
function settings() {
let settings = require('Storage').readJSON("messages.settings.json", true) || {};
if (settings.vibrate===undefined) settings.vibrate=":";
if (settings.vibrateCalls===undefined) settings.vibrateCalls=":";
if (settings.repeat===undefined) settings.repeat=4;
if (settings.unreadTimeout===undefined) settings.unreadTimeout=60;
if (settings.maxMessages===undefined) settings.maxMessages=3;
@ -21,6 +22,7 @@
"" : { "title" : /*LANG*/"Messages" },
"< Back" : back,
/*LANG*/'Vibrate': require("buzz_menu").pattern(settings().vibrate, v => updateSetting("vibrate", v)),
/*LANG*/'Vibrate for calls': require("buzz_menu").pattern(settings().vibrateCalls, v => updateSetting("vibrateCalls", v)),
/*LANG*/'Repeat': {
value: settings().repeat,
min: 0, max: 10,
@ -62,4 +64,4 @@
}
};
E.showMenu(mainmenu);
})
});

View File

@ -60,9 +60,15 @@ draw:function(recall) {
WIDGETS["messages"].width=this.iconwidth * E.clip(msgs.length, 0, settings.maxMessages);
WIDGETS["messages"].msgs = msgs;
Bangle.drawWidgets();
},buzz:function() {
},buzz:function(msgSrc) {
if ((require('Storage').readJSON('setting.json',1)||{}).quiet) return; // never buzz during Quiet Mode
var pattern = (require('Storage').readJSON("messages.settings.json", true) || {}).vibrate;
var pattern;
if (msgSrc != undefined && msgSrc.toLowerCase() == "phone") {
// special vibration pattern for incoming calls
pattern = (require('Storage').readJSON("messages.settings.json", true) || {}).vibrateCalls;
} else {
pattern = (require('Storage').readJSON("messages.settings.json", true) || {}).vibrate;
}
if (pattern === undefined) { pattern = ":"; } // pattern may be "", so we can't use || ":" here
require("buzz").pattern(pattern);
},touch:function(b,c) {

View File

@ -1,2 +1,3 @@
0.01: New App!
0.02: Fix issue setting colors after showMessage
0.03: Fix BG/FG Color if e.g. theme background is black

View File

@ -216,6 +216,8 @@ function initDragEvents() {
function showHelp() {
if (state == states.start) {
state = states.help;
g.setBgColor(g.theme.bg);
g.setColor(g.theme.fg);
E.showMessage("Swipe up/down\n+/- one minute\n\nSwipe left/right\n+/- 15 seconds\n\nPress Btn1 to start","Tea timer help");
}
// return to start

View File

@ -1,7 +1,7 @@
{
"id": "teatimer",
"name": "Tea Timer",
"version": "0.02",
"version": "0.03",
"description": "A simple timer. You can easyly set up the time.",
"icon": "teatimer.png",
"type": "app",