Skip to content

Commit

Permalink
Oops, fix degree celsius unit output for M1/HID sensor readouts.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkorunic committed Apr 7, 2022
1 parent f249c32 commit e3e9f3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion hid/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,5 +214,5 @@ func PrintTemp(t table.Writer) {
cStr := C.getThermals()
defer C.free(unsafe.Pointer(cStr))

printGeneric(t, "C", cStr)
printGeneric(t, "°C", cStr)
}
10 changes: 5 additions & 5 deletions smc/smc.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type SensorStat struct {
//go:generate ./gen-sensors.sh sensors.go

// printGeneric prints a table of SMC keys, description and decoded values with units.
func printGeneric(t table.Writer, desc, unit string, smcSlice []SensorStat) {
func printGeneric(t table.Writer, unit string, smcSlice []SensorStat) {
c, res := gosmc.SMCOpen(AppleSMC)
if res != gosmc.IOReturnSuccess {
log.Errorf("unable to open Apple SMC; return code %v\n", res)
Expand Down Expand Up @@ -99,22 +99,22 @@ func getKeyAndPrint(t table.Writer, c uint, key string, desc string, unit string

// PrintTemp prints detected temperature sensor results.
func PrintTemp(t table.Writer) {
printGeneric(t, "Temperature:", "°C", AppleTemp)
printGeneric(t, "°C", AppleTemp)
}

// PrintPower prints detected power sensor results.
func PrintPower(t table.Writer) {
printGeneric(t, "Power:", "W", ApplePower)
printGeneric(t, "W", ApplePower)
}

// PrintVoltage prints detected voltage sensor results.
func PrintVoltage(t table.Writer) {
printGeneric(t, "Voltage:", "V", AppleVoltage)
printGeneric(t, "V", AppleVoltage)
}

// PrintCurrent prints detected current sensor results.
func PrintCurrent(t table.Writer) {
printGeneric(t, "Current:", "A", AppleCurrent)
printGeneric(t, "A", AppleCurrent)
}

// PrintFans prints detected fan results.
Expand Down

0 comments on commit e3e9f3f

Please sign in to comment.