settings: add Quiet Mode setting

options: Off/Alarms/Silent
master
Richard de Boer 2021-03-20 17:36:57 +01:00
parent 6c481a118b
commit 2ce6adcb55
3 changed files with 13 additions and 1 deletions

View File

@ -171,7 +171,7 @@
{ "id": "setting",
"name": "Settings",
"icon": "settings.png",
"version":"0.23",
"version":"0.24",
"description": "A menu for setting up Bangle.js",
"tags": "tool,system",
"readme": "README.md",

View File

@ -26,3 +26,4 @@
Add whitelist option (fix #78)
0.22: Move HID to BLE menu
0.23: Change max time offset to 13 for NZ summer daylight time (NZDT)
0.24: Add Quiet Mode setting

View File

@ -29,6 +29,7 @@ function resetSettings() {
ble: true, // Bluetooth enabled by default
blerepl: true, // Is REPL on Bluetooth - can Espruino IDE be used?
log: false, // Do log messages appear on screen?
quiet: 0, // quiet mode: 0: off, 1: priority only, 2: total silence
timeout: 10, // Default LCD timeout in seconds
vibrate: true, // Vibration enabled by default. App must support
beep: "vib", // Beep enabled by default. App must support
@ -61,6 +62,7 @@ const boolFormat = v => v ? "On" : "Off";
function showMainMenu() {
var beepV = [false, true, "vib"];
var beepN = ["Off", "Piezo", "Vibrate"];
var quietN = ["Off", "Alarms", "Silent"];
const mainmenu = {
'': { 'title': 'Settings' },
'Make Connectable': ()=>makeConnectable(),
@ -97,6 +99,15 @@ function showMainMenu() {
}
}
},
"Quiet Mode": {
value: settings.quiet | 0,
min: 0, max: 2,
format: v => quietN[v],
onchange: v => {
settings.quiet = v
updateSettings()
},
},
'Locale': ()=>showLocaleMenu(),
'Select Clock': ()=>showClockMenu(),
'Set Time': ()=>showSetTimeMenu(),