update
This commit is contained in:
@@ -77,9 +77,13 @@ CHECKTEMP_SERVICE(){
|
||||
cw=20
|
||||
declare -A last_temp
|
||||
while true; do
|
||||
errtime=$(expr `date +%s` - $(stat -c %Y ${logtemp}))
|
||||
[ $errtime -ge 3600 ] && relog=1 || relog=0
|
||||
|
||||
for SENSOR in ${!SENSOR_ID[@]}; do
|
||||
logtemp=${LOGFOLDER}/log-temp-${SENSOR}
|
||||
[ ! -f ${logtemp} ] && touch ${logtemp}
|
||||
errtime=$(expr `date +%s` - $(stat -c %Y ${logtemp}))
|
||||
[ $errtime -ge 3600 ] && relog=1 || relog=0
|
||||
|
||||
if [ "${SENSOR_TYPE[${SENSOR}]}" == "mqtt" ]; then
|
||||
mqtt_message=`${mqtt_conn} -t tele/${SENSOR}/SENSOR -C 1`
|
||||
echo $mqtt_message | cut -d':' -f 7 | cut -d',' -f 1 | read temp_h
|
||||
|
||||
Reference in New Issue
Block a user