forked from FOSS/BangleApps
[gassist] - New app for voice control
parent
2aa3dc5c29
commit
6d58a466b2
|
@ -0,0 +1 @@
|
|||
0.01: New App!
|
|
@ -0,0 +1,11 @@
|
|||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({
|
||||
t:"intent",
|
||||
target:"activity",
|
||||
action:"android.intent.action.VOICE_COMMAND",
|
||||
flags:["FLAG_ACTIVITY_NEW_TASK"]
|
||||
}));
|
||||
|
||||
setTimeout(function() {
|
||||
Bangle.showClock();
|
||||
}, 0);
|
Binary file not shown.
After Width: | Height: | Size: 799 B |
|
@ -0,0 +1,21 @@
|
|||
// load settings
|
||||
var settings = Object.assign({
|
||||
enableTap: true
|
||||
}, require("Storage").readJSON("gassist.json", true) || {});
|
||||
|
||||
if (settings.enableTap) {
|
||||
Bangle.on("tap", function(e) {
|
||||
if (e.dir=="front" && e.double) {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify({
|
||||
t:"intent",
|
||||
target:"activity",
|
||||
action:"android.intent.action.VOICE_COMMAND",
|
||||
flags:["FLAG_ACTIVITY_NEW_TASK"]
|
||||
}));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// clear variable
|
||||
settings = undefined;
|
|
@ -0,0 +1 @@
|
|||
gassist.json
|
|
@ -0,0 +1 @@
|
|||
require("heatshrink").decompress(atob("mEwxH+AH4A/AH4ALiAAFFtoxmFpQxjFxwwfFyAwdFyQwcF9wuUGDQvuFywwYF/4vUnAABF9YuCGBAv/F/6/PGC4bE3QACG5YvdFoYxSLzAvuFw4wjLxbCidhAvVGB4UFF7QxMCZAuaGJIRKF7oATFtoA/AEPMAAQttGNQuHGE4vuFxIwlF/4v/d/4vwGBAumGIwtpAH4A/AEIA=="))
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"id": "gassist",
|
||||
"name": "Google Assist",
|
||||
"version": "0.01",
|
||||
"description": "A simple way to initiate Google Assistant on Android. Intents must be enabled in Gadgetbridge.",
|
||||
"icon": "app.png",
|
||||
"type": "app",
|
||||
"tags": "tool, voice, tasker",
|
||||
"supports": ["BANGLEJS","BANGLEJS2"],
|
||||
"allow_emulator": false,
|
||||
"storage": [
|
||||
{"name":"gassist.boot.js","url":"boot.js"},
|
||||
{"name":"gassist.app.js","url":"app.js"},
|
||||
{"name":"gassist.settings.js","url":"settings.js"},
|
||||
{"name":"gassist.img","url":"icon.js","evaluate":true}
|
||||
],
|
||||
"data": [{"name":"gassist.json"}]
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
let storage = require('Storage');
|
||||
|
||||
(function (back) {
|
||||
// Load and set default settings
|
||||
let appSettings = Object.assign({
|
||||
enableTap : true
|
||||
}, storage.readJSON("gassist.json", true) || {});
|
||||
|
||||
// Save settings to storage
|
||||
function writeSettings() {
|
||||
storage.writeJSON("gassist.json", appSettings);
|
||||
}
|
||||
|
||||
function showMenu() {
|
||||
E.showMenu({
|
||||
"": {
|
||||
"title": "Google Assist"
|
||||
},
|
||||
"< Back": () => back(),
|
||||
'Front Tap:': {
|
||||
value: (appSettings.enableTap === true),
|
||||
format: v => v ? "On" : "Off",
|
||||
onchange: v => {
|
||||
appSettings.enableTap = v;
|
||||
writeSettings();
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
// Initially show the menu
|
||||
showMenu();
|
||||
});
|
Loading…
Reference in New Issue