mirror of https://github.com/espruino/BangleApps
Merge pull request #2006 from myxor/widbaroalarm_v0.06
Widget Barometeralarm: Fix exceptionpull/1943/head^2^2
commit
67a5453118
|
@ -6,3 +6,4 @@
|
|||
0.05: Fix warning calculation
|
||||
Show difference of last measurement to pressure average of the the last three hours in the widget
|
||||
Only use valid pressure values
|
||||
0.06: Fix exception
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id": "widbaroalarm",
|
||||
"name": "Barometer Alarm Widget",
|
||||
"shortName": "Barometer Alarm",
|
||||
"version": "0.05",
|
||||
"version": "0.06",
|
||||
"description": "A widget that can alarm on when the pressure reaches defined thresholds.",
|
||||
"icon": "widget.png",
|
||||
"type": "widget",
|
||||
|
|
|
@ -231,15 +231,15 @@ function getPressureValue() {
|
|||
if (isValidPressureValue(pressure)) {
|
||||
currentPressures.unshift(pressure);
|
||||
median = currentPressures.slice().sort();
|
||||
}
|
||||
|
||||
if (median.length > 10) {
|
||||
var mid = median.length >> 1;
|
||||
medianPressure = Math.round(E.sum(median.slice(mid - 4, mid + 5)) / 9);
|
||||
if (medianPressure > 0) {
|
||||
turnOff();
|
||||
draw();
|
||||
handlePressureValue(medianPressure);
|
||||
if (median.length > 10) {
|
||||
var mid = median.length >> 1;
|
||||
medianPressure = Math.round(E.sum(median.slice(mid - 4, mid + 5)) / 9);
|
||||
if (medianPressure > 0) {
|
||||
turnOff();
|
||||
draw();
|
||||
handlePressureValue(medianPressure);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue