Update temp.inc.sh

This commit is contained in:
2024-05-12 14:59:07 -05:00
parent 2df920236f
commit 8ba3d2e861

View File

@@ -287,8 +287,8 @@ CHECKTEMP(){
lico=" "
OLD_temp_h=($(${mysql_conn} -e "SELECT hum,date FROM servermonitor.sensor_data WHERE sensorid='${PW_SENSOR_ID[${SENSOR}]}' AND date >= DATE_SUB(NOW(), INTERVAL ${M} MINUTE) AND date <= DATE_SUB(NOW(), INTERVAL $(expr ${M} - 7) MINUTE) ORDER BY date ASC LIMIT 1"))
OLD_temp_h=${OLD_temp_h[2]}
OLD_date=${OLD_temp_f[3]}
OLD_time=${OLD_temp_f[4]}
OLD_date=${OLD_temp_h[3]}
OLD_time=${OLD_temp_h[4]}
if [ "${OLD_temp_h}" != "" ]; then
if [ $(bc -l <<< "${temp_h} < $(echo "scale=2; ${OLD_temp_h}+${PW_TEMPIND_DIFF}" | bc)") -eq 1 ] && [ $(bc -l <<< "$(echo "scale=2; ${OLD_temp_h}-${PW_TEMPIND_DIFF}" | bc) < ${temp_h}") -eq 1 ]; then
lclr="${idsCL[White]}"