Update temp.inc.sh

This commit is contained in:
2023-12-17 10:12:23 -06:00
parent 96f885b0c0
commit 55627aecd2

View File

@@ -482,11 +482,13 @@ Previous Temp: ${last_temp[${SENSOR//-/}]}${GAUGESH}"
#### LOGGING OF SERVERROOM SENSOR DIFFERENCE #### LOGGING OF SERVERROOM SENSOR DIFFERENCE
if [ "${SENSOR}" == "ServerRoomLA" ]; then if [ "${SENSOR}" == "ServerRoomLA" ]; then
if [ ! -f ${PW_TMPFOLDER}/.log.sr.difference ] || [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.log.sr.difference)) -ge 10 ]; then if [ ! -f ${PW_TMPFOLDER}/.log.sr.difference ] || [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.log.sr.difference)) -ge 10 ]; then
[ ! -f ${PW_TMPFOLDER}/.log.sr.difference ] && touch ${PW_TMPFOLDER}/.log.sr.difference if [ "${temp_probe_f}" != "" ] && [ "${ServerRoomTH}" != "" ]; then
temp_difference=$(bc <<< "scale=1; ${temp_probe_f}-${ServerRoomTH}") [ ! -f ${PW_TMPFOLDER}/.log.sr.difference ] && touch ${PW_TMPFOLDER}/.log.sr.difference
(( $(bc <<<"${temp_difference} < 0") )) && temp_difference=`echo "scale=1; ${temp_difference} * -1" | bc` temp_difference=$(bc <<< "scale=1; ${temp_probe_f}-${ServerRoomTH}")
echo "HERE: ${temp_probe_f} - ${ServerRoomTH} = ${temp_difference}" (( $(bc <<<"${temp_difference} < 0") )) && temp_difference=`echo "scale=1; ${temp_difference} * -1" | bc`
echo ${temp_difference} >> ${PW_TMPFOLDER}/.log.sr.difference echo "HERE: ${temp_probe_f} - ${ServerRoomTH} = ${temp_difference}"
echo ${temp_difference} >> ${PW_TMPFOLDER}/.log.sr.difference
fi
fi fi
elif [ "${SENSOR}" == "ServerRoomTH" ]; then elif [ "${SENSOR}" == "ServerRoomTH" ]; then
ServerRoomTH=${temp_f} ServerRoomTH=${temp_f}