From e3b22d4b9f472f938cd1d13cee04a2715d8fcfa1 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 21 Apr 2024 14:30:56 -0500 Subject: [PATCH] Update temp.inc.sh --- inc/temp.inc.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index c8aaf5a5..3fb436d3 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -126,6 +126,15 @@ CHECKTEMP(){ c=0; spct=''; [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "system" ] && [[ "${SENSOR}" = *"FAN"* ]] && spc1=`expr 6 - ${#temp_f}` || spc1=`expr 7 - ${#temp_f}` until [ ${c} = ${spc1} ]; do spct="${spct} "; c=`expr ${c} + 1`; done reading="${lclr}${lmd}${spct}${temp_f_disp}${GAUGESH}" + + if [ -f ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.old ]; then + if [ $(bc -l <<< "$(cat ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.old | cut -d'~' -f 1) < ${temp_f}") -eq 1 ]; then + reading="${reading}${idsCL[LightRed]}\u2B06" + elif [ $(bc -l <<< "${temp_f} < $(cat ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.old | cut -d'~' -f 1)") -eq 1 ]; then + reading="${reading}${idsCL[LightGreen]}\u2B07" + fi + fi + else temp_f_disp=" " lclr="${idsCL[Yellow]}" @@ -172,12 +181,14 @@ CHECKTEMP(){ [ ${#temp_crit} == 2 ] && spcc=' ' || spcc=' ' echo -en echo -en "${idsCL[Default]}${spc}[${spcw}${idsCL[Yellow]}${temp_warn_disp}${GAUGESH}${idsCL[Default]} /${spcc}${idsCL[LightRed]}${temp_crit_disp}${GAUGESH}=>${idsCL[Default]} ]" + if [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "lacrosse" ] && [[ "${SENSOR}" != *"-ProbeXXX" ]]; then INFO=$(curl -m 8 -s --get -d "deviceid=${PW_SENSOR_DEVICEID[${SENSOR}]}" -d "limit=1" -d "metric=1" -d "timezone=2" https://decent-destiny-704.appspot.com/laxservices/device_info.php) echo -e " - $(echo ${INFO} | jq -r '.device0 .obs[].timestamp')" else echo fi + else echo -e "${idsCL[Default]}" fi