diff --git a/apps/widbaroalarm/ChangeLog b/apps/widbaroalarm/ChangeLog index 0afe4bc8b..86a902605 100644 --- a/apps/widbaroalarm/ChangeLog +++ b/apps/widbaroalarm/ChangeLog @@ -1,5 +1,5 @@ 0.01: Initial version -0.02: Do not warn multiple times for the same exceedance +0.02: Do not warn multiple times for the same exceed 0.03: Fix crash 0.04: Use Prompt with dismiss and pause Improve barometer value median calculation diff --git a/apps/widbaroalarm/README.md b/apps/widbaroalarm/README.md index 80ba35abc..59d91ff66 100644 --- a/apps/widbaroalarm/README.md +++ b/apps/widbaroalarm/README.md @@ -16,10 +16,10 @@ Get a notification when the pressure reaches defined thresholds. * Show widget: Enable/disable widget visibility * Buzz on alarm: Enable/disable buzzer on alarm * Dismiss delay: Delay added before the next alert if the alert is dismissed. From 5 to 60 min -* Pause delay: Same as Dismiss delay but longer (usefull for meetings and such). From 30 to 240 min +* Pause delay: Same as Dismiss delay but longer (useful for meetings and such). From 30 to 240 min ## Widget -The widget shows the last median pressure value +The widget shows two rows: pressure value of last measurement and pressure average of the the last three hours. ## Creator Marco ([myxor](https://github.com/myxor)) diff --git a/apps/widbaroalarm/widget.js b/apps/widbaroalarm/widget.js index 00456f42f..444b63ce6 100644 --- a/apps/widbaroalarm/widget.js +++ b/apps/widbaroalarm/widget.js @@ -227,11 +227,24 @@ draw: draw }; } - g.reset(); - if (setting("show") && medianPressure != undefined) { + if (setting("show")) { g.setFont("6x8", 1).setFontAlign(1, 0); - g.drawString(Math.round(medianPressure), this.x + 24, this.y + 6); + if (medianPressure == undefined) { + check(); + const x = this.x, y = this.y; + g.drawString("...", x + 24, y + 6); + setTimeout(function() { + g.setFont("6x8", 1).setFontAlign(1, 0); + g.drawString(Math.round(medianPressure), x + 24, y + 6); + }, 10000); + } else { + g.drawString(Math.round(medianPressure), this.x + 24, this.y + 6); + } + + if (threeHourAvrPressure != undefined && threeHourAvrPressure > 0) { + g.drawString(Math.round(threeHourAvrPressure), this.x + 24, this.y + 6 + 10); + } } }