From 508b1b68e59eed709d0f74644fd2751e0d3da4b8 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 21 Apr 2024 14:57:24 -0500 Subject: [PATCH] Update temp.inc.sh --- inc/temp.inc.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index dc3c45aa..8984e540 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -299,20 +299,19 @@ CHECKTEMP(){ c=0; spct=''; spc1=`expr 7 - ${#temp_f}`; until [ ${c} = ${spc1} ]; do spct="${spct} "; c=`expr ${c} + 1`; done reading="${lclr}${lmd}${spct}${temp_f}${GAUGESH}" echo -en "${idsCL[LightCyan]} ${sensorname}${spc}${idsCL[Default]}: ${reading}" - - echo " HERE: $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old | cut -d'~' -f 1) (${temp_f})" - + if [ -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old ]; then if [ $(bc -l <<< "$(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old | cut -d'~' -f 1) < ${temp_f}") -eq 1 ]; then - reading="${reading} ${idsCL[LightRed]}\u2B06 " + echo -en "${reading} ${idsCL[LightRed]}\u2B06 " elif [ $(bc -l <<< "${temp_f} < $(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old | cut -d'~' -f 1)") -eq 1 ]; then - reading="${reading} ${idsCL[LightGreen]}\u2B07 " + echo -en " ${idsCL[LightGreen]}\u2B07 " elif [ "${temp_f}" == "$(cat ${PW_TMPFOLDER}/.lastinsert/${SENSOR}-${sensorname// /_}.old | cut -d'~' -f 1)" ]; then - reading="${reading} ${idsCL[LightCyan]}${idsST[Bold]}~${idsST[Reset]} " + echo -en " ${idsCL[LightCyan]}${idsST[Bold]}~${idsST[Reset]} " else - reading="${reading} " + echo -en " " fi - fi + fi + if [ "${avgdays}" != "noavg" ]; then echo -en " / ${idsCL[Yellow]}Calculating ${avgdays_disp} average ... " average=$(AVERAGETEMP ${SENSOR} ${avgdays} ${sensorname// /_})