Remove arrows from widget

pull/1990/head
Marco Heiming 2022-06-22 14:25:46 +02:00
parent 1d7b98a5f4
commit f988c299dd
2 changed files with 4 additions and 19 deletions

View File

@ -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))

View File

@ -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);
}
}
}