Update powerwall.sh

This commit is contained in:
2023-10-30 14:11:38 -05:00
parent b28e15cf4f
commit de096010f6

View File

@@ -95,10 +95,11 @@ 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
if [ "${6}" != "noavg" ]; then
[ "${6}" != "" ] && avgdays=${6} || avgdays=3
if [ "${PW_SENSOR_TYPE[${1}]}" != "esxi" ]; then
average=$(AVERAGETEMP ${PW_SENSOR_ID[${1}]} 3)
average=$(AVERAGETEMP ${PW_SENSOR_ID[${1}]} ${avgdays})
else
average=$(AVERAGETEMP ${PW_SENSOR_ID[${1}]} 3 ${5})
average=$(AVERAGETEMP ${PW_SENSOR_ID[${1}]} ${avgdays} ${5})
fi
else
average=''