Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #274

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ fans:
- id: cpu
# The type of fan configuration, one of: hwmon | file
hwmon:
# The platform of the controller which is
# connected to this fan (see sensor.platform below)
# A regex matching a controller platform displayed by `fan2go detect`, f.ex.:
# "nouveau", "coretemp", "it8620", "corsaircpro-*" etc.
platform: nct6798
# The channel of this fan's RPM sensor as displayed by `fan2go detect`
rpmChannel: 1
Expand Down
10 changes: 5 additions & 5 deletions internal/hwmon/hwmon.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package hwmon
import (
"fmt"
"github.com/markusressel/fan2go/internal/ui"
"io/ioutil"
"os"
"path"
"path/filepath"
"regexp"
Expand Down Expand Up @@ -80,22 +80,22 @@ func GetChips() []*HwMonController {
// getDeviceName read the name of a device
func getDeviceName(devicePath string) string {
namePath := path.Join(devicePath, "name")
content, _ := ioutil.ReadFile(namePath)
content, _ := os.ReadFile(namePath)
name := string(content)
return strings.TrimSpace(name)
}

// getDeviceModalias read the modalias of a device
func getDeviceModalias(devicePath string) string {
modaliasPath := path.Join(devicePath, "device", "modalias")
content, _ := ioutil.ReadFile(modaliasPath)
content, _ := os.ReadFile(modaliasPath)
return strings.TrimSpace(string(content))
}

// getDeviceType read the type of a device
func getDeviceType(devicePath string) string {
modaliasPath := path.Join(devicePath, "device", "type")
content, _ := ioutil.ReadFile(modaliasPath)
content, _ := os.ReadFile(modaliasPath)
return strings.TrimSpace(string(content))
}

Expand Down Expand Up @@ -238,7 +238,7 @@ func containsSubFeature(s []gosensors.SubFeature, e gosensors.SubFeatureType) bo
// getLabel read the label of a feature
func getLabel(devicePath string, featureName string) string {
labelPath := path.Join(devicePath, featureName) + "_label"
content, _ := ioutil.ReadFile(labelPath)
content, _ := os.ReadFile(labelPath)
label := string(content)
if len(label) <= 0 {
return path.Join(path.Base(devicePath), featureName)
Expand Down
Loading