From df14efcffab783572a581893916d6242d3982a51 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 26 Feb 2024 17:27:37 -0600 Subject: [PATCH] update --- defaults.inc | 2 +- inc/temp.inc.sh | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/defaults.inc b/defaults.inc index 53de483b..1cae75c5 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERS='2.6.50-02252024' +VERS='2.6.52-02262024' noheader=' update service dailytemp confsync -r -report ' diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index f828b665..349070b3 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -83,6 +83,7 @@ CHECKTEMP(){ fi DIVIDER . yellow ${PRI_WIDTH} for SENSOR in ${PW_SENSOR_ORD[@]}; do + [ "${PW_DESC_TEMP[${SENSOR}]}" != "" ] && SENSOR_DESC=${PW_DESC_TEMP[${SENSOR}]} || SENSOR_DESC=${SENSOR} if [ "${PW_SENSOR_TYPE[${SENSOR}]}" != "esxi" ] && ([ "${search}" == "" ] || [[ "${SENSOR,,}" = *"${search,,}"* ]]) && ([ "${STYPE}" = "" ] || ([ "${STYPE}" = "mainsite" ] && ([ "${PW_REMOTE_SENSORS[${SENSOR}]}" = "" ] || [ "${PW_REMOTE_SENSORS[${SENSOR}]}" = "127.0.0.1" ] || [[ "${PW_REMOTE_SENSORS[${SENSOR}]}" = *"10.10."* ]])) || ([ "${STYPE}" = "offsite" ] && [ "${PW_REMOTE_SENSORS[${SENSOR}]}" != "" ] && [[ "${PW_REMOTE_SENSORS[${SENSOR}]}" = *"10.2.1."* ]])) && ([ "${TTYPE}" != "fans" ] || ([ "${TTYPE}" == "fans" ] && [[ "${SENSOR}" = *"Room"* ]])); then if [ "${PW_THRESHOLDS[${SENSOR}]}" != "" ]; then echo ${PW_THRESHOLDS[${SENSOR}]} | cut -d',' -f 1 | read temp_warn @@ -106,8 +107,8 @@ CHECKTEMP(){ fi [ "${last_sensor%%-*}" == "${SENSOR%%-*}" ] && [ "${last_sensor}" != "Offsite-ServerRoom" ] && [ "${last_sensor}" != "Powerwall-Switch" ] && echo -en "\033[1A" - c=0; spc=''; spc1=`expr ${cw} - ${#SENSOR}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done - echo -en "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR}${idsST[Reset]}${spc}${idsCL[Default]}: ${idsCL[Yellow]}Pulling data ... " + c=0; spc=''; spc1=`expr ${cw} - ${#SENSOR_DESC}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done + echo -en "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR_DESC}${idsST[Reset]}${spc}${idsCL[Default]}: ${idsCL[Yellow]}Pulling data ... " if [ ! -f ${PW_TMPFOLDER}/${SENSOR}.down ]; then IFS=: read -r temp_f temp_h <<< $(CHECKTEMPSENSOR ${SENSOR}); unset IFS if [ "${temp_f}" != "timeout" ] && [ "${temp_f}" != "offline" ]; then @@ -141,7 +142,7 @@ CHECKTEMP(){ fi - echo -en "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR}${idsST[Reset]}${spc}${idsCL[Default]}: ${reading}${idsCL[Default]}" + echo -en "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR_DESC}${idsST[Reset]}${spc}${idsCL[Default]}: ${reading}${idsCL[Default]}" if [ "${avgdays}" != "noavg" ]; then echo -en " / ${idsCL[Yellow]}Calculating ${avgdays_disp} average ... " average=$(AVERAGETEMP ${SENSOR} ${avgdays}) @@ -156,7 +157,7 @@ CHECKTEMP(){ else averagedisp="${idsCL[Green]}${average_disp}" fi - echo -en "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR}${idsST[Reset]}${spc}${idsCL[Default]}: ${reading} ${idsCL[Default]}/${spca}${averagedisp}${GAUGESH}" + echo -en "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR_DESC}${idsST[Reset]}${spc}${idsCL[Default]}: ${reading} ${idsCL[Default]}/${spca}${averagedisp}${GAUGESH}" fi if ([ "${average}" != "" ] || [ "${temp_f}" != "" ]) && [[ "${SENSOR}" != *"FAN"* ]]; then if [ "${average}" != "" ]; then