added name of sensor
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 26 Aug 2020 12:19:43 +0000 (14:19 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 26 Aug 2020 12:19:43 +0000 (14:19 +0200)
w1-ds18b20.sh

index 83a42e9..7c531f9 100755 (executable)
@@ -5,7 +5,8 @@ ls /sys/bus/w1/devices/w1_bus_master*/*-*/w1_slave | while read path ; do
        if [ $temp != 85000 ] ; then # 85 is error
                temp=$( echo $temp | awk '{ printf "%.3f\n", $1 / 1000 }' )
                id=$( echo $path | cut -d/ -f 7 )
-               echo -n "$id "
+               name=$( grep "^$id" id2name.txt | cut -d' ' -f2 )
+               echo -n "$id $name "
                echo $temp | tee /dev/shm/ds18b20.$id
        fi
 done