W1 temp sensor can have different properties. Adjusting (#2737)
This commit is contained in:
parent
fd5688314c
commit
61b87bee74
@ -106,10 +106,9 @@ function ambienttemp() {
|
||||
amb_temp=$(awk '{printf("%d",$1/1000)}' <<<${raw_temp})
|
||||
echo $amb_temp
|
||||
elif [[ -d $W1_DIR && $ONE_WIRE == yes ]]; then
|
||||
device=$(ls -1 $W1_DIR | grep -Eo '^[0-9]{1,4}' | head -1)
|
||||
device=$(ls -1 $W1_DIR | grep -E '^[0-9]{1,4}' | head -1)
|
||||
if [[ -n $device ]]; then
|
||||
if [[ -d ${W1_DIR}${device}/hwmon/hwmon0 ]]; then hwmon=0; else hwmon=1; fi
|
||||
read raw_temp < ${W1_DIR}${device}/hwmon/hwmon${hwmon}/temp1_input 2>/dev/null
|
||||
read raw_temp < ${W1_DIR}${device}/hwmon/$(ls -1 ${W1_DIR}${device}/hwmon)/temp1_input 2>/dev/null
|
||||
amb_temp=$(awk '{printf("%d",$1/1000)}' <<<${raw_temp})
|
||||
echo $amb_temp
|
||||
fi
|
||||
|
||||
Loading…
Reference in New Issue
Block a user