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

Improved battery detection #97

Merged

Conversation

jan-guenter
Copy link
Contributor

Improvements to the battery detection:

  • now considering all power supplies (instead of path name filtering)
  • only consider power supplies that are currently present
  • only consider power supplies of type Batter or UPS

All changes made are in accordants to the definitions of /sys/class/power_supply from the kernel docs


This change was made to address the battery issue part of issue #94

This issue is still draft status, since I'm still awaiting feedback by the issue reporter @bionade24 on the test build I provided.

- new considering all power supplies (instead of path name filtering)
- only consider power supplies that are currently present
- only consider power supplies of type Batter or UPS
@aristocratos aristocratos marked this pull request as ready for review October 17, 2021 14:45
Copy link
Owner

@aristocratos aristocratos left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for the fix.

src/linux/btop_collect.cpp Show resolved Hide resolved
@aristocratos aristocratos merged commit 7adbcbb into aristocratos:main Oct 17, 2021
@jan-guenter jan-guenter deleted the battery-detection-issue-94 branch October 17, 2021 15:14
@aristocratos
Copy link
Owner

@jan-guenter
Isn't the path 'src/**' recursive for the workflow trigger? Noticed it didn't trigger when merging this.

github-actions bot pushed a commit to jan-guenter/btop that referenced this pull request Oct 17, 2021
* upstream/main:
  added try catch block as suggested in review aristocratos#97 (comment)
  improved battery detection - new considering all power supplies (instead of path name filtering) - only consider power supplies that are currently present - only consider power supplies of type Batter or UPS
@jan-guenter
Copy link
Contributor Author

jan-guenter commented Oct 17, 2021

@aristocratos

Isn't the path 'src/**' recursive for the workflow trigger? Noticed it didn't trigger when merging this.

According to the docs it should https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet.
This actually is my first time working with GitHub Actions myself, so I'm not too familiar with them, but don't see why it didn't trigger. Perhaps a good time to use the GitHub support you are paying for 😄
Please let me know if you find out why it didn't trigger.

@jan-guenter
Copy link
Contributor Author

@aristocratos
Perhaps the workflow_dispatch trigger I added to allow manual triggers interferes somehow, but I cannot find a good reason for it in the docs.
I also have workflows in my fork that have workflow_dispatch as well as push triggers and they work fine.
https://github.com/jan-guenter/btop/blob/dcfd786582e9389da778b6746c79f9d7d2cf6f63/.github/workflows/cmake-builds.yml#L3-L7

@aristocratos
Copy link
Owner

aristocratos commented Oct 17, 2021

@jan-guenter
Found it, you changed the targeted branch from "main" to "master" when you updated the yml :P

@jan-guenter
Copy link
Contributor Author

Found it, you changed the targeted branch from "main" to "master" when you updated the yml :P

ouch... sorry 😅

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.

None yet

2 participants