From 4b2fe57ba4e7c36ecec42a4fed1970797a4e2a94 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 24 Feb 2024 09:45:04 -0600 Subject: [PATCH] Update temp.inc.sh --- inc/temp.inc.sh | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index 32f67d7d..8bc28093 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -103,9 +103,18 @@ CHECKTEMP(){ else averagedisp="${idsCL[Green]}${average_disp}" fi - echo -e "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR}${idsST[Reset]}${spc}${idsCL[Default]}: ${reading} /${spca}${averagedisp}${GAUGESH}${idsCL[Default]}" + echo -en "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR}${idsST[Reset]}${spc}${idsCL[Default]}: ${reading} /${spca}${averagedisp}${GAUGESH}" + fi + if [ "${average}" != "" ] || ([ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ]) && [[ "${1}" != *"FAN"* ]]; then + tmp="${spct}${temp_f_disp}${GAUGESH}" + [ "${average}" != "" ] && fws=11 || fws=21 + c=0; spc=''; spc1=`expr ${fws} - ${#tmp}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done + [ ${#temp_warn} == 2 ] && spcw=' ' || spcw=' ' + [ ${#temp_crit} == 2 ] && spcc=' ' || spcc=' ' + echo -e "${idsCL[Default]}${spc}[${spcw}${idsCL[Yellow]}${temp_warn_disp}${GAUGESH}${idsCL[Default]} /${spcc}${idsCL[LightRed]}${temp_crit_disp}${GAUGESH}=>${idsCL[Default]} ]" + [ "${PW_SENSOR_TYPE[${1}]}" == "lacrosse" ] && [[ "${1}" != *"-ProbeXXX" ]] && echo -e " - $(echo ${INFO} | jq -r '.device0 .obs[].timestamp')" || echo else - echo + echo -e "${idsCL[Default]}" fi else if [ "${avgdays}" != "noavg" ]; then @@ -370,16 +379,16 @@ CHECKTEMPSENSOR(){ else echo -en "${idsCL[Yellow]}Sensor Offline${idsCL[Default]}" fi - [ "${average}" != "" ] && echo -en " /${spca}${averagedisp}${GAUGESH}" - if [ "${average}" != "" ] || ([ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ]) && [[ "${1}" != *"FAN"* ]]; then - tmp="${spct}${temp_f_disp}${GAUGESH}" - [ "${average}" != "" ] && fws=11 || fws=21 - c=0; spc=''; spc1=`expr ${fws} - ${#tmp}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done - [ ${#temp_warn} == 2 ] && spcw=' ' || spcw=' ' - [ ${#temp_crit} == 2 ] && spcc=' ' || spcc=' ' - echo -en "${idsCL[Default]}${spc}[${spcw}${idsCL[Yellow]}${temp_warn_disp}${GAUGESH}${idsCL[Default]} /${spcc}${idsCL[LightRed]}${temp_crit_disp}${GAUGESH}=>${idsCL[Default]} ]" - [ "${PW_SENSOR_TYPE[${1}]}" == "lacrosse" ] && [[ "${1}" != *"-ProbeXXX" ]] && echo -e " - $(echo ${INFO} | jq -r '.device0 .obs[].timestamp')" || echo - fi + # [ "${average}" != "" ] && echo -en " /${spca}${averagedisp}${GAUGESH}" + # if [ "${average}" != "" ] || ([ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ]) && [[ "${1}" != *"FAN"* ]]; then + # tmp="${spct}${temp_f_disp}${GAUGESH}" + # [ "${average}" != "" ] && fws=11 || fws=21 + # c=0; spc=''; spc1=`expr ${fws} - ${#tmp}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done + # [ ${#temp_warn} == 2 ] && spcw=' ' || spcw=' ' + # [ ${#temp_crit} == 2 ] && spcc=' ' || spcc=' ' + # echo -en "${idsCL[Default]}${spc}[${spcw}${idsCL[Yellow]}${temp_warn_disp}${GAUGESH}${idsCL[Default]} /${spcc}${idsCL[LightRed]}${temp_crit_disp}${GAUGESH}=>${idsCL[Default]} ]" + # [ "${PW_SENSOR_TYPE[${1}]}" == "lacrosse" ] && [[ "${1}" != *"-ProbeXXX" ]] && echo -e " - $(echo ${INFO} | jq -r '.device0 .obs[].timestamp')" || echo + # fi } AVERAGETEMP(){ temptotal=0