Update temp.inc.sh

This commit is contained in:
2025-09-13 19:42:26 -05:00
parent 92e45f82f6
commit ea77c9a103

View File

@@ -126,6 +126,7 @@ CHECKTEMP(){
[ ${REPORT} -eq 0 ] && echo -en "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR_DESC}${idsST[Reset]}${spc}${idsCL[Default]}: ${idsCL[Yellow]}Pulling data ... "
if [ ! -f ${PW_TMPFOLDER}/${SENSOR}.down ]; then
CHECKTEMPSENSOR ${SENSOR}
IFS=: read -r temp_f temp_h <<< $(CHECKTEMPSENSOR ${SENSOR}); unset IFS
if [ "${temp_f}" != "timeout" ] && [ "${temp_f}" != "offline" ]; then
[ "${PW_SENSOR_TYPE[${SENSOR}]}" == "system" ] && [[ "${SENSOR}" = *"FAN"* ]] && temp_f_disp=$(IDS_NUMBER_FORMAT ${temp_f} 0) || temp_f_disp=${temp_f}
@@ -711,8 +712,10 @@ CHECKTEMPSENSOR(){
if ! temp_c=$(curl -m 8 -s -u "${PW_ESP_USER}:${PW_ESP_PASS}" http://${PW_REMOTE_SENSORS[${1}]}:8090/sensor/${PW_SENSOR_DEVICEID[${1}]} | jq '.value'); then TIMEOUT=1; fi
if [ "${temp_c}" != "" ]; then
if [ "${1}" == "ServerRoom_Monitor_Front" ]; then
echo "http://${PW_REMOTE_SENSORS[${1}]}:8090/sensor/front_humidity} "
temp_h=`IDS_NUMBER_FORMAT $(curl -m 8 -s -u "${PW_ESP_USER}:${PW_ESP_PASS}" http://${PW_REMOTE_SENSORS[${1}]}:8090/sensor/front_humidity} | jq '.value') 2 yes`
elif [ "${1}" == "ServerRoom_Monitor_Back" ]; then
echo "http://${PW_REMOTE_SENSORS[${1}]}:8090/sensor/front_humidity} "
temp_h=`IDS_NUMBER_FORMAT $(curl -m 8 -s -u "${PW_ESP_USER}:${PW_ESP_PASS}" http://${PW_REMOTE_SENSORS[${1}]}:8090/sensor/back_humidity} | jq '.value') 2 yes`
else
temp_h=`IDS_NUMBER_FORMAT $(curl -m 8 -s -u "${PW_ESP_USER}:${PW_ESP_PASS}" http://${PW_REMOTE_SENSORS[${1}]}:8090/sensor/${PW_SENSOR_DEVICEID[${1}]/temperature/humidity} | jq '.value') 2 yes`