Update temp.inc.sh

This commit is contained in:
2023-12-29 16:04:37 -06:00
parent 7407c83c9d
commit 6a1a34c6c5

View File

@@ -306,10 +306,11 @@ AVERAGETEMP(){
CHECKTEMP_SERVICE(){
cw=20
declare -A last_temp
runEvery=10 #SECONDS
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - 'Check Temp' Service Startup" >> ${PW_LOGFILE}
SENDTEMPS "TEMP Service Startup" &
while true; do
start=$(date +%s); echo starting
start=$(date +%s)
source ${PW_FOLDER}/defaults.inc
# time="$(date +%H)$(date +%M)"
@@ -339,9 +340,9 @@ CHECKTEMP_SERVICE(){
fi
done
end=`date +%s`; runtime=$((end-start))
echo -e "Runtime: ${runtime}s"
[ ${runtime} -lt 10 ] && echo "Sleeping for $(expr 10 - ${runtime})s"
[ ${runtime} -lt 10 ] && sleep $(expr 10 - ${runtime})s
# echo -e "Runtime: ${runtime}s"
[ ${runtime} -lt ${runEvery} ] && echo "Sleeping for $(expr ${runEvery} - ${runtime})s"
[ ${runtime} -lt ${runEvery} ] && sleep $(expr ${runEvery} - ${runtime})s
done # &
${PW_TMPFOLDER}/zservicerun.${SENSORa}.done
}