Update temp.inc.sh

This commit is contained in:
2024-02-06 19:29:00 -06:00
parent 003429dc54
commit a5eb32f31f

View File

@@ -73,7 +73,7 @@ CHECKTEMP(){
DIVIDER . yellow ${PRI_WIDTH} DIVIDER . yellow ${PRI_WIDTH}
for SENSOR in ${PW_SENSOR_ORD[@]}; do for SENSOR in ${PW_SENSOR_ORD[@]}; do
if ([ "${search}" == "" ] || [[ "${SENSOR,,}" = *"${search,,}"* ]]) && [ "${PW_SENSOR_TYPE[${SENSOR}]}" != "esxi" ] && ([ "${temptype}" != "fans" ] || ([ "${temptype}" == "fans" ] && [[ "${SENSOR}" = *"Room"* ]])); then if ([ "${search}" == "" ] || [[ "${SENSOR,,}" = *"${search,,}"* ]]) && [ "${PW_SENSOR_TYPE[${SENSOR}]}" != "esxi" ] && ([ "${temptype}" != "fans" ] || ([ "${temptype}" == "fans" ] && [[ "${SENSOR}" = *"Room"* ]])); then
[ "${last_sensor}" == "${SENSOR%%-*}" ] && [ "${SENSOR}" != "Offsite-Monitor-CPU" ] && echo -en "\033[1A" [ "${last_sensor%%-*}" == "${SENSOR%%-*}" ] && [ "${last_sensor}" != "Offsite-ServerRoom" ] && echo -en "\033[1A"
c=0; spc=''; spc1=`expr ${cw} - ${#SENSOR}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done c=0; spc=''; spc1=`expr ${cw} - ${#SENSOR}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done
if [ ! -f ${PW_TMPFOLDER}/${SENSOR}.down ]; then if [ ! -f ${PW_TMPFOLDER}/${SENSOR}.down ]; then
echo -en "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR}${idsST[Reset]}${spc}${idsCL[Default]}: ${idsCL[Yellow]}" echo -en "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR}${idsST[Reset]}${spc}${idsCL[Default]}: ${idsCL[Yellow]}"
@@ -97,7 +97,7 @@ CHECKTEMP(){
echo -e "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR}${idsST[Reset]}${spc}${idsCL[Default]}: ${idsCL[Yellow]}Sensor Offline${idsCL[Default]}" echo -e "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR}${idsST[Reset]}${spc}${idsCL[Default]}: ${idsCL[Yellow]}Sensor Offline${idsCL[Default]}"
fi fi
echo echo
last_sensor=${SENSOR%%-*} last_sensor=${SENSOR}
fi fi
done done
DIVIDER . yellow ${PRI_WIDTH} DIVIDER . yellow ${PRI_WIDTH}
@@ -987,7 +987,7 @@ SENDTEMP(){
else else
GAUGESH="'F" GAUGESH="'F"
fi fi
[ "${last_sensor}" != "" ] && [ "${last_sensor}" != "${SENSOR%%-*}" ] && echo [ "${last_sensor}" != "" ] && [ "${last_sensor%%-*}" != "${SENSOR%%-*}" ] && echo
if [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "mqtt" ]; then if [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "mqtt" ]; then
mqtt_message=`${mqtt_conn} -t tele/${SENSORa}/SENSOR -C 1` mqtt_message=`${mqtt_conn} -t tele/${SENSORa}/SENSOR -C 1`
echo ${mqtt_message} | cut -d':' -f 6 | cut -d',' -f 1 | read temp_c echo ${mqtt_message} | cut -d':' -f 6 | cut -d',' -f 1 | read temp_c
@@ -1078,7 +1078,7 @@ SENDTEMP(){
echo -e "${SENSOR}${spc}No Data" echo -e "${SENSOR}${spc}No Data"
fi fi
last_sensor=${SENSORa%%-*} last_sensor=${SENSORa}
done done
fi fi