Update powerwall.sh

This commit is contained in:
2023-08-14 18:30:28 -05:00
parent 94998fec76
commit 7777d224df

View File

@@ -21,13 +21,9 @@ CHECKTEMP(){
# echo -e "${idsCL[Yellow]}Sensor Temperature(s) ${idsCL[Green]}normal${idsCL[Default]} /${idsCL[Yellow]}warning${idsCL[Default]}/ ${idsCL[Red]}critical${idsCL[Default]}" # echo -e "${idsCL[Yellow]}Sensor Temperature(s) ${idsCL[Green]}normal${idsCL[Default]} /${idsCL[Yellow]}warning${idsCL[Default]}/ ${idsCL[Red]}critical${idsCL[Default]}"
echo -e "${idsCL[Cyan]}Sensor Temperature(s) Current / 3DayAVG ${idsCL[Green]}normal${idsCL[Default]} /${idsCL[Yellow]}warning${idsCL[Default]}/ ${idsCL[Red]}critical${idsCL[Default]}" echo -e "${idsCL[Cyan]}Sensor Temperature(s) Current / 3DayAVG ${idsCL[Green]}normal${idsCL[Default]} /${idsCL[Yellow]}warning${idsCL[Default]}/ ${idsCL[Red]}critical${idsCL[Default]}"
DIVIDER . yellow 85 DIVIDER . yellow 85
if [ "${1}" != "" ]; then
# reading=$(CHECKTEMPSENSOR ${1})
# c=0; spc=''; spc1=`expr ${cw} - ${#1}`; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
# echo -e "${idsCL[LightCyan]}${1}${spc}${idsCL[Default]}: ${reading}"
for SENSOR in ${!PW_SENSOR_ID[@]}; do for SENSOR in ${!PW_SENSOR_ID[@]}; do
if [[ "${SENSOR}" = *"${1}"* ]]; then if [ "${1}" == "" ] || [[ "${SENSOR}" = *"${1}"* ]]; then
echo -en "${idsCL[Yellow]}Pulling data and calculating averages for '${SENSOR}' ..." echo -en "${idsCL[Yellow]}Pulling data and calculating averages for '${SENSOR}' ..."
if [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "esxi" ]; then if [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "esxi" ]; then
@@ -67,14 +63,6 @@ CHECKTEMP(){
fi fi
done done
else
for SENSOR in ${!PW_SENSOR_ID[@]}; do
echo -en "${idsCL[Yellow]}Pulling data and calculating averages for '${SENSOR}' ..."
reading=$(CHECKTEMPSENSOR ${SENSOR})
c=0; spc=''; spc1=`expr ${cw} - ${#SENSOR}`; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo -e "\r\033[K${idsCL[LightCyan]}${SENSOR}${spc}${idsCL[Default]}: ${reading}"
done
fi
[ "${action}" != "" ] && echo [ "${action}" != "" ] && echo
} }