Update temp.inc.sh
This commit is contained in:
@@ -711,15 +711,21 @@ CHECKTEMPSENSOR(){
|
|||||||
elif [ "${PW_SENSOR_TYPE[${1}]}" == "espdev" ]; then
|
elif [ "${PW_SENSOR_TYPE[${1}]}" == "espdev" ]; then
|
||||||
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=$(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 [ "${temp_c}" != "" ]; then
|
||||||
if [ "${1}" == "ServerRoom_Monitor_Front" ]; then
|
|
||||||
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`
|
if [ "${1}" == "ServerRoom_Monitor_Front" ] || [ "${1}" == "ServerRoom_Monitor_Back" ] || [ "${1}" == "ServerRoom-Above" ]; then
|
||||||
elif [ "${1}" == "ServerRoom_Monitor_Back" ]; then
|
|
||||||
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`
|
|
||||||
elif [ "${1}" == "ServerRoom-Above" ]; then
|
|
||||||
temp_h=`IDS_NUMBER_FORMAT $(curl -m 8 -s -u "${PW_ESP_USER}:${PW_ESP_PASS}" http://${PW_REMOTE_SENSORS[${1}]}:8090/sensor/above_serverroom_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`
|
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`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# if [ "${1}" == "ServerRoom_Monitor_Front" ]; then
|
||||||
|
# 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
|
||||||
|
# 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`
|
||||||
|
# elif [ "${1}" == "ServerRoom-Above" ]; then
|
||||||
|
# temp_h=`IDS_NUMBER_FORMAT $(curl -m 8 -s -u "${PW_ESP_USER}:${PW_ESP_PASS}" http://${PW_REMOTE_SENSORS[${1}]}:8090/sensor/above_serverroom_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`
|
||||||
|
# fi
|
||||||
fi
|
fi
|
||||||
elif [ "${PW_SENSOR_TYPE[${1}]}" == "tuya" ]; then
|
elif [ "${PW_SENSOR_TYPE[${1}]}" == "tuya" ]; then
|
||||||
IFS=: read -r temp_c temp_h <<< $(GET_TUYA_TEMP ${1}); unset IFS
|
IFS=: read -r temp_c temp_h <<< $(GET_TUYA_TEMP ${1}); unset IFS
|
||||||
|
|||||||
Reference in New Issue
Block a user