Skip to content

Commit

Permalink
Prevent transient error messages where no temperature is provided
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Gill <[email protected]>
  • Loading branch information
rrobgill committed Feb 24, 2025
1 parent a133415 commit 058a2ef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions padd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,10 @@ GetSystemInformation() {

# CPU temperature and unit
cpu_temp_raw=$(GetPADDValue sensors.cpu_temp)
cpu_temp=$(printf "%.1f" "${cpu_temp_raw}")
temp_unit=$(echo "${padd_data}" | GetPADDValue sensors.unit)
if [ $cpu_temp_raw != null ]; then
cpu_temp=$(printf "%.1f" "${cpu_temp_raw}")
temp_unit=$(echo "${padd_data}" | GetPADDValue sensors.unit)
fi

# Temp + Unit
if [ "${temp_unit}" = "C" ]; then
Expand Down

0 comments on commit 058a2ef

Please sign in to comment.