fix temperature display
This commit is contained in:
parent
b52f44cf52
commit
beb80763d8
@ -305,11 +305,14 @@ get_temperature()
|
|||||||
local line=1
|
local line=1
|
||||||
QTEMP=$(at ${at_port} ${at_command} | grep "+QTEMP:")
|
QTEMP=$(at ${at_port} ${at_command} | grep "+QTEMP:")
|
||||||
for line in $( echo -e "$QTEMP" ); do
|
for line in $( echo -e "$QTEMP" ); do
|
||||||
temp=$(echo $line | grep -o "[0-9]\{1,3\}")
|
templine=$(echo $line | grep -o "[0-9]\{1,3\}")
|
||||||
|
for tmp in $(echo $templine); do
|
||||||
|
[ "$tmp" -gt 0 ] && [ "$tmp" -lt 255 ] && temp=$tmp
|
||||||
if [ -n "$temp" ]; then
|
if [ -n "$temp" ]; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
done
|
||||||
if [ -n "$temp" ]; then
|
if [ -n "$temp" ]; then
|
||||||
temp="${temp}$(printf "\xc2\xb0")C"
|
temp="${temp}$(printf "\xc2\xb0")C"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user