Update temp.inc.sh

This commit is contained in:
2023-12-22 19:59:55 -06:00
parent 3bce41a630
commit 7f7d613a73

View File

@@ -520,7 +520,7 @@ Previous Temp: ${last_temp[${SENSOR//-/}]}${GAUGESH}"
touch ${PW_TMPFOLDER}/${SENSOR}.down
touch ${PW_TMPFOLDER}/${SENSOR}-error.reading
SENDNOTICE "${SENSOR} Sensor ERROR" "ERROR reading sensor data" 1
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSOR} Sensor - ERROR reading sensor data" >> ${logtemp}
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSOR} Sensor - ERROR reading host data" >> ${logtemp}
fi
fi
done
@@ -530,7 +530,7 @@ Previous Temp: ${last_temp[${SENSOR//-/}]}${GAUGESH}"
[ ! -f ${PW_TMPFOLDER}/${SENSORa}.down ] && touch ${PW_TMPFOLDER}/${SENSORa}.down
if [ ! -f ${PW_TMPFOLDER}/${SENSORa}-error.reading ]; then
touch ${PW_TMPFOLDER}/${SENSORa}-error.reading
elif ([ ! -f ${PW_TMPFOLDER}/${SENSORa}-error.sent ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSORa}-error.reading)) -ge 60 ]) || ([ -f ${PW_TMPFOLDER}/${SENSORa}-error.sent ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSORa}-error.sent)) -ge $(echo "scale=0; ${PW_RENOTIFY_TIMEOUT}*60" | bc) ]); then
elif [ ! -f ${PW_TMPFOLDER}/${SENSORa}.disable ] && ([ ! -f ${PW_TMPFOLDER}/${SENSORa}-error.sent ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSORa}-error.reading)) -ge 60 ]) || ([ -f ${PW_TMPFOLDER}/${SENSORa}-error.sent ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSORa}-error.sent)) -ge $(echo "scale=0; ${PW_RENOTIFY_TIMEOUT}*60" | bc) ]); then
SENDNOTICE "${SENSORa} Sensor ERROR" "ERROR reading sensor data" 1
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSORa} Sensor - ERROR reading sensor data" >> ${logtemp}
touch ${PW_TMPFOLDER}/${SENSORa}-error.sent