Minor changes based on JSLint hints
parent
304e23f53e
commit
24eb0f33fe
|
|
@ -51,6 +51,7 @@
|
|||
}
|
||||
|
||||
function getEnabledConsumersValue() {
|
||||
// Wait for an event from each of the devices to see if they are switched on
|
||||
var enabledConsumers = switchableConsumers.none;
|
||||
|
||||
Bangle.on('mag', onMag);
|
||||
|
|
@ -64,7 +65,6 @@
|
|||
|
||||
if (Bangle.isLCDOn())
|
||||
enabledConsumers = enabledConsumers | switchableConsumers.lcd;
|
||||
// Already added in the hope they will be available soon to get more details
|
||||
if (compassEventReceived)
|
||||
enabledConsumers = enabledConsumers | switchableConsumers.compass;
|
||||
if (gpsEventReceived)
|
||||
|
|
@ -90,8 +90,7 @@
|
|||
const logFileName = "bclog" + currentWriteDay;
|
||||
|
||||
// Change log target on day change
|
||||
if (!isNaN(previousWriteDay)
|
||||
&& previousWriteDay != currentWriteDay) {
|
||||
if (!isNaN(previousWriteDay) && previousWriteDay != currentWriteDay) {
|
||||
//Remove a log file containing data from a week ago
|
||||
Storage.open(logFileName, "r").erase();
|
||||
Storage.open(previousWriteLogName, "w").write(parseInt(currentWriteDay));
|
||||
|
|
@ -111,7 +110,7 @@
|
|||
}
|
||||
|
||||
function reload() {
|
||||
WIDGETS["batchart"].width = 24;
|
||||
WIDGETS.batchart.width = 24;
|
||||
|
||||
recordingInterval = setInterval(logBatteryData, recordingInterval10Min);
|
||||
|
||||
|
|
@ -119,11 +118,12 @@
|
|||
}
|
||||
|
||||
// add the widget
|
||||
WIDGETS["batchart"]={area:"tl",width:24,draw:draw,reload:function() {
|
||||
WIDGETS.batchart = {
|
||||
area: "tl", width: 24, draw: draw, reload: function () {
|
||||
reload();
|
||||
Bangle.drawWidgets(); // relayout all widgets
|
||||
}};
|
||||
Bangle.drawWidgets();
|
||||
}
|
||||
};
|
||||
|
||||
// load settings, set correct widget width
|
||||
reload();
|
||||
})()
|
||||
})();
|
||||
Loading…
Reference in New Issue