Minor changes

pull/1995/head
David Peer 2022-06-23 20:23:30 +02:00
parent 23da906d51
commit 23e8925595
3 changed files with 12 additions and 7 deletions

View File

@ -52,8 +52,13 @@ Bangle.on('touch', function(btn, e){
if(!isRight && !isLeft){
Bangle.buzz(80, 0.6).then(()=>{
action = "com.espruino.gadgetbridge.banglejs.ha." + actions[position];
Bluetooth.println(JSON.stringify({t:"intent", action:action, extra:{}}));
Bluetooth.println(JSON.stringify({
t:"intent",
action:"com.espruino.gadgetbridge.banglejs.HA",
extra:{
trigger: actions[position]
}})
);
setTimeout(()=>{
Bangle.buzz(80, 0.6);
}, 250);

View File

@ -8,11 +8,11 @@
"tags": "tool",
"readme": "README.md",
"supports": ["BANGLEJS2"],
"custom": "actions.html",
"custom": "trigger.html",
"screenshots": [
{"url":"screenshot.png"}],
"data": [
{"name":"ha.actions.txt" }
{"name":"ha.trigger.txt" }
],
"storage": [
{"name":"ha.app.js","url":"ha.app.js"},

View File

@ -4,7 +4,7 @@
</head>
<body>
<p>Actions: <input type="text" id="subjects" class="form-input" value="Seperate home assistant actions by comma, eg. LIGHT,DOOR,..."></p>
<p>Actions: <input type="text" id="subjects" class="form-input" value="Triggers eg. LIGHT,DOOR,..."></p>
<p>Click <button id="upload" class="btn btn-primary">Upload</button></p>
<script src="../../core/lib/customize.js"></script>
@ -20,10 +20,10 @@
// send finished app (in addition to contents of app.json)
sendCustomizedApp({
storage:[
{name:"ha.actions.txt", url:"ha.actions.txt", content:app},
{name:"ha.trigger.txt", url:"ha.trigger.txt", content:app},
]
});
console.log("Sent actions.txt!");
console.log("Sent ha.trigger.txt!");
});
</script>