From f988c299dded74d7bbce4a54c42ebb439c8c4d40 Mon Sep 17 00:00:00 2001 From: Marco Heiming Date: Wed, 22 Jun 2022 14:25:46 +0200 Subject: [PATCH] Remove arrows from widget --- apps/widbaroalarm/README.md | 2 +- apps/widbaroalarm/widget.js | 21 +++------------------ 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/apps/widbaroalarm/README.md b/apps/widbaroalarm/README.md index 52f53921d..478b48a71 100644 --- a/apps/widbaroalarm/README.md +++ b/apps/widbaroalarm/README.md @@ -21,7 +21,7 @@ Get a notification when the pressure reaches defined thresholds. ## Widget The widget shows two rows: 1. pressure value of last measurement -2. difference of last measurement to pressure average of the the last three hours and an arrow indicating the trend +2. difference of last measurement to 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 14d29bcfb..81b663c15 100644 --- a/apps/widbaroalarm/widget.js +++ b/apps/widbaroalarm/widget.js @@ -251,7 +251,6 @@ function draw() { } g.drawString("...", x + 24, y + 6); - g.setFont("6x8", 1).setFontAlign(1, 0); g.drawString(Math.round(medianPressure), x + 24, y + 6); } else { g.drawString(Math.round(medianPressure), x + 24, y + 6); @@ -259,25 +258,11 @@ function draw() { if (threeHourAvrPressure == undefined) { calculcate3hAveragePressure(); - } + } if (threeHourAvrPressure != undefined) { if (medianPressure != undefined) { - let icon; - - const diff = threeHourAvrPressure - medianPressure; - - if (diff == 0) { - icon = atob("DAyBAAAAAAAAIAEAGD+AEAIAAAAAAA=="); // allow right - } else { - if (diff < 0) { - icon = atob("DAyBAAAAAAAAfAHALATAgBAAAAAAAA=="); // arrow up - } else { - icon = atob("DAyBAAAAAAABAAgATALAHAHAeAAAAA=="); // arrow down - } - } - - g.drawImage(icon, x, y + 6 + 4); - g.drawString((diff < 0 ? "+" : "-" ) + Math.round(diff), x + 24, y + 6 + 10); + const diff = Math.round(medianPressure - threeHourAvrPressure); + g.drawString((diff > 0 ? "+" : "-") + diff, x + 24, y + 6 + 10); } } }