mirror of https://github.com/espruino/BangleApps
commit
23c5ea3829
|
@ -1254,7 +1254,7 @@
|
|||
"name": "Battery Chart",
|
||||
"shortName":"Battery Chart",
|
||||
"icon": "app.png",
|
||||
"version":"0.08",
|
||||
"version":"0.09",
|
||||
"readme": "README.md",
|
||||
"description": "A widget and an app for recording and visualizing battery percentage over time.",
|
||||
"tags": "app,widget,battery,time,record,chart,tool",
|
||||
|
|
|
@ -5,4 +5,5 @@
|
|||
0.05: Display temperature and LCD state in chart
|
||||
0.06: Fixes widget events and charting of component states
|
||||
0.07: Improve logging and charting of component states and add widget icon
|
||||
0.08: Fix for Home button in the app and README added.
|
||||
0.08: Fix for Home button in the app and README added.
|
||||
0.09: Fix failing dismissal of Gadgetbridge notifications, record (coarse) bluetooth state
|
|
@ -8,7 +8,7 @@ const GraphXMax = GraphXZero + MaxValueCount;
|
|||
|
||||
const GraphLcdY = GraphYZero + 10;
|
||||
const GraphCompassY = GraphYZero + 16;
|
||||
// const GraphBluetoothY = GraphYZero + 22;
|
||||
const GraphBluetoothY = GraphYZero + 22;
|
||||
const GraphGpsY = GraphYZero + 28;
|
||||
const GraphHrmY = GraphYZero + 34;
|
||||
|
||||
|
@ -175,13 +175,13 @@ function renderData(dataArray) {
|
|||
g.drawLine(GraphXZero + i, GraphCompassY, GraphXZero + i, GraphCompassY + 1);
|
||||
}
|
||||
|
||||
// // Bluetooth state
|
||||
// if (switchables & switchableConsumers.lcd == switchableConsumers.lcd) {
|
||||
// g.setColor(0, 0, 1);
|
||||
// g.setFontAlign(1, -1, 0);
|
||||
// g.drawString("BLE", GraphXZero - GraphMarkerOffset, GraphBluetoothY - 2, true);
|
||||
// g.drawLine(GraphXZero + i, GraphBluetoothY, GraphXZero + i, GraphBluetoothY + 1);
|
||||
// }
|
||||
// Bluetooth state
|
||||
if (parseInt(dataInfo[switchabelsIndex]) & switchableConsumers.bluetooth) {
|
||||
g.setColor(0, 0, 1);
|
||||
g.setFontAlign(1, -1, 0);
|
||||
g.drawString("BLE", GraphXZero - GraphMarkerOffset, GraphBluetoothY - 2, true);
|
||||
g.drawLine(GraphXZero + i, GraphBluetoothY, GraphXZero + i, GraphBluetoothY + 1);
|
||||
}
|
||||
|
||||
// Gps state
|
||||
if (parseInt(dataInfo[switchabelsIndex]) & switchableConsumers.gps) {
|
||||
|
|
|
@ -71,8 +71,10 @@
|
|||
enabledConsumers = enabledConsumers | switchableConsumers.gps;
|
||||
if (hrmEventReceived)
|
||||
enabledConsumers = enabledConsumers | switchableConsumers.hrm;
|
||||
//if (Bangle.isBluetoothOn())
|
||||
// enabledConsumers = enabledConsumers | switchableConsumers.bluetooth;
|
||||
|
||||
// Very coarse first approach to check if the BLE device is on.
|
||||
if (NRF.getSecurityStatus().connected)
|
||||
enabledConsumers = enabledConsumers | switchableConsumers.bluetooth;
|
||||
|
||||
// Reset the event registration vars
|
||||
compassEventReceived = false;
|
||||
|
@ -110,19 +112,14 @@
|
|||
}
|
||||
|
||||
function reload() {
|
||||
WIDGETS.batchart.width = 24;
|
||||
WIDGETS["batchart"].width = 24;
|
||||
|
||||
recordingInterval = setInterval(logBatteryData, recordingInterval10Min);
|
||||
|
||||
logBatteryData();
|
||||
}
|
||||
|
||||
// add the widget
|
||||
WIDGETS.batchart = {
|
||||
area: "tl", width: 24, draw: draw, reload: function () {
|
||||
reload();
|
||||
Bangle.drawWidgets();
|
||||
}
|
||||
WIDGETS["batchart"] = {
|
||||
area: "tl", width: 24, draw: draw, reload: reload
|
||||
};
|
||||
|
||||
reload();
|
||||
|
|
Loading…
Reference in New Issue