That message is output as a result of seeing I/O on partition 1 of the device.  That is, code has detected I/O counters have incremented since the last time they were checked (polled every second).  If there has been I/O to partition 1 then we assume the device must be spun-up.  The 'read SMART' command is then issued to get the device temperature.   Specifically it looks at /sys/block/sdb/sdb1/stat   Then adds the 3rd and 7th values (sectors read and sectors written).