Update temp.inc.sh

This commit is contained in:
2023-12-26 13:46:04 -06:00
parent 96624271a2
commit 344d97a9ba

View File

@@ -119,16 +119,12 @@ 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)
@@ -162,8 +158,8 @@ CHECKTEMPSENSOR(){
fi
(( $(bc <<<"${temp_f} < 1") )) && [[ "${temp_f}" = *"."* ]] && temp_f="0${temp_f}"
fi
echo "HERE: '${temp_c}' -> '${temp_f}'"
echo -en ""
# echo "HERE: '${temp_c}' -> '${temp_f}'"
# echo -en ""
c=0; spct=''; spc1=`expr 6 - ${#temp_f}`; until [ ${c} = ${spc1} ]; do spct="${spct} "; c=`expr ${c} + 1`; done
if [ "${average}" != "" ]; then