Update temp.inc.sh

This commit is contained in:
2024-04-21 14:30:56 -05:00
parent f7b0a9414f
commit e3b22d4b9f

View File

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