Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion sensors/sensors_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,14 @@ func getTemperature(smc *common.SMC, key string) float64 {
}

if result.dataSize == 2 && result.dataType == toUint32(dataTypeSp78) {
return 0.0
// sp78: signed 7.8 fixed-point — high byte is signed integer degrees,
// low byte is fractional part in 1/256 increments.
// Previously this branch incorrectly returned 0.0, causing all SMC
// temperature sensors on Intel Macs to report 0°C.
return float64(int8(result.data[0])) + float64(result.data[1])/256.0
}

// Non-sp78 single-byte readings (legacy/unknown formats)
return float64(result.data[0])
}

Expand Down
Loading