diff --git a/defaults.inc b/defaults.inc index 725833a2..ec472dc3 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERS='2.3.22-10282023' +VERS='2.3.24-10302023' noheader=' update service dailytemp ' diff --git a/powerwall.sh b/powerwall.sh index 5885db7b..7db79128 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -95,7 +95,7 @@ CHECKTEMP(){ CHECKTEMPSENSOR(){ echo ${PW_TEMP_THRESHOLDS[${1}]} | cut -d',' -f 1 | read temp_warn echo ${PW_TEMP_THRESHOLDS[${1}]} | cut -d',' -f 2 | read temp_crit - [ "${1}" != "noavg" ] && ([ "${PW_SENSOR_TYPE[${1}]}" != "esxi" ] && average=$(AVERAGETEMP ${PW_SENSOR_ID[${1}]} 3) || average=$(AVERAGETEMP ${PW_SENSOR_ID[${1}]} 3 ${5})) + [ "${6}" != "noavg" ] && ([ "${PW_SENSOR_TYPE[${1}]}" != "esxi" ] && average=$(AVERAGETEMP ${PW_SENSOR_ID[${1}]} 3) || average=$(AVERAGETEMP ${PW_SENSOR_ID[${1}]} 3 ${5})) if [ "${PW_SENSOR_TYPE[${1}]}" == "mqtt" ]; then mqtt_message=`${mqtt_conn} -t tele/${1}/SENSOR -C 1` @@ -123,7 +123,7 @@ CHECKTEMPSENSOR(){ #echo "$temp_c -> $temp_f" c=0; spct=''; spc1=`expr 6 - ${#temp_f}`; until [ $c = ${spc1} ]; do spct="${spct} "; c=`expr ${c} + 1`; done - if [ "${1}" != "noavg" ]; then + if [ "${6}" != "noavg" ]; then c=0; spca=''; spc1=`expr 6 - ${#average}`; until [ $c = ${spc1} ]; do spca="${spca} "; c=`expr ${c} + 1`; done if [ "${average}" == "" ]; then averagedisp="${idsCL[Green]}"