Remove custom -- interafce.html

pull/1995/head
David Peer 2022-06-26 11:49:45 +02:00
parent fcbcfadd57
commit 9ec50b4d8f
2 changed files with 1 additions and 51 deletions

View File

@ -8,7 +8,7 @@
"tags": "tool",
"readme": "README.md",
"supports": ["BANGLEJS2"],
"custom": "trigger.html",
"interface": "interface.html",
"screenshots": [
{"url":"screenshot.png"},
{"url":"screenshot_2.png"},

View File

@ -1,50 +0,0 @@
<html>
<head>
<link rel="stylesheet" href="../../css/spectre.min.css">
</head>
<body>
<h3>Upload Tiggers</h3>
<p>You must upload a list of json objects -- an example is given below</p>
<p><textarea id="triggers" style="width:500px; height:300px">
[
{"display": "Open", "trigger": "OPEN_DOOR", "icon":"door"},
{"display": "Office", "trigger": "TOGGLE_LIGHT", "icon":"light"},
{"display": "Living Room", "trigger": "OVEN", "icon":"fire"}
]
</textarea></p>
<p><button id="upload" class="btn btn-primary">Upload</button></p>
<script src="../../core/lib/customize.js"></script>
<script src="../../core/lib/interface.js"></script>
<script>
function onInit(){
try{
Util.readStorage("ha.trigger.json", data=>{
document.getElementById("triggers").innerHTML += data;
});
console.log("Loaded from BangleJs:\n" + data);
} catch(ex){
console.log("(Warning) Failed loading ha.trigger.json from BangleJs. Using default.");
console.log(ex);
}
}
/*
* Upload trigger to BangleJs
*/
document.getElementById("upload").addEventListener("click", function() {
// get the text to add
var triggers = document.getElementById("triggers").value;
// send finished app (in addition to contents of app.json)
sendCustomizedApp({
storage:[
{name:"ha.trigger.json", url:"ha.trigger.json", content:triggers},
]
});
console.log("Sent ha.trigger.json!");
});
</script>
</body>
</html>