Renaming
|
@ -0,0 +1,8 @@
|
|||
# Home Assistant
|
||||
|
||||
|
||||
## Creator
|
||||
- [David Peer](https://github.com/peerdavid).
|
||||
|
||||
## Thanks To
|
||||
<a href="https://www.flaticon.com/free-icons/info" title="info icons">Info icons created by Freepik - Flaticon</a>
|
|
@ -0,0 +1,59 @@
|
|||
var W = g.getWidth(), H = g.getHeight();
|
||||
var position=0;
|
||||
var response="...";
|
||||
|
||||
function draw() {
|
||||
g.reset().clearRect(Bangle.appRect);
|
||||
|
||||
// Header
|
||||
g.setFont("Vector", 32).setFontAlign(0,0);
|
||||
var text = "";
|
||||
if(position == 0){
|
||||
text = "Door";
|
||||
} else if(position == 1){
|
||||
text = "Light";
|
||||
}
|
||||
|
||||
g.drawString(text, W/2, H/3);
|
||||
g.setFont("Vector", 24);
|
||||
g.drawString(response, W/2, H/3+34);
|
||||
}
|
||||
|
||||
|
||||
draw();
|
||||
setWatch(_=>load(), BTN1);
|
||||
|
||||
Bangle.on('touch', function(btn, e){
|
||||
var left = parseInt(g.getWidth() * 0.3);
|
||||
var right = g.getWidth() - left;
|
||||
var isLeft = e.x < left;
|
||||
var isRight = e.x > right;
|
||||
|
||||
if(isRight){
|
||||
position += 1;
|
||||
position = position > 1 ? 0 : position;
|
||||
draw();
|
||||
}
|
||||
|
||||
if(isLeft){
|
||||
position -= 1;
|
||||
position = position < 0 ? 1 : position;
|
||||
draw();
|
||||
}
|
||||
|
||||
if(!isRight && !isLeft){
|
||||
Bangle.buzz(40, 0.6);
|
||||
|
||||
// Trigger HA bridge
|
||||
response = "sending...";
|
||||
draw();
|
||||
|
||||
var url = "https://www.google.com/";
|
||||
response = Bluetooth.println(JSON.stringify({t:"http", url:url}));
|
||||
}
|
||||
|
||||
draw();
|
||||
});
|
||||
|
||||
Bangle.loadWidgets();
|
||||
Bangle.drawWidgets();
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"id": "homeassistant",
|
||||
"id": "ha",
|
||||
"name": "HomeAssistant",
|
||||
"version": "0.01",
|
||||
"description": "An application that displays information such as battery level, steps etc.",
|
||||
"icon": "homeassistant.png",
|
||||
"icon": "ha.png",
|
||||
"type": "app",
|
||||
"tags": "tool",
|
||||
"readme": "README.md",
|
||||
|
@ -13,7 +13,7 @@
|
|||
{"url":"screenshot_2.png"},
|
||||
{"url":"screenshot_3.png"}],
|
||||
"storage": [
|
||||
{"name":"homeassistant.app.js","url":"homeassistant.app.js"},
|
||||
{"name":"homeassistant.img","url":"homeassistant.icon.js","evaluate":true}
|
||||
{"name":"ha.app.js","url":"ha.app.js"},
|
||||
{"name":"ha.img","url":"ha.icon.js","evaluate":true}
|
||||
]
|
||||
}
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
@ -1,17 +0,0 @@
|
|||
# Info
|
||||
|
||||
A very simple app that shows information on 3 different screens.
|
||||
Go to the next screen via tab right, go to the previous screen
|
||||
via tab left and reload the data via tab in the middle of the
|
||||
screen. Very useful if combined with pattern launcher ;)
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
|
||||
## Creator
|
||||
- [David Peer](https://github.com/peerdavid).
|
||||
|
||||
## Thanks To
|
||||
<a href="https://www.flaticon.com/free-icons/info" title="info icons">Info icons created by Freepik - Flaticon</a>
|
|
@ -1,34 +0,0 @@
|
|||
var W = g.getWidth(), H = g.getHeight();
|
||||
|
||||
|
||||
function draw() {
|
||||
g.reset().clearRect(Bangle.appRect);
|
||||
|
||||
// Header
|
||||
g.setFont("Vector", 22).setFontAlign(0,-1);
|
||||
g.drawString("", W/2, H/2);
|
||||
}
|
||||
|
||||
|
||||
draw();
|
||||
setWatch(_=>load(), BTN1);
|
||||
|
||||
Bangle.on('touch', function(btn, e){
|
||||
var left = parseInt(g.getWidth() * 0.3);
|
||||
var right = g.getWidth() - left;
|
||||
var isLeft = e.x < left;
|
||||
var isRight = e.x > right;
|
||||
|
||||
if(isRight){
|
||||
|
||||
}
|
||||
|
||||
if(isLeft){
|
||||
|
||||
}
|
||||
|
||||
draw();
|
||||
});
|
||||
|
||||
Bangle.loadWidgets();
|
||||
Bangle.drawWidgets();
|