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

hwmon: refactor & support lookup of all indices #226

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

vmatare
Copy link
Owner

@vmatare vmatare commented Apr 7, 2023

This should allow the user to omit the indices: config field if a sensor input is sufficiently specified by other criteria. In this case, thinkfan should pick up all pwm/temp files found for the given sensor. A major caveat being that the number of available temperature inputs won't be known before a sensors has been successfully looked up...

src/hwmon.cpp Outdated
auto subdir = path + "/" + entries[i]->d_name;
free(entries[i]);

for (const filesystem::path &subdir : dir_entries<filter_subdirs>(path)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (const filesystem::path &subdir : dir_entries<filter_subdirs>(path)) {
for (const auto &subdir : dir_entries<filter_subdirs>(path)) {

and elsewhere in this PR

src/hwmon.cpp Outdated
else
found_paths_.push_back(path);
else {
vector<filesystem::path> paths = dir_entries<filter_driver_file>(path);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
vector<filesystem::path> paths = dir_entries<filter_driver_file>(path);
auto paths = dir_entries<filter_driver_file>(path);

src/hwmon.cpp Outdated Show resolved Hide resolved
@vmatare vmatare marked this pull request as ready for review October 16, 2024 13:56
src/hwmon.cpp Fixed Show fixed Hide fixed
src/hwmon.cpp Fixed Show fixed Hide fixed
vmatare and others added 3 commits October 17, 2024 01:01
This should allow the user to omit the indices: config field if a sensor
input is sufficiently specified by other criteria. In this case,
thinkfan should pick up all pwm/temp files found for the given sensor. A
major caveat being that the number of available temperature inputs won't
be known before a sensors has been successfully looked up...
Copy link

@wonbinbk wonbinbk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I'm a fan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants