Update temp.inc.sh

This commit is contained in:
2023-12-17 22:22:46 -06:00
parent 9866be840b
commit 0bfe14570d

View File

@@ -496,9 +496,9 @@ Previous Temp: ${last_temp[${SENSOR//-/}]}${GAUGESH}"
#### LOGGING OF SERVERROOM SENSOR DIFFERENCE
if [ "${SENSOR}" == "ServerRoomLA" ]; then
if [ ! -f ${PW_TMPFOLDER}/.log.sr.difference ] || [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.log.sr.difference)) -ge 300 ]; then
if [ "${temp_f}" != "" ] && [ "${ServerRoomTH}" != "" ]; then
if [ "${temp_probe_f}" != "" ] && [ "${ServerRoomTH}" != "" ]; then
[ ! -f ${PW_TMPFOLDER}/.log.sr.difference ] && touch ${PW_TMPFOLDER}/.log.sr.difference
temp_difference=$(bc <<< "scale=2; ${ServerRoomTH}-${temp_f}")
temp_difference=$(bc <<< "scale=2; ${ServerRoomTH}-${temp_probe_f}")
# (( $(bc <<<"${temp_difference} < 0") )) && temp_difference=`echo "scale=2; ${temp_difference} * -1" | bc`
echo "$(date "+%Y-%m-%d %H:%M:%S")~${temp_difference}" >> ${PW_TMPFOLDER}/.log.sr.difference
fi