Update widget.js

Buzz on connection loss.
master
KungPhoo 2022-03-22 07:42:40 +01:00 committed by GitHub
parent 9df926f062
commit 200e6fcc1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -5,8 +5,11 @@ WIDGETS["bluetooth"]={area:"tr",width:15,draw:function() {
else
g.setColor(g.theme.dark ? "#666" : "#999");
g.drawImage(atob("CxQBBgDgFgJgR4jZMawfAcA4D4NYybEYIwTAsBwDAA=="),2+this.x,2+this.y);
},changed:function() {
},connect:function() {
WIDGETS["bluetooth"].draw();
},dicconnect:function() {
Bangle.buzz(1000,1); // buzz on connection loss
WIDGETS["bluetooth"].draw();
}};
NRF.on('connect',WIDGETS["bluetooth"].changed);
NRF.on('disconnect',WIDGETS["bluetooth"].changed);
NRF.on('connect',WIDGETS["bluetooth"].connect);
NRF.on('disconnect',WIDGETS["bluetooth"].disconnect);