New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DNDtoggle - Initial release #2125
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
714631a
DNDToggle Initial release
1955422
Typo
8e50254
Fixes
982a03a
Fixes
6494808
Fixes
86bf076
Fixes
6fe1ee3
-
d85dba2
-
0c91817
Fixes
d573aad
Another try
33c9945
Fixes
4d4886f
Fix
ba71847
Fix
a4d32d5
Merge branch 'espruino:master' into master
pebl-hank File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.01: Initial version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# a_dndtoggle - Toggle Quiet Mode of the watch | ||
|
||
When Quiet mode is off, just start this app to set quiet mode. Start it again to turn off quiet mode. | ||
Work in progress. | ||
|
||
#ToDo | ||
Settings page, current status indicator. | ||
|
||
## Creator | ||
|
||
Hank - contact at http://forum.espruino.com | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
const modeNames = [/*LANG*/"Noisy", /*LANG*/"Alarms", /*LANG*/"Silent"]; | ||
let bSettings = require('Storage').readJSON('setting.json',true)||{}; | ||
let current = 0|bSettings.quiet; | ||
//0 off | ||
//1 alarms | ||
//2 silent | ||
|
||
console.log("old: " + current); | ||
|
||
switch (current) { | ||
case 0: | ||
bSettings.quiet = 2; | ||
Bangle.buzz(); | ||
setTimeout('Bangle.buzz();',500); | ||
break; | ||
case 1: | ||
bSettings.quiet = 0; | ||
Bangle.buzz(); | ||
break; | ||
case 2: | ||
bSettings.quiet = 0; | ||
Bangle.buzz(); | ||
break; | ||
default: | ||
bSettings.quiet = 0; | ||
Bangle.buzz(); | ||
} | ||
|
||
console.log("new: " + bSettings.quiet); | ||
|
||
E.showMessage(modeNames[current] + " -> " + modeNames[bSettings.quiet]); | ||
setTimeout('exitApp();', 2000); | ||
|
||
|
||
function exitApp(){ | ||
|
||
require("Storage").writeJSON("setting.json", bSettings); | ||
// reload clocks with new theme, otherwise just wait for user to switch apps | ||
|
||
load() | ||
|
||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"id": "a_dndtoggle", | ||
"name": "a_dndtoggle - Toggle Quiet Mode of the watch", | ||
"shortName": "A_DND Toggle", | ||
"version": "0.01", | ||
"description": "Toggle Quiet Mode of the watch just by starting this app.", | ||
"icon": "a_dndtoggle.png", | ||
"type": "app", | ||
"tags": "tool", | ||
"supports": ["BANGLEJS","BANGLEJS2"], | ||
"storage": [ | ||
{"name":"a_dndtoggle.app.js","url":"a_dndtoggle.app.js"}, | ||
{"name":"a_dndtoggle.img","url":"app-icon.js","evaluate":true} | ||
], | ||
"readme": "README.md" | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last three cases are all the same, and we always buzz, so you could just replace it with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for future use. I will make the behavior configurable.