Skip to content

Commit c09e29b

Browse files
authored
Define widget first
1 parent bddd0f7 commit c09e29b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

apps/widsmartbatt/widget.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
((){
2-
1+
(function(){
2+
WIDGETS["widsmartbatt"] = {
3+
area: "tr",
4+
width: 30,
5+
draw: draw
6+
};
37
const intervalLow = 30000; // update interval when not charging
48
const intervalHigh = 30000; // faster update when charging
59
var showPercent = false;
@@ -85,9 +89,5 @@
8589

8690
var id = setInterval(() => WIDGETS["widsmartbatt"].draw(), intervalLow);
8791

88-
WIDGETS["widsmartbatt"] = {
89-
area: "tr",
90-
width: 30,
91-
draw: draw
92-
};
92+
9393
})();

0 commit comments

Comments
 (0)