Update temp.inc.sh
This commit is contained in:
@@ -177,13 +177,14 @@ CHECKTEMPSENSOR(){
|
|||||||
echo ${mqtt_message} | cut -d':' -f 6 | cut -d',' -f 1 | read temp_c
|
echo ${mqtt_message} | cut -d':' -f 6 | cut -d',' -f 1 | read temp_c
|
||||||
|
|
||||||
elif [ "${PW_SENSOR_TYPE[${1}]}" == "lacrosse" ]; then
|
elif [ "${PW_SENSOR_TYPE[${1}]}" == "lacrosse" ]; then
|
||||||
INFO=$(curl -m 7 -s --get -d "deviceid=${PW_LACROSSE_ID[${SENSOR}]}" -d "limit=1" -d "metric=1" -d "timezone=2" https://decent-destiny-704.appspot.com/laxservices/device_info.php | jq)
|
INFO=$(curl -m 7 -s --get -d "deviceid=${PW_LACROSSE_ID[${SENSOR}]}" -d "limit=1" -d "metric=1" -d "timezone=2" https://decent-destiny-704.appspot.com/laxservices/device_info.php)
|
||||||
if [ "${INFO}" != "" ]; then
|
if [ "${INFO}" != "" ]; then
|
||||||
if [[ "${1}" = *"-Probe" ]]; then
|
if [[ "${1}" = *"-Probe" ]]; then
|
||||||
temp_c=`IDS_NUMBER_FORMAT $(echo ${INFO} | jq -r '.device0 .obs[].probe_temp') 2 yes`
|
temp_c=`IDS_NUMBER_FORMAT $(echo ${INFO} | jq -r '.device0 .obs[].probe_temp') 2 yes`
|
||||||
else
|
else
|
||||||
temp_c=`IDS_NUMBER_FORMAT $(echo ${INFO} | jq -r '.device0 .obs[].ambient_temp') 2 yes`
|
temp_c=`IDS_NUMBER_FORMAT $(echo ${INFO} | jq -r '.device0 .obs[].ambient_temp') 2 yes`
|
||||||
fi
|
fi
|
||||||
|
temp_timestamp=$(echo ${INFO} | jq -r '.device0 .obs[].timestamp')
|
||||||
else
|
else
|
||||||
temp_c=''
|
temp_c=''
|
||||||
fi
|
fi
|
||||||
@@ -274,7 +275,12 @@ CHECKTEMPSENSOR(){
|
|||||||
c=0; spc=''; spc1=`expr 12 - ${#tmp}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done
|
c=0; spc=''; spc1=`expr 12 - ${#tmp}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done
|
||||||
[ ${#temp_warn} == 2 ] && spcw=' ' || spcw=' '
|
[ ${#temp_warn} == 2 ] && spcw=' ' || spcw=' '
|
||||||
[ ${#temp_crit} == 2 ] && spcc=' ' || spcc=' '
|
[ ${#temp_crit} == 2 ] && spcc=' ' || spcc=' '
|
||||||
echo -e "${idsCL[Default]}${spc}[${spcw}${idsCL[Yellow]}${temp_warn_disp}${GAUGESH}${idsCL[Default]} /${spcc}${idsCL[LightRed]}${temp_crit_disp}${GAUGESH}=>${idsCL[Default]} ]"
|
echo -en "${idsCL[Default]}${spc}[${spcw}${idsCL[Yellow]}${temp_warn_disp}${GAUGESH}${idsCL[Default]} /${spcc}${idsCL[LightRed]}${temp_crit_disp}${GAUGESH}=>${idsCL[Default]} ]"
|
||||||
|
if [ "${PW_SENSOR_TYPE[${1}]}" == "lacrosse" ]; then
|
||||||
|
echo -e " - ${temp_timestamp}"
|
||||||
|
else
|
||||||
|
echo
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo -e "${idsCL[Yellow]}Sensor Offline${idsCL[Default]}"
|
echo -e "${idsCL[Yellow]}Sensor Offline${idsCL[Default]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user