Remove arrows from widget
parent
1d7b98a5f4
commit
f988c299dd
|
|
@ -21,7 +21,7 @@ Get a notification when the pressure reaches defined thresholds.
|
||||||
## Widget
|
## Widget
|
||||||
The widget shows two rows:
|
The widget shows two rows:
|
||||||
1. pressure value of last measurement
|
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
|
## Creator
|
||||||
Marco ([myxor](https://github.com/myxor))
|
Marco ([myxor](https://github.com/myxor))
|
||||||
|
|
|
||||||
|
|
@ -251,7 +251,6 @@ function draw() {
|
||||||
}
|
}
|
||||||
|
|
||||||
g.drawString("...", x + 24, y + 6);
|
g.drawString("...", x + 24, y + 6);
|
||||||
g.setFont("6x8", 1).setFontAlign(1, 0);
|
|
||||||
g.drawString(Math.round(medianPressure), x + 24, y + 6);
|
g.drawString(Math.round(medianPressure), x + 24, y + 6);
|
||||||
} else {
|
} else {
|
||||||
g.drawString(Math.round(medianPressure), x + 24, y + 6);
|
g.drawString(Math.round(medianPressure), x + 24, y + 6);
|
||||||
|
|
@ -259,25 +258,11 @@ function draw() {
|
||||||
|
|
||||||
if (threeHourAvrPressure == undefined) {
|
if (threeHourAvrPressure == undefined) {
|
||||||
calculcate3hAveragePressure();
|
calculcate3hAveragePressure();
|
||||||
}
|
}
|
||||||
if (threeHourAvrPressure != undefined) {
|
if (threeHourAvrPressure != undefined) {
|
||||||
if (medianPressure != undefined) {
|
if (medianPressure != undefined) {
|
||||||
let icon;
|
const diff = Math.round(medianPressure - threeHourAvrPressure);
|
||||||
|
g.drawString((diff > 0 ? "+" : "-") + diff, x + 24, y + 6 + 10);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue