Update temp.inc.sh

This commit is contained in:
2023-12-26 13:42:04 -06:00
parent 170d5be584
commit 87217a6b21

View File

@@ -81,7 +81,7 @@ CHECKTEMP(){
reading=$(CHECKTEMPSENSOR ${SENSOR} . . . . ${avgdays})
echo -e "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR}${idsST[Reset]}${spc}${idsCL[Default]}: ${reading}${idsCL[Default]}"
else
echo -e "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR}${idsST[Reset]}${spc}${idsCL[Default]}: ${idsCL[Yellow]}Sensor Offline1${idsCL[Default]}"
echo -e "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR}${idsST[Reset]}${spc}${idsCL[Default]}: ${idsCL[Yellow]}Sensor Offline${idsCL[Default]}"
fi
echo
fi
@@ -119,12 +119,16 @@ CHECKTEMPSENSOR(){
temp_probe_c=`IDS_NUMBER_FORMAT $(echo ${INFO} | jq -r '.device0 .obs[].probe_temp') 2 yes`
elif [ "${PW_SENSOR_TYPE[${1}]}" == "system" ]; then
echo "H1: ${1}"
if [[ "${1}" = %"CPU"% ]]; then
echo 1
temp_c=$(vcgencmd measure_temp)
temp_c=${temp_c%\'*}; temp_c=${temp_c#*=}
elif [[ "${1}" = %"FAN"% ]]; then
echo 2
temp_c=$(cat /sys/class/hwmon/hwmon2/fan1_input)
fi
echo 3
elif [ "${PW_SENSOR_TYPE[${1}]}" == "remotesystem" ]; then
temp_c=$(ssh -q -o ConnectTimeout=1 -o ConnectionAttempts=1 root@${PW_REMOTE_SENSORS[${1}]} vcgencmd measure_temp)
@@ -221,7 +225,7 @@ CHECKTEMPSENSOR(){
fi
else
echo -e "${idsCL[Yellow]}Sensor Offline2${idsCL[Default]}"
echo -e "${idsCL[Yellow]}Sensor Offline${idsCL[Default]}"
fi
}
AVERAGETEMP(){